mirror of
https://github.com/greenshot/greenshot
synced 2025-07-30 11:40:40 -07:00
Moving back to trunk!
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1602 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
ad265b2c54
commit
8d458998a1
332 changed files with 17647 additions and 9466 deletions
|
@ -402,23 +402,29 @@ namespace GreenshotPlugin.Controls {
|
|||
|
||||
public static Keys HotkeyModifiersFromString(string modifiersString) {
|
||||
Keys modifiers = Keys.None;
|
||||
if (modifiersString.ToLower().Contains("alt")) {
|
||||
modifiers |= Keys.Alt;
|
||||
}
|
||||
if (modifiersString.ToLower().Contains("ctrl")) {
|
||||
modifiers |= Keys.Control;
|
||||
}
|
||||
if (modifiersString.ToLower().Contains("shift")) {
|
||||
modifiers |= Keys.Shift;
|
||||
if (!string.IsNullOrEmpty(modifiersString)) {
|
||||
if (modifiersString.ToLower().Contains("alt")) {
|
||||
modifiers |= Keys.Alt;
|
||||
}
|
||||
if (modifiersString.ToLower().Contains("ctrl")) {
|
||||
modifiers |= Keys.Control;
|
||||
}
|
||||
if (modifiersString.ToLower().Contains("shift")) {
|
||||
modifiers |= Keys.Shift;
|
||||
}
|
||||
}
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public static Keys HotkeyFromString(string hotkey) {
|
||||
if (hotkey.LastIndexOf('+') > 0) {
|
||||
hotkey = hotkey.Remove(0,hotkey.LastIndexOf('+')+1).Trim();
|
||||
Keys key = Keys.None;
|
||||
if (!string.IsNullOrEmpty(hotkey)) {
|
||||
if (hotkey.LastIndexOf('+') > 0) {
|
||||
hotkey = hotkey.Remove(0,hotkey.LastIndexOf('+')+1).Trim();
|
||||
}
|
||||
key = (Keys)Keys.Parse(typeof(Keys), hotkey);
|
||||
}
|
||||
return (Keys)Keys.Parse(typeof(Keys), hotkey);
|
||||
return key;
|
||||
}
|
||||
|
||||
public static void RegisterHotkeyHWND(IntPtr hWnd) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue