插入Windows键盘缓冲区 [英] Insert into windows keyboard buffer

查看:464
本文介绍了插入Windows键盘缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要从一个硬件(一个RFID扫描器)读数据,并将其注入到窗户键盘缓冲区。这是使得RFID扫描器可用于捕捉串并注入无论光标目前,因此,例如,如果在一个窗口应用程序的文本框具有焦点,那么这就是该字符串的显示位置。如果通过网络浏览器呈现在Web应用程序中的文本框具有焦点,输入需要出现在那里。

We need to read data from a piece of hardware (an RFID scanner) and inject it into the windows keyboard buffer. This is so that the RFID scanner can be used to capture a string and inject wherever the cursor currently is, so for example, if a text box in a windows app has focus, then that's where the string appears. If a text box in a web application rendered via a web browser has focus, the input needs to appear there.

请注意:这个问题是不是读数据从RFID设备 - 我们能做到这一点,它是关于把我们读入Windows键盘缓冲区,这样不管哪个应用程序具有焦点时,输入出现在光标字符串

Please be aware: the question is NOT about reading the data from the RFID device - we can do this, it's about putting the string we read into the windows keyboard buffer so that no matter which app has focus, the input appears at the cursor.

开发环境是C#.NET

The development environment is C# .NET

非常感谢

托尼

推荐答案

您可以简单地使用SendKeys.SendWait()或SendInput。如果你只是想将击键发送到Windows活跃应用程序中使用的SendKeys。

You can use simply SendKeys.SendWait() or SendInput. Use SendKeys if you just want to send keystrokes to an active application in windows.

这篇关于插入Windows键盘缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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