9 messages in net.java.dev.jna.usersRe: [jna-users] callback at keyboard ...
FromSent OnAttachments
Michele CrociNov 5, 2007 12:58 am 
Timothy WallNov 5, 2007 5:56 am 
Michele CrociNov 5, 2007 10:17 am 
Timothy WallNov 5, 2007 10:41 am 
Timothy WallNov 5, 2007 10:45 am 
Michele CrociNov 6, 2007 2:45 am 
Timothy WallNov 6, 2007 6:58 am 
Michele CrociNov 7, 2007 2:53 am 
Timothy WallNov 7, 2007 6:32 am.c
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] callback at keyboard eventActions...
From:Timothy Wall (twal@dev.java.net)
Date:Nov 7, 2007 6:32:29 am
List:net.java.dev.jna.users
Attachments:

On Nov 7, 2007, at 5:53 AM, Michele Croci wrote:

Hi Timothy,

thank you for the resources and for your time. I have read a lot and looked to some examples, but I haven't found the solution to my problem. This is the situation: - if I install a WH_KEYBOARD hook, the hook function is never called - if I install a WH_KEYBOARD_LL hook the hook function is called once, then the JVM crashes.

Probably the next step is to attach a debugger to the process (probably while stopped in the java callback code in a java debugger) so that you can catch the illegal access and determine exactly where it is failing. My guess would be in the libffi trampoline code. But unless you're handy with C/assembly and an associated debugger (VC or gdb would probably work), that might be difficult and slow.

I have one last question. I have read again one of your previous answers not understanding one sentence:

"I tried that example as well, and found that the regular keyboard hook didn't work (which is why it isn't yet in the contrib area of the project). I didn't have time to spend playing around with it to find the problem."

What is a regular keyboard hook? The WH_KEYBOARD hook? It's not yet supported by JNA?

I've never been able to get WH_KEYBOARD to produce anything; it may be because that type of hook *must* reside in a DLL (I haven't tried to get it to work in a regular C program). All the examples I've seen on the net have used the low level hook.

I wrote a little C program to do the same thing as the java, and while it works, it never returns from GetMessage, which seems rather odd. Not sure if this is related to the Java issue. See attached: