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

11
LINES

< > BotCompany Repo | #1032141 // hjs_redirectRandomKeystrokesToAutofocusField

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (3279L) is out of date.

sS hjs_redirectRandomKeystrokesToAutofocusField() {
  ret hjs([[
    $(document).on('keydown', function(e) {
      var nodeName = e.target.nodeName;
      if ( 'INPUT' == nodeName || 'TEXTAREA' == nodeName ) return;
      var key = event.which;
      if (key == 33 || key == 34) return; // pg up/dn
      $('[autofocus]').val('').trigger('focus');
    });
  ]]);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1032141
Snippet name: hjs_redirectRandomKeystrokesToAutofocusField
Eternal ID of this version: #1032141/6
Text MD5: 84f864f91da93712c2ef3aa2e97167db
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-14 09:31:29
Source code size: 374 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 109 / 143
Version history: 5 change(s)
Referenced in: [show references]