Page 1 of 1
Adding key equivalents to IDE - multi-key key equivalents?
Posted: Thu Mar 10, 2011 7:18 pm
by jimwitte
Is it possible to modify the IDE menus at runtime? I wanted a key equivalent for "New Mainstack" so I tried this, which didn't work:
put "New Mainstack/B" into line 1 of the text of menu 1
That brings up a second question: is it possible to have multi-modifier equivalents? I assume not yet as nothing in the IDE has them - and you couldn't do it with the system of specifying modifiers ("<name>/<key>") that's used now. How does Carbon of OSX specify multi-key equivalents - I assume Carbon is what's used for the OSX runtime itself.
Re: Adding key equivalents to IDE - multi-key key equivalents?
Posted: Fri Mar 11, 2011 9:05 am
by shaosean
Enhanced menu accelerators
~~~~~~~~~~~~~~~~~~~~~~~~~~
The syntax for specifying menu accelerators has been improved. The syntax for menu item strings is now:
<label> '/' <accelerator>
Where <accelerator> is one of:
<char> => Cmd+<char>
<keyname> => Cmd+<keyname>
<modifiers> <char> => <modifiers>+<char>
<modifiers> <keyname> => <modifiers>+<keyname>
Here <modifiers> is either:
1) a space separated list of:
'command', 'cmd', 'control', 'ctrl', 'option' or 'opt', 'alt', 'shift'
in this case the keyname/char should be separated from the list by a space
2) a sequence of characters:
^ => Command
@ => Shift
# => Option
% => Control
in this case no space between the sequence and keyname/char is required.
The following named keys are supported:
F1 F2 F3 F4 ... F15
Left Up Right Bottom
Backspace Delete
Tab Space
Return Enter
Home End Escape
PgUp PgDown
Insert (not on Mac OS X)
On Mac OS X, these keys will be replaced with the appropriate system standard glyph.
Note that as Windows and Linux do not have the 'Command' modifier, on those platforms 'Command' is an synonym for 'Control'. To ensure cross-platform uniformity it is important that you use 'Command' in preference to 'Control' since 'Control' on Mac OS X is a less frequently used modifier.
Examples:
Foo/A <=> Foo/^A <=> Foo/Cmd A
Foo Ctrl+A (Linux/Windows)
Foo <cmd>A (Mac OS X)
Foo/^@A <=> Foo/Cmd Shift A
Foo Shift+Ctrl+A (Linux/Windows)
Foo <shf><cmd>A (Mac OS X)
Foo/%A <=> Foo/Ctrl A
Foo Ctrl+A (Linux/Windows)
Foo <ctl>A (Mac OS X)
Foo/^PgUp <=> Foo/Cmd PgUp
Foo Ctrl+PgUp (Linux/Windows)
Foo <ctl><pgu> (Mac OS X)
Where <ctl> is the standard control key glyph, <shf> is the standard shift key glyph, <cmd> is the standard command key glyph and <pgu> is the standard page up key glyph.