Update: Another problem with the 'charmap' file implementation is that once you select the 'russian.key' file there is no way to go back to the default except by resetting all settings in the Visual Settings menu.
I've noticed the same today. Walkaround would be to add 'normal.key' keyboard or just 'english' to the available profiles. Or add menu entry 'Reset keyboard profile'. Also, there should be maybe special directory (A/CHDK/KEYBOARDS) to collect all these profiles.
About modular code - I'm not convinient with whole modular stuff, tsvstar did great job to pushing keyboard to reyalp-flt and then to trunk which was beyond my knowledge. So I'm not sure, what do you mean you're not convinced about the style. Could you please describe, what should be changed? Then I could try to do some changes
About charmap handling - yes, it is complicated and I said before it's complicated too much. Many things should be rewritten, but this is another part of work to be done someday... Currently I'm working on some bugfixes of the EDI and providing text_box() function to Lua...
Thank you for your feedback
My view is that:
- the charmaps should be compiled into the module as an array of available maps
- the user selects the desired map by name ('Default', 'Russian', ...) which equates to the array index internally
- the map selection, menu and settings file should all move into the module with just a sub-menu link in the main CHDK code
- the module should implement an API like the zebra and edge overlay so that other code that want to use it can call the module functions
This packages everything related to the module together and provides a simpler interface for end users.
What it does not provide is tsvstars mechanism to specify an alternate text input module by name in the charmap file. In my opinion this is a level of complexity that is not needed - one input method should be enough, the chance of anyone needing or writing another are pretty small.
If I get time over the weekend I may try and implement the above in the reyalp-flt branch.
There are other things that might be worth considering as possible improvements to the text box:
- add support to call it from a Lua script (like the file browser)
- add a numeric charmap for inputting just numbers (probably including '-' and '.' chars). This would probably not be a user selectable charmap option; but might be selectable from the calling code (e.g. a Lua script could call the text box specifying numeric input only).
- change the layout of the charmap display from all horizontal to match the button used to select the chars in each group. e.g. layout might look like
GHIJKL
ABCDEF MNOPQRS
TUVWXYZ
although this needs more room vertically it acts as a visual aid to show which button to use to access the characters.
Phil.
Edit: - I also have found that this code in gui_fselect_kbd_process in the file selector module will sometimes crash the camera. This is what is trying to load the charmap and check the text box module version.
if ( API_VERSION_MATCH_REQUIREMENT( module_tbox_get_version(), 1, 0 ) )
i |= MPOPUP_MORE;