Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"T" but also works with F5! #4

Open
Sneffel opened this issue Oct 2, 2022 · 1 comment
Open

"T" but also works with F5! #4

Sneffel opened this issue Oct 2, 2022 · 1 comment

Comments

@Sneffel
Copy link

Sneffel commented Oct 2, 2022

Hi. I have this weird issue where if I press F5 to refresh the page, the T command gets caught as well even if I didn't specify it.
I made this example.

The code for the T shortcut is this one (line 57). I added the alert for the test.

shortcut.add("T", function doKeyCheck() { alert("T!"); var pagebutton= document.getElementById("todo"); pagebutton.click(); },{ 'disable_in_input': true });

And it looks like F6 activates "U"

@Sneffel
Copy link
Author

Sneffel commented Oct 4, 2022

I found the fix. It was pointed out 11 years ago!!
Replace line 71:

var character = String.fromCharCode(code).toLowerCase();
(nowadays it's let instead of var)

with

if( code == 32 || (code >= 48 && code <= 90) || (code >= 96 && code <= 111) || (code >= 186 && code <= 192) || (code >= 219 && code <= 222)) { var character = String.fromCharCode(code).toLowerCase();}
(keep it as var, let breaks it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant