Arrow Key Behavior (Chrome, Firefox, maybe others)

Dex-chan lover
Joined
Jan 18, 2018
Messages
160
1. Using hotkeys to switch browser tabs will cause arrow keys to stop turning pages (up and down movement still works)
2. After clicking on the dropdown of a chapter, left/arrow keys can't be used to switch pages and will stay affixed to the drop down menu until you click somewhere else on the webpage
 
is a Reindeer
VIP
Joined
Jan 24, 2018
Messages
3,231
Ctrl + Tab works on/off from not working at all and now Alt Tab kinda screws with it a little more consistently as well
When the arrow key breaks from the tab method, clicking on the background doesn't help to restore functionality. Only refreshing the page helps.
 
Contributor
Joined
Jan 22, 2018
Messages
75
This issue is that
Code:
isPressed
is set to
Code:
'Alt'
.

It's waiting for a
Code:
keyup
event with a
Code:
.key
of
Code:
'Alt'
, but the user
Code:
Alt+Tab
s, that event never occurs

Code:
var isPressed = false;
$(document).keyup(function(evt) {
    if (evt.key === isPressed) {
        isPressed = false;
    }
})
and
Code:
    if (isPressed !== false) return;
    isPressed = evt.key;
should be replaced with something like
Code:
if (evt.altKey || evt.ctrlKey || evt.metaKey) return;
in
Code:
$(document).keydown(function(evt) {...})
 
Contributor
Joined
Jan 22, 2018
Messages
75
The same happens with Ctrl+Tab, but the
Code:
keyup
for
Code:
Ctrl
happens on FF but not Chrome. Clicking back to the tab will result in a stuck `isPressed` for either browser
 

Users who are viewing this thread

Top