ShortcutGadget()
Syntax
Result = ShortcutGadget(#Gadget, x, y, Width, Height, Shortcut)Description
Creates a gadget for keyboard shortcut selection in the current GadgetList. The user can select it and hold down a keyboard combination to select a new shortcut. If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. #Gadget will be the number returned by EventGadget() function when the user changes the shortcut.
'Shortcut' specifies the initial shortcut to display. The possible values are the same as in the AddKeyboardShortcut() function. A value of 0 can be used to indicate that no shortcut is currently set. You can add a 'mini help' to this gadget by using GadgetToolTip().
The following functions can be used to act on a ShortcutGadget:
- GetGadgetState(): Get the currently selected keyboard shortcut.
- SetGadgetState(): Change the currently selected keyboard shortcut.Example:
If OpenWindow(0, 0, 0, 240, 70, "ShortcutGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) ShortcutGadget(0, 20, 20, 200, 25, #PB_Shortcut_Control|#PB_Shortcut_A) Repeat Event = WaitWindowEvent() Until Event = #PB_Event_CloseWindow EndIf
Supported OS
All