Issue with hotkeys, alt+s

52 Views Asked by At

Alt+s is used for save in our application. When we press alt+tab then alt is captured and it switch to some different page and when we returned to our application then on pressing only s key its performing save functionality as alt key was already captured. Please suggest solution of this. Already tried releasing alt key on press of alt+tab but on alt+tab,only alt is captured, tab not captured so don't know at what point to release alt key.

1

There are 1 best solutions below

1
On

Without specific code or working snippet I can suggest to work on the blur event of the browser window:

window.onblur = function() {
   // Reset events listeners
};

window.onfocus = function() {
   // Restore your events listeners
};