ENTER/RETURN as TAB?

BlitzMax Forums/MaxGUI Module/ENTER/RETURN as TAB?

SLotman(Posted 2013) [#1]
Is it possible to do it? Check textfields and when the user press [ENTER] or [RETURN] it behaves as [TAB] and go to the next field in the form?

I've used to do it in VB all the time, have even tried to modify MaxGUI myself (I succeed to some degree, but when I pressed ENTER it would behave as if I pressed TAB 2 or 3 times in a row) without much success.

(I know this can be done in textareas, but I need it for textfields and possible comboboxes)


Henri(Posted 2013) [#2]
Hello,

your problem comes from enter-key behaviour that was introduced in MaxGUI 1.42. There is a keyboard callback-function ( KeyboardProc() ) in main window which catches enter-key once when you press it, and second time when you release it, so one press causes two events that take the keyboard focus away from field.

If you don't have to worry about changing MaxGUI, then you could alter this function in win32maxguiex.bmx-file to perhaps emit a customevent everytime enter_key is pressed and catch this event in mainloop. Also you may have to comment out the GetFocus/SetFocus-part.

-Henri


SLotman(Posted 2013) [#3]
Thanks! I hacked my way in, and I think I got it working :)


jsp(Posted 2013) [#4]
Years ago we had a discussion when it first was changed and a lot of user did not like the new behavior. The double focus lost event on top on the textfield is very bad in my eyes as you can't just activate the next gadget in order on GadgetLostFocus.
http://www.blitzmax.com/Community/posts.php?topic=72737#1

Here is the KeyboardProc() explained.
http://www.blitzmax.com/Community/posts.php?topic=93766#1073661
Unfortunately the features skid talked about got never realized.