Page 1 of 1

COMBOBOX and ON KEY

Posted: Mon Oct 10, 2011 4:02 pm
by Ricci
Usally I use the ESC and Ctrl-S keys to do the same as pressing the OK or Cancel-button in my program when the user is changing some data.

Code: Select all

ON KEY ESCAPE    of Form_x action DoSomething( Form_x )
ON KEY CONTROL+S of Form_x action DoSomethingElse( Form_x )
That works in all cases except if a COMBOBOX control has the focus. In this case only ESC ist working, Ctrl-S not.
I found nothing in combobox.prg that can cause this, so it must be deeper (in CONTROL or BASIC class?). Any idea?

Re: COMBOBOX and ON KEY

Posted: Mon Oct 10, 2011 6:47 pm
by mrduck
Ricci wrote: I found nothing in combobox.prg that can cause this, so it must be deeper (in CONTROL or BASIC class?). Any idea?

Combobox intercepts keys and probably it uses ctrl-S for something... can you please try to set another key, like F9, or P... just to see if it a specific ctrl-S problem

Re: COMBOBOX and ON KEY

Posted: Mon Oct 10, 2011 7:43 pm
by Ricci
F9 is working, Ctrl-P not.

I think we can´t do anything in that case, it´s a "future" of QComboBox() that interprets Strg+Key as a normal keystroke that do only a search in the combobox list.

Re: COMBOBOX and ON KEY

Posted: Mon Oct 10, 2011 8:09 pm
by mrduck
Ricci wrote:F9 is working, Ctrl-P not.

I think we can´t do anything in that case, it´s a "future" of QComboBox() that interprets Strg+Key as a normal keystroke that do only a search in the combobox list.
Yes nothing "simple" to implement....