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

13
LINES

< > BotCompany Repo | #1015113 // onGlobalMousePress [JNativeHook]

JavaX fragment (include)

import org.jnativehook.mouse.*;

// f: voidfunc(NativeMouseEvent)
static AutoCloseable onGlobalMousePress(fO f) {
  jnativehook_init();
  final NativeMouseInputAdapter listener = new {
    public void nativeMousePressed(NativeMouseEvent e) {
      pcallF(f, e);
    }
  };
  GlobalScreen.addNativeMouseListener(listener);
  ret autoCloseable { GlobalScreen.removeNativeMouseListener(listener); };
}

Author comment

Began life as a copy of #1010548

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015113
Snippet name: onGlobalMousePress [JNativeHook]
Eternal ID of this version: #1015113/6
Text MD5: f8601a4d93de72d8b7a5942e9edda44b
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-15 02:40:29
Source code size: 410 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 523 / 504
Version history: 5 change(s)
Referenced in: [show references]