Method keys.more.parseHotkeyString(+ 2 overloads)
Overload
public static bool parseHotkeyString(string s, out KMod mod, out KKey key)
Parameters
Returns
|
bool
|
Remarks
For example, if s is "Ctrl+Left", sets mod = KMod.Ctrl, key = KKey.Left.
Key names are like with keys.send.
Must be single non-modifier key, preceded by zero or more of modifier keys Ctrl, Shift, Alt, Win, all joined with +.
Valid hotkey examples: "A", "a", "7", "F12", ".", "End", "Ctrl+D", "Ctrl+Alt+Shift+Win+Left", " Ctrl + U ".
Invalid hotkey examples: null, "", "A+B", "Ctrl+A+K", "A+Ctrl", "Ctrl+Shift", "Ctrl+", "NoSuchKey", "tab".
Overload(next)
Converts hotkey string like "Ctrl+A" to winforms System.Windows.Forms.Keys.
public static bool parseHotkeyString(string s, out Keys hotkey)
Parameters
Returns
|
bool
|
Remarks
For example, if s is "Ctrl+Left", sets hotkey = Keys.Control | Keys.Left.
Overload(top)
Converts hotkey string like "Ctrl+A" to WPF System.Windows.Input.ModifierKeys and System.Windows.Input.Key or System.Windows.Input.MouseAction.
public static bool parseHotkeyString(string s, out ModifierKeys mod, out Key key, out MouseAction mouse)
Parameters
| s (string) |
|
mod (ModifierKeys)
Enum: value__, None, Alt, Control, Shift, Windows, .ctor. |
| key (Key) |
|
mouse (MouseAction)
Enum: value__, None, LeftClick, RightClick, MiddleClick, WheelClick, LeftDoubleClick, RightDoubleClick, MiddleDoubleClick, .ctor. |
Returns
|
bool
|
Remarks
For example, if s is "Ctrl+Left", sets mod = ModifierKeys.Control and key = Key.Left.
Supported mouse button strings: "Click", "D-click", "R-click", "M-click", "Wheel". Example: "Ctrl+R-click". The first character of a mouse word is case-insensitive.