Keyboard macros: Difference between revisions

→‎{{header|PicoLisp}}: Added PureBasic
(→‎{{header|JavaScript}}: Fix assertion regarding returning value from event)
(→‎{{header|PicoLisp}}: Added PureBasic)
Line 179:
Incremented to 2
Current value is 2</pre>
=={{header|PureBasic}}==
PureBasic has support for shortcut/macro creation in any window that supports events. This allows for creation of both single and combinations as shown in the code below.
For full set of combinations on PC, Mac & Linux please see the official manual, [http://www.purebasic.com/documentation/window/addkeyboardshortcut.html here].
<lang PureBasic>#Win = 0
#Demo1 = 0
#Demo2 = 1
 
If OpenWindow(#Win,50,50,200,60,"PureBasic",#PB_Window_SystemMenu)
;
AddKeyboardShortcut(#Win,#PB_Shortcut_F1, #Demo1)
AddKeyboardShortcut(#Win,#PB_Shortcut_F|#PB_Shortcut_Alt, #Demo2)
;
Repeat
WEvent = WaitWindowEvent()
Select WEvent
Case #PB_Event_Menu
Select EventMenu()
Case #Demo1
MessageRequester("Info", "You Pressed F1")
 
Case #Demo2
MessageRequester("Info", "You Pressed Alt-F")
 
EndSelect
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf</lang>
 
=={{header|Python}}==
Anonymous user