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
0
votes
0 answers

How can I use the keyboard arrows to navigate in my menu with JNativeHook?

I want to be able to navigate through my menu with the arrows and I don't know how to apply it on my program. I have a simple menu private static String[] options = {"1- Plus 1", "2- Minus 1", "3- Exit", }; …
Ifini
  • 1
  • 1
0
votes
1 answer

Can't disable NativeMouseListener in jnativehook-2.1.0.jar

So as the title suggests, I'm trying to disable the mouse listener within jnativehook-2.1.0 and it just won't work, the reason I'm making a keylogger is to spy on my wife. So here's the code that I'm using: package main; import…
0
votes
1 answer

Can't use variable "ok" in "Togg"

I'm trying to make it so that when a button is clicked, the user presses any key and this is written to tog1. But I get that ok = null. I don't understand why "ok" which is a string only works inside "nativeKeyReleased". Already tried to use…
LINS
  • 3
  • 2
0
votes
1 answer

Maven doesn't compile the project with jNativeHook from Github

I have added Jitpack repo and dependency from Github to pom.xml and it still doesn't compile. However, when I point onto the line in import block, it clearly shows the description of a module. VSCode screenshot For example, I try to import…
awayneff
  • 1
  • 1
  • 1
0
votes
2 answers

Required filename-based automodules detected. Please don't publish this project to a public artifact repository

so i made a very simple java Project with Maven in which i used a Libary jnativehook and in intellij it works just fine but when i use jlink to export it this Warning comes up Required filename-based automodules detected. Please don't publish this…
0
votes
1 answer

Java NativeKeyListener finished with exit code 0

I am trying to make a program that can detect my key strokes then based on them do something but every time I run my program it just finishes with exit code 0 even though I have the listeners initialized any ideas? (I got no errors) public class…
user14732842
0
votes
0 answers

Problem during creating jar with jnativehook library Maven JAR

Currently, I make a simple clicker in java. I liked the library jnativehook, because it's working in the background and I added it as a dependency jnativehook com.1stleg
simoneQ
  • 1
  • 5
0
votes
0 answers

Java NativeKeyListener doesn't work inside another application

I have a Java swing application in which it became necessary to work with global keyboard input keys for Windows, Mac and Linux OS. For this purpose I decided to use the jnativehook library version: '2.1.0', since it is said that it allows you to do…
Neo
  • 69
  • 7
0
votes
1 answer

Java / Transform key from keyboard or mouse to another key

I have a swing Java application (A) that launches another application (B) using Runtime.getRuntime().exec() when a certain button is pressed. Is it possible to set a certain Key Hook so that when the application (B) is open and active, it changes…
Neo
  • 69
  • 7
0
votes
2 answers

JNativeHook Class not found

I needed a KeyListener which also works outside a focused GUI component, so after performing research I came across the JNativeHook library. But as soon as I downloadet the ZIB file (from here) and added the jnativehook-2.1.0.jar to my Eclipse…
erikcox
  • 75
  • 6
0
votes
1 answer

How to deactivate jnativehook on demand?

If my understanding serves me correct jnativehook can be turned on and off with these two commands: GlobalScreen.removeNativeKeyListener(this); //this shuts it down GlobalScreen.addNativeKeyListener(this);//and this turns it back on again by this…
jorma uotinen
  • 15
  • 1
  • 3
0
votes
0 answers

JavaFX and jnativehook library conflict

I used jnativehook for global keyboard listening. I created GUI in JavaFX 11. I have a TextField to define name of a file created after pressing specified key combination. The problem is I cannot edit text in the TextField by keyboard. I can delete…
0
votes
1 answer

when calling void with throws keyword, all thrown errors apply to where i call the void

i am currently trying to make a shift key holder with java using the grave accent as the toggle and robot was the only way i could find that was remotely simple. the program does what the name implies, and holds down the shift key for me. making the…
Vortetty
  • 129
  • 1
  • 1
  • 11
0
votes
1 answer

Detect open folder in Java (JNativeHook)

I'm using JNativeHook to detect drags and clicks outside a JFrame in my program and it's running perfectly. The thing is I need a way (either using JNativeHook or anything else) to check if a folder is opened in my explorer (Finder for Mac) so that…
0
votes
1 answer

Jnativehook Mouse Listener problem (Java)

I'm trying to make a boolean true while I hold left click and make it false when I don't, I'm trying to use "Jnativehook" Mouse Listener" (https://github.com/kwhat/jnativehook/wiki/Mouse) but the boolean isn't changing. Code: package…
xyz
  • 15
  • 1
  • 5