• Joel Martin's avatar
    Release down/pressed keys when window loses focus. · 6671c762
    Joel Martin authored
    May window managers have a keyboard shortcut that switch away from the
    current desktop (e.g. desktop switcher). Unfortunately, when this
    happens, the meta/control keys that are used with the shortcut will
    send a down event to the browser, but the up event will never be sent
    because the browser no longer has focus at the point when the up event
    happens. This can cause weird stuck key issues for VNC clients (not
    just noVNC). To get around this, we try and detect when the browser
    loses focus and release any keys that are on the keyDownList.
    
    As an aside, if you run into this situation (in noVNC or another VNC
    client), you can unstick the state by pressing and releasing the Ctrl,
    Shift, Alt, etc.
    
    Addresses: https://github.com/kanaka/noVNC/pull/135
    6671c762
input.js 49.7 KB