开发者

How can I detect when to show a keyboard on a touch device? [closed]

开发者 https://www.devze.com 2023-04-10 15:04 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post.
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 9 years ago.

Improve this question

I'm trying to make a program the will run on a touchpad device like this: http://sethsandler.com/multitouch/mtbiggie/

I'm trying to make a keyboard that will pop up when you need it. I'm working in C++ and Windows or Java and Ubuntu (have开发者_如何转开发n't decided yet).

I was hoping people might be able to answer the question: How can I detect when the user needs a keyboard to enter text when I'm

  1. using C++ on Windows
  2. using Java on Windows
  3. using Java on Ubuntu


Presumably you will have some sort of GUI facilities, with several control types available for you to use. Each control must expose if it is interested in keyboard. For example, a TextField control will report that it wants keyboard input, while a Button will not.

Also your GUI engine will have to track which control has focus, based on what the user taps.

Once you have implemented the above, you know that you need to pop the keyboard when the focus moves to a control that reports itself as wanting keyboard input. Inversely, you will hide the keyboard when the focus goes to a control that does not want keyboard input.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号