使用触摸屏进行其他控制和键盘 [英] Using touch screen for other controls and keyboard

查看:69
本文介绍了使用触摸屏进行其他控制和键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

我使用的是RPi3和800x480px触摸屏。屏幕通过HDMI连接,通过SPI触摸。有一个我用于第一次测试的演示项目运行完美:  https://microsoft.hackster.io/en-US/dotMorten/windowsiottouch-44af19。

I am using a RPi3 and a 800x480px Touchscreen. The screen is connected via HDMI, the touch via SPI. There is a demo project i used for first test that was running perfect: https://microsoft.hackster.io/en-US/dotMorten/windowsiottouch-44af19.

但是demo仅使用按钮和ScrollView。它适用于自动化同行。对我来说,我想使用其他控件,如文本框,这里出现了我的问题。如果我触摸文本框,它将无法获得焦点,屏幕键盘也不会打开。 

But the demo uses only buttons and a ScrollView. It works with automation peers. For me i wanted to use other controls like a Textbox and here came my problems. If i touch the textbox, it wont get focus and the onscreen keyboard doesnt open. 

我发现在触摸点下搜索控件的例程会在达到时停止文本框内的文本。所以我告诉例程停止,如果找到TextBox控件,我会以编程方式设置焦点。这将打开OnScreen
键盘。比传给下一个问题......键盘躺在屏幕上的控件上,但似乎没有焦点。如果按下某个键,则按下键盘下的控件。 

I found out that the routine that searches for the control under the touch point stops if it has reached the text inside the textbox. So i told the routine to stop if a TextBox control is found and I set the focus on it programmically. That opens the OnScreen Keyboard. Than came the next problem... The Keyboard is lying over the controls on the screens, but seems not to have the focus. If i press on a key, the control under the keyboard is pressed. 

所以我的想法是我按程序生成鼠标点击。因为我可以设置鼠标位置我认为鼠标点击是相等的...但没有像Mouse.click(Pos.X,PoxY)这样的功能。我搜索了网页,只找到了WPF的示例,其中来自user32.dll的函数
是importet来进行鼠标点击。

So my idea was that i generate a mouseclick by program. Because I can set the Mouseposition i thought to make a mouseclick is equal... But there is no function like Mouse.click(Pos.X,PoxY). I searched the web and only found examples for WPF where a function from user32.dll is importet to make a mouseclick.

所以有人知道如何继续解决我的问题?如何使用触摸屏上的值轻松模拟鼠标?

So does someone know how to get on with my problem? How can i easily simulate a mouse by using the values from my touch screen?

谢谢

推荐答案

Hello Wolfi,

Hello Wolfi,

如果主页中只有一个元素:TextBox,你能自动获得焦点吗?

If there is only one element: TextBox in the mainpage, can you get focus automatically?

祝你好运,

Rita


这篇关于使用触摸屏进行其他控制和键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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