I've created another small code snippet for testing. It contains two button gadgets in addition to the editor gadget:
Code:
#WinWidth = 400
#WinHeight = 300
#BtnY = #WinHeight-50
Define.i edit, ok, cancel, event
If OpenWindow(0, 100, 100, #WinWidth, #WinHeight, "Editor Gadget Test") = 0
MessageRequester("Fatal error",
~"Can't open main window.\nProgram terminated.")
End
EndIf
edit = EditorGadget(#PB_Any, 10, 10, #WinWidth-20, #WinHeight-80)
ok = ButtonGadget(#PB_Any, 220, #BtnY, 60, 30, "OK")
cancel = ButtonGadget(#PB_Any, 310, #BtnY, 80, 30, "Cancel")
SetActiveGadget(ok)
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
I did all tests on Windows 10.
Initially, the keyboard focus is on the OK button (although not visible here). After pressing the TAB key twice, the focus is in the editor gadget.
When I then press the TAB key again, different things happen, depending on the used PB version:
- With PB 5.72 LTS, tab characters are inserted in the editor gadget. It's not possible to set the focus to another gadget by pressing the TAB key.
You can find code here on the forum, that works around this issue, e.g. by using PB's AddKeyboardShortcut() or a Windows callback. - With PB 5.73 beta 3, the focus changes to the OK button. In other words, we now can always use the TAB key for setting the focus to another gadget, regardless on which gadget the focus currently is. (This is at least true for this small example -- I didn't test all PureBasic gadgets.) As you wrote, tab characters can still be inserted in the editor gadget by pressing [Ctrl]+[Tab].
Personally, I prefer the new behaviour, and I can imagine that the change might have been done
deliberately (for the reason I mentioned).