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

12
LINES

< > BotCompany Repo | #1019018 // onKeyTyped - might not work, keycode = 0?

JavaX fragment (include)

static <A extends JComponent> A onKeyTyped(final int keyCode, final Runnable r, final A a) {
  if (a != null) swing {
    a.addKeyListener(new KeyAdapter {
      @Override
      public void keyTyped(KeyEvent e) {
        if (e.getKeyCode() == keyCode && e.getModifiers() == 0)
          pcallF(r);
      }
    });
  });
  ret a;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019018
Snippet name: onKeyTyped - might not work, keycode = 0?
Eternal ID of this version: #1019018/6
Text MD5: 6bac6492dc1ef2299ce648d0de6e1996
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-21 12:55:37
Source code size: 341 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 239 / 276
Version history: 5 change(s)
Referenced in: [show references]