Skip to content

Hitting escape exits full screen #110

@Hultner

Description

@Hultner

As a person pretty much exclusively using safari in full/split screen mode I find myself constantly exiting fullscreen by accident when using vimari, for instance if I want to return to normal mode after writing a comment like this to hit the submit key from links hint mode.

This can be avoided by preventing default behaviour through an event listener.

Rough example:

function disable_esc_exit(window){
    const ESC_KEY = 27;
    const KEYPRESS_EVENT = "keypress";

    window.addEventListener(KEYPRESS_EVENT, 
        event => event.keyCode === ESC_KEY && event.preventDefault()
    );
}

... 
disable_esc_exit(window);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions