Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1032359 // hjs_registerAltGrG - register AltGr/Option+G hotkey

JavaX fragment (include)

1  
// These may not be all they keyCodes depending on region or whatever
2  
sS hjs_registerAltGrG(S code) {
3  
  ret hjs_dollarVars([[
4  
    window.addEventListener('keypress', function(e) {
5  
      if (e.getModifierState("AltGraph") &&
6  
        (e.keyCode == 331 || e.keyCode == 7749)) {
7  
        e.preventDefault();
8  
        $code
9  
      }
10  
    });
11  
  ]], code := JS(code));
12  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032359
Snippet name: hjs_registerAltGrG - register AltGr/Option+G hotkey
Eternal ID of this version: #1032359/11
Text MD5: 4753993c332746eee45232011fab111e
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-04 15:05:14
Source code size: 370 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 160 / 180
Version history: 10 change(s)
Referenced in: [show references]