Page 1 of 1

For Mac newbies like me: Menu stuff

Posted: Fri Nov 08, 2013 8:44 am
by infratec
Hi,

since I have no 'Apple Key' in my VirtualBox on a PC, I can not really test these stuff.
I created the menu and Quit and Preferences was at the right place but...
no keyboard shortcut.

The problem came from my multilanguage stuff.
At menu creation time the explicit shortcut is not neccessary, it simply works. Ok.
But when I set later an other text with SetMenuItemText() the keyboard shortcuts like 'Cmd+Q' are mandatory.

As newbie without Mac knowledge it costs me a lot of time to find this out.

Bernd

P.S.: Maybe that's a feature request, that with #PB_Menu_Preferences and #PB_Menu_Quit as SetMenuItemText()
parameter the keyboard shortcuts are added automatically.

OS X System Preferences

Posted: Mon Nov 11, 2013 3:13 pm
by Violet
You can change how OS X maps modifier keys. You should be abled to map the Control Key (assuming it is simply forwarded by VirtualBox) to the Command Key for OS X. I hope it helps. :)

By the way: OS X provides default keyboart shortcuts for Preferences and Quit (Command + Q) which are also valid in PureBasic applications by default. However, you must implement the event handling for Quit within the Application Menu yourself (ordinary PureBasic event loop polling for menu events).