How to distinguish Multiple Keyboards in Delphi?

后端 未结 2 821
慢半拍i
慢半拍i 2020-11-29 05:58

I have two keyboards attached to a PC. One is used to type in TMemo1 and the other in TMemo2. Both are allowed to type at the same time. The problem is I cannot distinguish

2条回答
  •  一向
    一向 (楼主)
    2020-11-29 06:58

    @Dian, you can use the RegisterRawInputDevices function to register the keyboards and monitor the WM_INPUT message to determine the device (keyboard) where the input came from.

    check theses links for more info

    • Using Raw Input from C# to handle multiple keyboards
    • WM_INPUT Message

提交回复
热议问题