How to activate the buttons using keyboard shortcuts
Posted: Sun Jul 16, 2023 11:47 am
I'm going to make a simple application where there will be no menu. Is it possible to activate the buttons using keyboard shortcuts. If anyone has an idea - please add the code.
Code: Select all
If OpenWindow(0, 0, 0, 222, 200, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 10, 30, 200, 30, "Button activated with Ctrl+A")
ButtonGadget(1, 10, 100, 200, 30, "Button activated with Ctrl+B")
ButtonGadget(2, 10, 160, 200, 30, "Button activated with Ctrl+C")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case 0
MessageRequester("Keyboard shotcuts", "It is click - not activated with Ctrl+A")
Case 1
MessageRequester("Keyboard shotcuts", "It is click - not activated with Ctrl+B")
Case 2
MessageRequester("Keyboard shotcuts", "It is click - not activated with Ctrl+B")
EndSelect
EndSelect
ForEver
EndIf