Questions tagged [jnativehook]

JNativeHook is an open source library to provide global listeners for keyboard and mouse events

WHat it is?

JNativeHook is an open source library to provide global listeners for keyboard and mouse events.

How it works?

JNativeHook uses a combination of platform dependent hooking techniques combined with JNI, in order to create low-level hooks that deliver the events to the JNativeHooks written in Java.

Related tags

  • for general questions about hooking low-level events and not necessaritly java specific
  • in combination with language independent tags when appropriate: ,
  • use for the .net equivalent

See also

58 questions
6
votes
2 answers

How to install JNativeHook Library?

I am trying to use the JNativeHook library to provide global keyboard and mouse listeners for my Java application. I downloaded the source files from here but I am not sure how to install it to eclipse and make a use of it. I have also looked at the…
james
  • 91
  • 1
  • 3
  • 6
5
votes
1 answer

Case of the confounding key press caper

Background Developing a rudimentary, open-source keyboard and mouse on-screen display desktop application for screen casting, called KmCaster: The application uses the JNativeHook library to receive global keyboard and mouse events, because Swing's…
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
5
votes
0 answers

JnativeHook creates freezing problem on MacOS

I'm doing a program that calculates keyboard mouse mobility on Windows, Mac, and Linux with JAVA. I'm using JNativeHook for get keyboard and mouse moves. It works fine in Windows and Linux, but after 10-15 minutes on MacOS , pc is freezing and I…
Yunus ER
  • 1,999
  • 2
  • 9
  • 14
3
votes
2 answers

Close program with keypress during a loop

I'd like to stop the program if F10 key was pressed. This code types a 1000 times. I am using jnativehook library (https://github.com/kwhat/jnativehook/wiki/Usage). The program runs (with F9) but it doesn't stop when I press…
fini
  • 146
  • 8
2
votes
1 answer

Java robot does not stop

I have a problem with the operation of the JNativeHook library and Java Robot. My robot should run when I press F9 and it should stop when I click F6, but it is not working. I don't know what I am doing wrong here. Every time I tried to stop the…
Macijke
  • 21
  • 2
2
votes
4 answers

While loop not working when running it in thread

So basically i tried to get this while loop to run inside this thread, it should activate when "activate" evaluates to true but for some reason it is not working. "activate" is boolean value which activates when user presses mouse button (i setted…
IchBinIVAN
  • 21
  • 1
2
votes
2 answers

Java jnativehook typing a string not working

I'd like to type: "/ammo" when I type ALT+A. The program runs but it seems like to stop right after the running: I press alt+A or A and the code is not doing anything at all. package jnativehook01; import java.awt.AWTException; import…
fini
  • 146
  • 8
2
votes
1 answer

How to build jnativehook on window 10

I am using jnativehook on my program. I edit source code little and It works well on mac. But When it is executed on window, I got this error. 8월 18, 2017 10:47:48 오전 org.jnativehook.DefaultLibraryLocator getLibraries 심각: Unable to extract the…
백종빈
  • 143
  • 1
  • 11
2
votes
1 answer

JNativeHook Post a native key event

I tried to post a new native key pressing to the system using the java library https://github.com/kwhat/jnativehook. The method GlobalScreen.postNativeEvent(); Needs to get passed a NativeInputEvent object, which needs the Parameters An instance…
TheAppService
  • 133
  • 1
  • 1
  • 12
2
votes
1 answer

When I run JavaFx Application in Linux Fedora, my application crash..!

I have made JavaFx application which is running fine in Window , Mac OS but when i run in Linux Fedora the application make crash the whole system with the following log. 1) What is the reason of crash in Linux ? 2) What may the be the possible…
1
vote
1 answer

How to wait for a key to be pressed?

I'm currently using jnativhook from: https://github.com/kwhat/jnativehook to listen for nativekeys. I was trying to make a button that waits for a nativekey to be pressed, and sets that input as the new hotkey. Here's what I've tried so far, but…
Leo
  • 15
  • 7
1
vote
0 answers

How do I create a log-file for JNativeHook data?

So I downloaded JNativeHook (https://github.com/kwhat/jnativehook) but it only captures data for a short period of time before overwriting itself. I'm a complete beginner here, but what I'm trying to do is collect all my mouse and keyboard data, log…
intaboo
  • 11
  • 1
1
vote
0 answers

Is it possible to emit the numpad arrow key in Java?

Background Operating systems (I'm on Windows 10, if it matters) have a feature called Mouse Keys that allow you to perform the operations of the mouse using the numpad. Press 5 to click, 8/2/4/6 to move the cursor up/down/left/right, and so on. The…
loof
  • 11
  • 3
1
vote
1 answer

java.lang.UnsatisfiedLinkError: URI scheme is not "file" with javafx:jlink

Hello i am using jnativehook library with javafx running with mvn javafx:run works fine but with mvn javafx:jlink fails to start with a launcher, here is javafx plugin xml, org.openjfx
srilakshmikanthanp
  • 2,231
  • 1
  • 8
  • 25
1
vote
1 answer

How to check which modifiers were pressed for a NativeKeyEvent?

I am trying to write my first global hotkey listener using jnativehook. The modifiers part doesn't seem to have a clear description for beginners, but I'm sure this is a quick one to answer for someone who is familiar. I want to test if…
Matt Groth
  • 470
  • 4
  • 20
1
2 3 4