How obtain which keyboard is used
Posted: Thu Jun 04, 2020 1:12 pm
Hi everyone,
maybe it was asked somewhere else, but at least I haven't found anything.
I want to create a tool (basically I need it myself) which temporary "locks" the internal keyboard of a laptop without interfering with an external one.
I thought of doing it that way:
* Check on which keyboard (internal or external) a key was pressed.
* if internal keyboard has been used empty keyboard buffer. Thus no key is handed over to any other application
* if external keyboard was used hand over key to system for other applications.
For doing this I need some stuff which I haven't found good information on:
1. How to find out which keyboard was pressed?
2. How to hook into the system so all key pressed can be checked?
3. How to hand over a pressed key to the system again?
I guess I have to use WinAPI as it would not work with builtin functions of purebasic, right?
BTW: I want to write it for Windows
Any ideas or hints?
P.S. I know I could do the same by deinstalling the keyboard driver. On the next reboot the driver would be installed again. But I don't like the need to reboot the computer
Many thnaks
maybe it was asked somewhere else, but at least I haven't found anything.
I want to create a tool (basically I need it myself) which temporary "locks" the internal keyboard of a laptop without interfering with an external one.
I thought of doing it that way:
* Check on which keyboard (internal or external) a key was pressed.
* if internal keyboard has been used empty keyboard buffer. Thus no key is handed over to any other application
* if external keyboard was used hand over key to system for other applications.
For doing this I need some stuff which I haven't found good information on:
1. How to find out which keyboard was pressed?
2. How to hook into the system so all key pressed can be checked?
3. How to hand over a pressed key to the system again?
I guess I have to use WinAPI as it would not work with builtin functions of purebasic, right?
BTW: I want to write it for Windows
Any ideas or hints?
P.S. I know I could do the same by deinstalling the keyboard driver. On the next reboot the driver would be installed again. But I don't like the need to reboot the computer
Many thnaks