/// <summary> /// Adds a key binding to a command for this screen. Screen key bindings will only concern the current screen. /// They will be evaluated before the global key bindings in the InputManager. /// </summary> /// <param name="key">The key which triggers the command.</param> /// <param name="action">The action which should be executed.</param> public void AddKeyBinding(Key key, KeyActionDlgt action) { if (_keyBindings == null) { _keyBindings = new Dictionary <Key, KeyAction>(); } _keyBindings[key] = new KeyAction(key, action); }
public KeyAction(Key key, KeyActionDlgt action) { _key = key; _action = action; }
public void AddKeyBinding(Key key, KeyActionDlgt action) { lock (_syncObj) _keyBindings[key] = new KeyAction(key, action); }