CHDK - virtual keyboard - testers needed! - page 10 - General Discussion and Assistance - CHDK Forum supplierdeeply

CHDK - virtual keyboard - testers needed!

  • 150 Replies
  • 21878 Views
Re: CHDK - virtual keyboard - testers needed!
« Reply #90 on: 11 / January / 2012, 04:37:10 »
Advertisements
I commit to branch several fixes, including:
- include russian.key into full.zip
- last visual fix from TobyMarg
- moving to language files implemented new features of filebrowser (unnecessary messages are removed to save space). Not moved "rmdir"(not implemented) and "Load keyboard profile"(just forget :))

Not fixed:
- Long filename issue in filebrowser
- Looks like that visual fix is not enough. :( Please load "russian.key" keyboard profile and switch to russian lines. Box still broken (but now on left side), while fix is implemented and MAX_WIDTH is increased
- rmdir is not implemented

Re: CHDK - virtual keyboard - testers needed!
« Reply #91 on: 11 / January / 2012, 11:57:19 »
- Looks like that visual fix is not enough. :( Please load "russian.key" keyboard profile and switch to russian lines. Box still broken (but now on left side), while fix is implemented and MAX_WIDTH is increased
I hope it's now fixed. I couldn't test it with russian.key (because of an ptpcam error only in reyalp branch), but I tested it with a long line (1234567890|1234567890|1234567890|1234567890) and it worked.

Re: CHDK - virtual keyboard - testers needed!
« Reply #92 on: 12 / January / 2012, 15:10:50 »
Forgive me for being silent for so long:)

I found the problem with the long keymaps. In general tbox width is good, but keyboard is displayed bad (it is moved one char to left). Bud modification of this:

Code: (c) [Select]
offs = ((strlen(tbox_chars[0])-strlen(tbox_chars[pline]))>>1)*FONT_WIDTH;

to this:

Code: (c) [Select]
offs = (((strlen(tbox_chars[0])-strlen(tbox_chars[pline]))>>1)+1)*FONT_WIDTH;

causes problem too. This depends on wheter max keymap is odd or even and that's why Tobi didn't notice that... I could simply patch this using (lenght%2) but this is ugly idea...

I feel lost in the code. Are all these w, l, h, i key_offset_x variables required?

EDIT: I found the way to fix (and a little bit simplify) the keyboard drawing. New version below :) Works with standard and russian as well. Maybe better idea would be to have static x and y variables and just use them while drawing anything instead of different offsets.

----

There is another and even worst problem. When I changed keyboard profile my CCHDK.CFG file became corrubpted (I had problems with GUI colors after reboot). I'm not absolutely sure wheter this is really related with keyboard, but I'll investigate it a little bit more.

To reproduce the bug do as follows:
  • Take fresh reyalp-flt branch without CCHDK.CFG
  • Change keyboard map to russian (not only this one, but this is for sure)
  • Turn off and turn on your camera
  • Go to the CHDK menu and see the difference.

Maybe there's a bug in config at all, not caused by tbox. And this is even more likely, since CHDK core should prevent any changes in other config entries.

PS. I'm using SX130IS and reyalp-flt #1544.
« Last Edit: 12 / January / 2012, 16:48:00 by outslider »
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3124
    • Photos
Re: CHDK - virtual keyboard - testers needed!
« Reply #93 on: 12 / January / 2012, 16:38:21 »
There is another and even worst problem. When I changed keyboard profile my CCHDK.CFG file became corrubpted (I had problems with GUI colors after reboot). I'm not absolutely sure wheter this is really related with keyboard, but I'll investigate it a little bit more.

To reproduce the bug do as follows:
  • Take fresh reyalp-flt branch without CCHDK.CFG
  • Change keyboard map to russian (not only this one, but this is for sure)
  • Turn off and turn on your camera
  • Go to the CHDK menu and see the difference.

Could be related to the change that moves module specific config items out of the main config file into module config files.

I will have a look at this tonight.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)


Re: CHDK - virtual keyboard - testers needed!
« Reply #94 on: 15 / January / 2012, 14:05:44 »
"  To reproduce the bug do as follows:
  • Take fresh reyalp-flt branch without CCHDK.CFG
  • Change keyboard map to russian (not only this one, but this is for sure)
  • Turn off and turn on your camera
  • Go to the CHDK menu and see the difference.

Could be related to the change that moves module specific config items out of the main config file into module config files.  "

