Delphi中如何区分多个键盘? [英] How to distinguish Multiple Keyboards in Delphi?

查看:11
本文介绍了Delphi中如何区分多个键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个连接到 PC 的键盘.一个用于输入 TMemo1,另一个用于 TMemo2.两者都可以同时打字.问题是我无法区分一个键盘输入的内容和第二个键盘输入的内容.

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 what keyboard-one has typed and what keyboard-two has typed.

有什么办法可以区分,某些输入来自哪个设备?

Is there any way to distinguish, which device certain input came from?

推荐答案

@Dian,可以使用RegisterRawInputDevices 函数用于注册键盘并监控 WM_INPUT 消息以确定输入来自的设备(键盘).

@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

这篇关于Delphi中如何区分多个键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