How can I detect when to show a keyboard on a touch device? [closed]
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this questionI'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
- using C++ on Windows
- using Java on Windows
- 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.
精彩评论