|
SummarySometimes you need the user to enter text into your application. Perhaps they need to enter a password or a name for a new file or folder. Whatever the reason, you'll need to provide a way for them to "type" in text using just the remote control.Fortunately Roku has provided a keyboard window class sample code. This seciont shows how to integrate the keyboard window into your application, including showing it on-screen and handling entered text. Showing the KeyboardThe keyboard is intended to be used as a child window of your application main window. You can construct it early in your application if you wish (during your main window is constructed, for example). When the time comes to show the keyboard, simply call Materialize on the keyboard to ause it to be shown on-screen.[TBD -- sample code here] The Key-Press HandlerThe KeyboardWindow class provides keystrokes to a callback function. You must write the callback function to do something with received keypresses, and tell KeyboardWindow about your callback function so it knows where to send new keypresses.You callback function should implement the OnEntryProc prototype, meaning that it should accept two parameters:
In our example, we'll have the callback function pass the strings received back to the main window for rendering on the screen. [TBD -- sample code here] |
Copyright © 2024 Andrew Oliver