Page 1 of 1
Command key shortcut constant
Posted: Mon Aug 01, 2005 3:04 pm
by Kale
I use this in an app im porting to Mac OS X:
Code: Select all
AddKeyboardShortcut(#WINDOW_ROOT, #PB_Shortcut_Control | #PB_Shortcut_Q, #MENU_QUIT)
How can i use the apple command key for a shortcut?
#PB_Shortcut_MacOSCommand maybe?
Also how did you get those command key charaters to show in the menus of the IDE for MacOS. I cant find a character that looks like that?
Posted: Tue Aug 02, 2005 10:43 am
by Fred
You can use the #PB_Shortcut_Command constant (on Windows/Linux it will be like #PB_Shortcut_Control)
Posted: Tue Aug 02, 2005 1:43 pm
by Kale
#PB_Shortcut_Command is not defined on Windows version. Kind of make cross platform development unfriendly.
Also how did Freak get those command key charaters to show in the menus of the IDE for MacOS. I cant find a character that looks like that?

Posted: Tue Aug 02, 2005 2:54 pm
by Fred
About the windows one, i'm adding it
About the character, you will have to add "CMD" in your menu text field: MenuItem(0,"Test"+Chr(9)+"CMD+O")
Posted: Mon Jun 15, 2009 4:43 pm
by m0
Hi!
This AddKeyboardShortcut is a bit buggy with mac, hm? you have to push the keys way longer than usual, otherwise the program ignores the event.
Did i something wron, or why is it like that?
Code: Select all
window=OpenWindow(0,0,0,700,400,"Chart Plot",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
AddKeyboardShortcut(0,#PB_Shortcut_Command|#PB_Shortcut_Q, 15)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
quit = #True
Case #PB_Event_Menu
If EventMenu() = 15
quit=#True
EndIf
Case #PB_Event_Gadget
EndSelect
Until quit
CloseWindow(0)
End