/// <summary> /// Creates a new instance of the ActionKeyInfo class. /// </summary> /// <param name="actionKey">The key that invokes the action.</param> /// <param name="callback">The callback function that should be called when the action key comes down.</param> /// <param name="modifierKeys">A list of modifier keys that must be pressed to fire callback.</param> /// <param name="once">Fires only once for key down, the key has to be released and pressed again to fire the callback again.</param> public ActionKeyInfo(VirtualKey actionKey, ActionKeyHandler callback, ModifierKey[] modifierKeys = null, bool once = false) { mActionKey = actionKey; mModifierKeys = modifierKeys; mCallBack = callback; mOnce = once; ControlKeysState = new ControlKeysState(); }
/// <summary> /// Adds a ActionKey to the list. /// </summary> /// <param name="key">The key that invokes the action.</param> /// <param name="callback">The callback function that should be called when the action key comes down.</param> /// <param name="modifierKeys">A list of modifier keys that must be pressed to fire callback.</param> /// <param name="once">Fires only once for key down, the key has to be released and pressed again to fire the callback again.</param> public void AddActionKey(VirtualKey key, ActionKeyHandler callback, ModifierKey[] modifierKeys = null, bool once = false) { if (mActionKeys.ContainsKey(key)) { mActionKeys[key].Add(new ActionKeyInfo(key, callback, modifierKeys)); } else { mActionKeys.Add(key, new List <ActionKeyInfo>(new ActionKeyInfo[] { new ActionKeyInfo(key, callback, modifierKeys, once) })); } }
/// <summary> /// Add a ActionKey CallbackFunction binding to the flag ListView. /// </summary> /// <param name="key">The action key that raises the callback.</param> /// <param name="callback">The callback function with the action that should be called.</param> /// <param name="modifierKeys">Required state of the modifier keys to get the callback function called.</param> /// <param name="once">Flag to determine if the callback function should only be called once.</param> public void AddActionKey(VirtualKey key, ActionKeyHandler callback, ModifierKey[] modifierKeys = null, bool once = false) { tvModSelection.AddActionKey(key, callback, modifierKeys, once); }
/// <summary> /// Add a ActionKey CallbackFunction binding to the backup TreeViewAdv. /// </summary> /// <param name="key">The action key that raises the callback.</param> /// <param name="callback">The callback function with the action that should be called.</param> /// <param name="modifierKeys">Required state of the modifier keys to get the callback function called.</param> /// <param name="once">Flag to determine if the callback function should only be called once.</param> public void AddActionKey(VirtualKey key, ActionKeyHandler callback, ModifierKey[] modifierKeys = null, bool once = false) { tvParts.AddActionKey(key, callback, modifierKeys, once); }
/// <summary> /// Adds a ActionKey to the list. /// </summary> /// <param name="key">The key that invokes the action.</param> /// <param name="callback">The callback function that should be called when the action key comes down.</param> /// <param name="modifierKeys">A list of modifier keys that must be pressed to fire callback.</param> /// <param name="once">Fires only once for key down, the key has to be released and pressed again to fire the callback again.</param> public void AddActionKey(VirtualKey key, ActionKeyHandler callback, ModifierKey[] modifierKeys = null, bool once = false) { if (mActionKeys.ContainsKey(key)) mActionKeys[key].Add(new ActionKeyInfo(key, callback, modifierKeys)); else mActionKeys.Add(key, new List<ActionKeyInfo>(new ActionKeyInfo[] { new ActionKeyInfo(key, callback, modifierKeys, once) })); }