public ObservableShortcutConfig(string id, string d, AlephKey k, AlephModifierKeys m, AlephShortcutScope s) { _identifier = id; _description = d; _key = k; _modifiers = m; _scope = s; }
public void Register(AlephModifierKeys mod, AlephKey key, string action) { var imod = (uint)mod; var ikey = (uint)KeyInterop.VirtualKeyFromKey((Key)key); UnregisterHotKey(mod, key, action); if (init) { RegisterHotKey(_windowHandle, _nextID, imod, ikey); } _hotkeys.Add(Tuple.Create(imod, ikey, _nextID, action)); _nextID++; }
public void UnregisterHotKey(AlephModifierKeys mod, AlephKey key, string action) { var imod = (uint)mod; var ikey = (uint)KeyInterop.VirtualKeyFromKey((Key)key); for (;;) { var old = _hotkeys.FirstOrDefault(hk => hk.Item1 == imod && hk.Item2 == ikey && hk.Item4 == action); if (old == null) { return; } _hotkeys.Remove(old); if (init) { UnregisterHotKey(_windowHandle, old.Item3); } } }
public ShortcutDefinition(AlephShortcutScope s, AlephModifierKeys m, AlephKey k) { Scope = s; Modifiers = m; Key = k; }