Hello,
Do yo know how to validate a stringadget with the enter(rc) key ?
Cordially
How validate with the enter key?
Re: How validate with the enter key?
use AddKeyboardShortcut() in combination with GetActiveGadget():
Code: Select all
Enumeration
#Window
#StringGadget
#PB_Shortcut_Return_Event
EndEnumeration
Procedure MenuEvents()
If EventMenu() = #PB_Shortcut_Return_Event
If GetActiveGadget() = #StringGadget
Debug "Gotcha!"
EndIf
EndIf
EndProcedure
OpenWindow(#Window, 0, 0, 320, 260, "Shortcut", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(#StringGadget, 10, 10, 300, 30, "")
AddKeyboardShortcut(0, #PB_Shortcut_Return, #PB_Shortcut_Return_Event)
BindEvent(#PB_Event_Menu, @MenuEvents())
SetActiveGadget(#StringGadget)
Re: How validate with the enter key?
It's work, thank very much.