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

CHDK - virtual keyboard - testers needed!

  • 150 Replies
  • 43782 Views
Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #10 on: 16 / December / 2011, 14:24:16 »
Advertisements
tsvstar,

Thank you for your overview of the needed functions, I will write is as soon as I can.

Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #11 on: 16 / December / 2011, 16:09:50 »
I guess it does not have to have any "OK" or "Cancel" Boxes. Keyboard as istself should be just one line at the bottom of the screen. Exactly the same idea, the keyboard in Edi - just one line at the bottom, but with colored chars. Nothing more.
There should be other elements, that use this keyboard - text fields. They should be for example mboxes or something.
It have to be independent - script will load only the keyboard since console already is a text field, while menu will load special text field, which will load the keyboard.

It'll be simmilar to the keyboards in Android phones - one thing is text field and other is a keyboard.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #12 on: 17 / December / 2011, 01:34:05 »
I do agree that keyboard is not the same as editbox.

But is so simple keyboard useful if you need to control almost everything? Could you please describe in more detail your vision how it looks like as interface to blackbox(what is input values, what it make inside, what it returns, and how it used by outer applications). Because it is not clear what value is of just line on bottom. How it will simplify anything?

IMO keyboard module should take care completely about string. I need to just give input string to it, say how it should looks on the screen and then get resulted string. More isolation+more functionality inside - more simple to use.
But at same time it should be open enough to be universal.

EditBox - is module which close use underlaying keyboard module and encapsulate all required to simple tasks functionality. I just say - "hey, enter string please" and should care about nothing. Just get result, and make action.

Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #13 on: 17 / December / 2011, 01:53:45 »
I see.. Looks like you are talking about such interface:
 ch = getchar(xoffs,yoffs, xoffs_line,w_line);
 ch = getchar_from_table();

This allow to use this in EDI, but this have several difficulties:
a) on first pressing string after cursor should be shifted right to add new symbol. And keyboard know nothing about this.  if you call on first keyboard pressing [ getchar(first_key_code) ], then we have another difficulty - keyboard line should be displayed before this call. And script know nothing about this line.
Solution - use highlighting (for example inversed) of entered char
b) it is very comfortable that I no need to "finsh" entering symbol and just start to enter next one. In case of "isolated" entering each char I finish entering symbol by pressing different key but I couldn't use this pressing as start next char enter sequence
No nice solution for that. Return specific code of last pressed key and use it argument for next call is ugly as for me.
« Last Edit: 17 / December / 2011, 02:43:31 by tsvstar »


Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #14 on: 17 / December / 2011, 03:25:04 »
Well... That what you said is really convincing... Now I realize that there is no reason to complicate things. If I understand your idea:

--function that need string (e.g. file rename) do this:
string_i_need=keyboard()

and then keyboard do all the things - appears, shows text field, collects all your typed string and returns this string to parent function?

This looks clear and much easier to implement that mine. I had some idea to share special variable like KEYBOARD_STATE between text_field() and keyboard() to comuniate them. And these functions had to work in a loop. But this looks more complicated and could be more bugs-friendly...

Conclusion - now I vote rather for independent, complex keyboard, that care all the things and just return a string;)

Of course this would be not usable by Edi, but that's not really a problem - Edi already has its own interface;)
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #15 on: 17 / December / 2011, 08:00:30 »
I think the best solution is to combine the two options (only keyboard, editbox).
So "rename file" can use a editbox and a texteditor can use a keyboard, that is on the bottom of the screen.
If the ELF-Edition is stable/include in the main trunk then it is also no memory problem with more options for the keyboard.

Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #16 on: 17 / December / 2011, 09:08:57 »
Quote
If the ELF-Edition is stable/include in the main trunk then...

But nobody knows, when it'll be true;) Lets focus on the all-in-one keyboard... These days I have no enough time but I hope next week I'll try to compile your keyboard and take a look in it. Maybe I'll do some progress to. However if you have any ideas to code, please, try!
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #17 on: 18 / December / 2011, 03:10:06 »
outslider,
Yes. That exactly is that I mean. With only one addition that slightly more input arguments required. Caption, text, default text value.

TobiMarg,
Based on this http://chdk.setepontos.com/index.php?topic=2905.msg77946;topicseen#new discussion, current functionality level planed to be frozen and only new camera and bugfixes added. All new functionality such as flat modules (and I think this futher keyboard) will come into next version.

But anyway I do agree with outslider. Raw keyboard have limited usage (for now only EDI I think and it works without any binary module now :) ), while mbox with editable textfield could be used almost everywhere right now.


Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #18 on: 25 / December / 2011, 15:31:08 »
Hey, hey, anybody remember this thread?

@TobiMarg
I compiled your code. I included this in Lua commands in my CHDK. But I have a problem - did you provide any 'main loop' or something? You gave only functions like 'gui_keyboard_draw' or 'gui_keyboard_right' but there's no function that can get keypersses. Am I missing something? Or I just have to provide my own loop with keypresses?

I also missed this:
Quote
If I select a character in EDI it will be typed multiple times, but now I have noticed that it is only sporadic. I think it's a bug!?

Could you please specify when it happens? Probably it's a bug...
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: CHDK - typing / virtual keyboard / editor-style typing
« Reply #19 on: 02 / January / 2012, 12:19:18 »
Hi

@outslider
There is the function gui_keyboard_ok, he returns the selected character.
I have found the problem with EDI: I can press the buttons of the jogdial strong and slightly. If i press it slightly the last typed character will be repeated, even if it another button.

--- --- ---

I have finished a first version of the text box (attached)! :)
To show it use the function gui_tbox_init. It needs that arguments: int title, int msg, unsigned int maxsize, void (*on_select)(unsigned int btn, char* newstr)
  • title = text box title
  • msg = text box message
  • maxsize = maximum size of the new text
  • on_select = function, will be called wen finished input

How to use it:
  • To input a character press left, up, right, down.
  • Press ok or insert another character to accept the character.
  • To delete a character zoom out.
  • To insert a space zoom in.
  • To change input modes (chars, numbers, ...) press shutter half.
  • Press disp to switch to the "textbox" (right/left change cursor position).
  • Press disp again to switch to the buttons.
Remove character doesn't works properly. Also has it a few other errors.  :( They will be fixed as soon as possible.
I'm going to add a rename option to the filebrowser and make then a patch file.

Please test it and write errors, wishes, critique and ideas!
« Last Edit: 02 / January / 2012, 12:26:12 by TobiMarg »

 

Related Topics