I had similar but thought it was connected with  EXMEM and module move.  Now with #1546 and no EXMEM compile did not notice that menu color change.  Did not try changing to russian. 

I did notice that the grid cfg file does not seem to erase every config setting when changing grid files. That may just be me, seems like first line of coordinates in default grid left in config file along with other remnants when viewed in text file reader.  Delete with file browser did not seem to help here.

DSW,
Dave1116
a1100is CHDK shell 4xx compile

« Last Edit: 15 / January / 2012, 14:13:32 by Dave1116 »
Canon a1100is 100c, sd1200is 100c



Wikipedia - Hack (computer science), an inelegant but effective solution to a computing problem.

*

Offline philmoz

  • *****
  • 3124
    • Photos
Re: CHDK - virtual keyboard - testers needed!
« Reply #95 on: 15 / January / 2012, 17:07:04 »

I did notice that the grid cfg file does not seem to erase every config setting when changing grid files. That may just be me, seems like first line of coordinates in default grid left in config file along with other remnants when viewed in text file reader.  Delete with file browser did not seem to help here.


That's probably because of the way CHDK stores strings (e.g. filenames) in the config files.
Strings are always stored in a 100 character buffer; but the code does not clear out the unused space in the buffer past the end of the string. This means you will often get random rubbish from other things in the config file after the string. It's harmless since the string itself is terminated with a 0 so the extra stuff is ignored.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: CHDK - virtual keyboard - testers needed!
« Reply #96 on: 16 / January / 2012, 06:16:15 »
Quote from 'new branch - CHDK : Elf Edition - Developers wanted'.

I'm not convinced that the module interface and the whole 'charmap' handling is a good solution though.
Seems like needless complication of the whole text box system to me.

Do you mean code and API or user interface? Both things can be changed. However user interface seems to be as simple and usefull as possible. It's hard to design better typing interface having only a few keys:)
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3124
    • Photos
Re: CHDK - virtual keyboard - testers needed!
« Reply #97 on: 16 / January / 2012, 14:05:04 »
Quote from 'new branch - CHDK : Elf Edition - Developers wanted'.

I'm not convinced that the module interface and the whole 'charmap' handling is a good solution though.
Seems like needless complication of the whole text box system to me.

Do you mean code and API or user interface? Both things can be changed. However user interface seems to be as simple and usefull as possible. It's hard to design better typing interface having only a few keys:)

The user interface is fine, I'm referring to the way it's been integrated as a module and how the 'charmap' part works.

Phil.

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.

« Last Edit: 18 / January / 2012, 03:37:32 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)


Re: CHDK - virtual keyboard - testers needed!
« Reply #98 on: 18 / January / 2012, 14:31:46 »
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 :)

PS.

I'm trying to add Lua command such as text_box() but seems to be not working correct. The code I have add to the luascript.c:

Code: (c) [Select]
static void text_box_done(char *fn) {
    state_kbd_script_run = 1;
    // Clear the Func/Set key so that when the script exits, pressing
    // the Func/Set key again will enter the Script menu, not the File Browser
    kbd_reset_autoclicked_key();
   
    lua_pushstring( L, "test just");
}

static int luaCB_text_box( lua_State* L ) {
    // Disconnect button input from script so buttons will work in file browser
    state_kbd_script_run = 0;

    module_tbox_run(LANG_POPUP_MKDIR, LANG_PROMPT_MKDIR, ":D", 15, text_box_done);
   
    return lua_yield(L, 0);
}

and of cource I've added FUNC(text_box).

It's almost the same as for filebrowser. At the moment I didn't provide a method to set own title and message, since I have other problem. I can load the keyboard from Lua command and it works well. However, when I press 'OK' or 'Cancel' the text box disappears as it should, but the keyboard (I mean physical camera keyboard) is locked. Seems like the script routine have no access to the keyboard. The only think I can do is break the script with shoot_full...
« Last Edit: 19 / January / 2012, 03:37:39 by outslider »
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3124
    • Photos
Re: CHDK - virtual keyboard - testers needed!
« Reply #99 on: 19 / January / 2012, 03:22:05 »
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.
Code: [Select]
if ( API_VERSION_MATCH_REQUIREMENT( module_tbox_get_version(), 1, 0 ) )
i |= MPOPUP_MORE;

« Last Edit: 19 / January / 2012, 04:54:36 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

 

Related Topics