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: | 285 / 313 |
Version history: | 5 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1019019 - tempOnKeyTyped #1020450 - onCharDown |