Libraryless. Click here for Pure Java version (5048L/28K).
1 | static AutoCloseable tempAddGlobalMouseListener(IVF1<MouseEvent> onEvent) { |
2 | AWTEventListener l = new AWTEventListener { |
3 | public void eventDispatched(AWTEvent evt) { |
4 | if (evt cast MouseEvent) |
5 | pcallF_typed(onEvent, evt); |
6 | } |
7 | }; |
8 | |
9 | Toolkit.getDefaultToolkit().addAWTEventListener(l, AWTEvent.MOUSE_EVENT_MASK); |
10 | ret -> Toolkit.getDefaultToolkit().removeAWTEventListener(l); |
11 | } |
Began life as a copy of #1003983
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020885 |
Snippet name: | tempAddGlobalMouseListener - add a global AWT mouse event listener (just clicks, not motion) |
Eternal ID of this version: | #1020885/9 |
Text MD5: | 0b09e764a8a1599f889b2f7aac5ad692 |
Transpilation MD5: | 76e876547f4e36320d63e3e8ddc17b55 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-24 18:22:13 |
Source code size: | 407 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 352 / 480 |
Version history: | 8 change(s) |
Referenced in: | [show references] |