javawinapijava-native-interfacehookkeylogger

How to use SetWindowsHookEx function with java?


I want to log the keys in a table that i have designed in java. To get the keys user is pressing (on windows) i am advised to use the function SetWindowsHookEx. But i don't know how to use this function. Basically i want SetWindowsHookEx to call my java function with the key strokes it has received.Then i will log those keys into the table for the user to see it later. I don't understand the arguments of the mentioned function. Basically how do i use this function to implement the task.


Solution

  • Take a look at jnativehook. It's a library for using system-wide keyboard / mouse hooks from Java.