I am trying to capture Shift+F8 in my JQuery application & want it to propagate down. I have read many posts but somehow I am not able to catch Shift+F8 key at all. I found 1 useful lib here but it is able to find 'Shift+F2/F3/...' but not 'Shift+F8' particularly. any suggestions please & thanks in advance.
Environment : Windows & IE (11 & 8)
On any modern browser, you can use a
keydownorkeyupevent handler like this one:or with jQuery:
Whether that works may be browser-specific, because different browsers reserve different key combinations. It works on Chrome and Firefox on my copy of Linux, and on Edge on Windows 10, and IE11 on Windows 8. Note that you have to click inside the window to ensure it has focus.
You've tagged internet-explorer-8. If you really need to support that truly obsolete browser, which doesn't have
addEventListener, use a version of jQuery that still supports IE8 (or thehookEventfunction from this answer, which works on IE8 [or even IE6]) and then instead of usinge.key, usee.which || e.keyCodeand the appropriate keycode. The reason we havee.keynow is that "the appropriate keycode" varies by keyboard layout. On my keyboard,F8is119, so:or using an older version of jQuery that supports IE8: