如何从同一项目中的用户创建的触摸屏键盘发送键值 [英] How do you send a key value from a user created touch screen keyboard within the same project

查看:110
本文介绍了如何从同一项目中的用户创建的触摸屏键盘发送键值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows窗体应用程序,我正在Windows 7机器上开发。我在我的项目中创建了自己的触摸屏键盘...当我运行我的应用程序时...我根据需要调用键盘但是当我按下一个键时没有任何反应...如果我打开记事本并选择键...键值显示在记事本中...看起来我的键盘仍然从文本框中聚焦...

解决方案

请参阅我对该问题的评论。



另请参阅我在虚拟键盘上的过去答案:

如何在WPF按钮点击时触发按键按键事件 [ 1 ],

如何在WPF按钮点击时触发按键按键事件 [ 3 ],

应用程序焦点的输入和丢失



不要注意一些答案与WPF有关(最后一个是特定于 System.Windows.Forms ,原则是相同的。主要思想是:如果您需要开发系统范围的虚拟键盘,则不能依赖任何特定的东西,例如消息抽取(不用于WPF控件或某些其他Windows软件)。该方法应该是通用的和低级的,因此 SendInput



-SA

i have a Windows form application that i'm developing on a windows 7 machine. i created my own touch screen keyboard form within my project... when i run my app.. i call the keyboard as needed but when i press a key nothing happens.. if i open notepad and select the keys ... the key values are displayed in note pad... it looks like my keyboard stills focus from the textboxes ...

解决方案

Please see my comment to the question.

See also my past answers on virtual keyboards:
How to fire a Key Press event of a Key on button click in WPF [1],
How to fire a Key Press event of a Key on button click in WPF [3],
Application focus getting and losing.

Don't pay attention that some answers are related to WPF (and the last one is specific to System.Windows.Forms, the principles are the same. The main idea is: if you need to develop system-wide virtual keyboard, you cannot rely on anything specific, such as message pumping (not used at the level of WPF controls or some other Windows software). The approach should be universal and low-level, hence SendInput.

—SA


这篇关于如何从同一项目中的用户创建的触摸屏键盘发送键值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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