There has been a rather large overhaul of the text editing functionality in Enigma2 (with a first step in the CVS of 071128 and a second step 071216). In addition to various bug fixes and general enhancements, the new version makes it easier to enter text by the remote control, and provides more complete support for the dreambox keyboard.
Below is a list of the most important features, and after that some hints for plugin authors of what to do to inherit the features.
No doubt there are still bugs and things that don't work well, so please report what you find.
Best Regards
Anders Holst
List of features
Easier text input by the remote control:
- Insert mode is the default instead of overwrite mode when editing text.
- Now both "deleteBackwards" and "deleteForwards" can be accessed from the remote control (as "<" and ">", in addition to the old "mute" for "deleteForwards").
- Allow for faster text input with the remote control: it is not necessary to wait for the timeout of the previous letter before starting on a new, provided they sit on different keys.
General text editing features:
- When entering a text input field, the whole default content is "selected" such that it is removed by the first editing key. Pressing a direction key will unselect it, and the default content can be edited.
- Long entries that don't fit on the line is now scrolled horizontally to always show the insert point. (This requires use of the parameter "visible_width" when creating the python widget.)
Dreambox keyboard support:
- Enable keyboard text input in configuration dialogs (in addition to the previous text input support that was limited to input boxes).
- Several key bindings to make all functionality that is currently accessible from the remote control also accessible from the keyboard. This include bindings of "play", "stop", "pause", "rewind", "fast-forward", etc. (This only holds for the standard packages in the standard distribution. Other packages that provide their own key bindings may have to complete them to provide full keyboard support.)
Hints to plugin authors
Most features above will work immediately as long as text editing is done by "InputBox" or "ConfigText" elements. There are two exceptions to this, which may require extra attention: horizontal scrolling and keyboard key bindings. They are each discussed below. If, instead of using "InputBox" or "ConfigText", you provide your own text editing widget, you may want to check out the code for one of these two widgets to be able to provide a consistent interface which has both remote control and keyboard support.
If you in your plugin like to edit a text field that may become very long (e.g. the description of a movie), you may want to enable horizontal scrolling of that text field. Then all you have to do is to give the parameter "visible_width = NUM" in the argument list when creating the ConfigText or InputBox element, where NUM is the maximum number of visible characters of that field in the dialog. (This number is of course just an approximation, since the font is not fixed width.)
If you provide your own "keymap.xml" bindings, then you may have to add a few bindings to make the plugin work with the keyboard. First, make sure that you have the same binding for KEY_ESC as for KEY_EXIT, and the same binding for KEY_ENTER as for KEY_OK. That will make the interface consistent with all other dialogs. Further, on the remote control several functions are overloaded onto KEY_RED, KEY_GREEN, KEY_YELLOW, KEY_BLUE, KEY_TV, and KEY_RADIO, whereas on the keyboard you also have KEY_REWIND, KEY_PLAY, KEY_PAUSE, KEY_FASTFORWARD, KEY_STOP, KEY_RECORD, KEY_PREVIOUSSONG, and KEY_NEXTSONG, and you may like to use them in addition when appropriate. (For example, it makes no sense to stop the playback of something by pressing the "TV" button on the keyboard.) Finally, on the keyboard there are no KEY_PREVIOUS and KEY_NEXT (labeled "<" and ">" on the remote control) but the keys on the keyboard with the same symbols instead generate KEY_BACK and KEY_FORWARD, so you may consider adding the same bindings to those. By the way, the device tag for the keyboard is "dreambox ir keyboard", so you can separate the keyboard specific bindings from the rest. If you follow these simple rules your plugin will be "keyboard compatible".
That's it. Good luck!