Timothy,
Thanks for the clarification. I was not aware of this.
What do you think is the best way for building a global key listener,
using WH_KEYBOARD_LL or WH_KEYBOARD ?
What is the advantage/disadvantage of each ?
Most examples I found on the internet use WH_KEYBOARD.
Concerning the bug you have found with WH_KEYBOARD_LL. Have you already
checked the changes into subversion ?
- Ron
On Nov 13, 2007, at 1:22 AM, rzo wrote:
As stated:
"A global hook procedure is called in the context of all applications
in the desktop, so the procedure must reside in a separate DLL from
the application installing the hook procedure."
The exception here is low-level keyboard and mouse hooks, which do *not*
have to reside in a DLL. From MSDN:
However, the WH_KEYBOARD_LL hook is not injected into another process.
Instead, the context switches back to the process that installed the
hook and it is called in its original context. Then the context
switches back to the application that generated the event.
Therefore, I assume, the hook procedure cannot reside within the java
code. It must be declared in a separate DLL. The keyboard events are
then sent from the DLL to a Window per PostMessage.
Within my contribution, I have Implemented a DummyWindow, which you
may use to receive these events within your java application.
Thanks for the contribution!