Keyboard events in OSX detect on-screen keyboard

I am working on an application to detect which keyboard fires key event when several are connected to PC.

I have taken this code as example: https://stackoverflow.com/questions/30380400/how-to-tap-hook-keyboard-events-in-osx-and-record-which-keyboard-fires-each-even

Now when I press key code callback is triggered printing the id of keyboard.

However I have tested it using onscreen keyboard and the application does not detect key presses.

How can I achieve that? What am I missing?

Thanks in advance

Replies

Anyone ? 😟

Do you mean it works with physical devices but not for simulator ? Could you explain why it is a problem ?


If so, you have noticed that some function do not work on simulator (thaht's one of their limits) ;

The problem is that is does not work. Yes, I know a limitation of that funcion now. But still, I would like to know how to recognize key event coming from real keyboard (built-in, usb connected) and virtual one(onscreen)

Being frankly I do not understand your comment. It does not propose solution nor adds anything relevant to my question.

Thanks