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.
Asked
Active
Viewed 1,634 times
1

saplingPro
- 20,769
- 53
- 137
- 195
-
Please don't ask the same question more than once: http://stackoverflow.com/questions/10684594/writing-a-key-listener-in-c – technomage May 21 '12 at 15:09
-
possible duplicate of [JNA Keyboard Hook in Windows](http://stackoverflow.com/questions/3078646/jna-keyboard-hook-in-windows) – markus Jun 03 '12 at 14:38
1 Answers
1
Take a look at jnativehook. It's a library for using system-wide keyboard / mouse hooks from Java.

npe
- 15,395
- 1
- 56
- 55
-
but i wanted to use `SetWindowsHookEx` and see how can i use it with java – saplingPro May 22 '12 at 04:38
-
i have been using it and has been very useful. Thanks:) I had forgotten to accept the answer – saplingPro May 31 '12 at 11:04