keyboard shortcuts - How do you refer to the mac command key in the String version of Java's KeyStroke.getKeystroke? -
the documentation keystroke.getkeystroke(string) (e.g., getkeystroke("control delete")
) not provide example of how access macintosh command key, , can't find reference lists spellings of various words modifiers "control" function accepts. syntax command key?
for reference, here's documentation getkeystroke:
parses string , returns keystroke
. string must have following syntax:
<modifiers>* (<typedid> | <pressedreleasedid>) modifiers := shift | control | ctrl | meta | alt | altgraph typedid := typed <typedkey> typedkey := string of length 1 giving unicode character. pressedreleasedid := (pressed | released) key key := keyevent key code name, i.e. name following "vk_".
if typed, pressed or released not specified, pressed assumed. here examples:
"insert" => getkeystroke(keyevent.vk_insert, 0); "control delete" => getkeystroke(keyevent.vk_delete, inputevent.ctrl_mask); "alt shift x" => getkeystroke(keyevent.vk_x, inputevent.alt_mask | inputevent.shift_mask); "alt shift released x" => getkeystroke(keyevent.vk_x, inputevent.alt_mask | inputevent.shift_mask, true); "typed a" => getkeystroke('a');
i had go source code awtkeystroke getawtkeystroke(string s) see of acceptable modifier terms, , little trial , error, check modifier syntax command key "meta".
Comments
Post a Comment