1 | static L<NativeKeyAdapter> onGlobalKeyRelease_listeners = synchroList(); |
2 | |
3 | // f: voidfunc(NativeKeyEvent) |
4 | static AutoCloseable onGlobalKeyRelease(fO f) { |
5 | jnativehook_init(); |
6 | final NativeKeyAdapter listener = new { |
7 | @Override |
8 | public void nativeKeyReleased(NativeKeyEvent e) { |
9 | pcallF(f, e); |
10 | } |
11 | }; |
12 | GlobalScreen.addNativeKeyListener(addAndReturn(onGlobalKeyRelease_listeners, listener)); |
13 | ret autoCloseable { GlobalScreen.removeNativeKeyListener(listener); }; |
14 | } |
15 | |
16 | static void cleanMeUp_onGlobalKeyRelease() { |
17 | for (NativeKeyAdapter a : getAndClearList(onGlobalKeyRelease_listeners)) |
18 | GlobalScreen.removeNativeKeyListener(a); |
19 | } |
Began life as a copy of #1010548
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010551 |
Snippet name: | onGlobalKeyRelease [JNativeHook] |
Eternal ID of this version: | #1010551/2 |
Text MD5: | 7d32699080a6e57753f8098c24654410 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-25 14:37:46 |
Source code size: | 667 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 381 / 409 |
Version history: | 1 change(s) |
Referenced in: | [show references] |