[Gambas-user] Any way of excluding a control from the tab order?

Benoit Minisini gambas at ...1...
Tue Mar 25 14:10:31 CET 2008


On mardi 25 mars 2008, Richard wrote:
> On Tuesday 25 Mar 2008 08:51, charlesg wrote:
> > Wow! Somebody who thinks like me about data entry.
> >
> > I can’t answer the question but I am good at tangents! I have always used
> > the <return> key (in VB and now GB) to control flow. That <tab> key is a
> > useless key in a useless position and you have to have three hands to
> > make decent use of a mouse under data entry conditions.
> >
> > PUBLIC SUB txtName_keyRelease()
> > IF key.Code = key.Return OR key.Code = 65421 THEN
> >     	      txtDate.SetFocus
> >     	ENDIF
> >
> > I should be able to use key.Enter for the numeric pad Enter key but last
> > time I tried under GTK it did not work.
>
> As Benoit said above you can easily use the wrong constant for checking the
> enter key. The Key.ENTER constant appears on the help page well before
> Key.RETURN. It took me over a year to realise that Key.RETURN exists, but
> that is exactly what my keyboards provide when I press ENTER.
>
> Now I always check for Key.ENTER a n d Key.RETURN
>
> SELECT keycode
> 	CASE Key.ENTER, Key.RETURN
> 		'Enter was pressed
> 	....
> END SELECT
>

You do the right way.

Keyboard makers like to play with the name they write on the key.

On X-Window, the RETURN key is the big key usually just on top of the right 
SHIFT key, whereas the ENTER key is the key that should have the same 
behaviour that is in the numeric pad.

I fixed the Key.Enter constant value in gb.gtk this morning, so people can now 
use the constant (and not the absolute values).

Regards,

-- 
Benoit Minisini




More information about the User mailing list