如何在 .Net Compact Framework 3.5 中手动引发系统 KeyDown 事件
我在我的应用程序中使用 resco 控件开发了一个自定义键盘我目前已使用以下代码处理了退格按钮单击事件
private void customKeyboard1_KeyboardKeyUp(object sender, Resco.Controls.Keyboard.KeyPressedEventArgs e)
{
if (e.Key.Text == "Backspace")
{
Resco.Controls.Keyboard.CustomKeyboard.SendBackspace();
e.Handled = true;
}
}
这适用于应用程序中的编辑框,但不适用于网页中的编辑框(例如Gmail 用户名文本框)。
那么有什么方法可以手动引发 KeyDown 事件
I have developed a custom keypad using resco controls in my application I have currently handled the backspace button click event with the following code
private void customKeyboard1_KeyboardKeyUp(object sender, Resco.Controls.Keyboard.KeyPressedEventArgs e)
{
if (e.Key.Text == "Backspace")
{
Resco.Controls.Keyboard.CustomKeyboard.SendBackspace();
e.Handled = true;
}
}
This works fine with the edit boxes in the application but not working in edit boxes in the web pages (for eg. on gmail username text box).
so is there any way to raise the KeyDown event manually
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
P/Invoke PostKeybdMessage。
编辑1
大致如下:
P/Invoke PostKeybdMessage.
EDIT 1
Something along these lines: