示例#1
0
        public void UnBind(HotkeyAction action)
        {
            for (int i = 0; i < _hotkeys.Count; i++)
            {
                HotKeyCombination h = _hotkeys[i];

                if (h.KeyAction == action)
                {
                    _hotkeys.RemoveAt(i);

                    break;
                }
            }
        }
示例#2
0
        public bool TryExecuteIfBinded(SDL.SDL_Keycode key, SDL.SDL_Keymod mod, out Action action)
        {
            for (int i = 0; i < _hotkeys.Count; i++)
            {
                HotKeyCombination h = _hotkeys[i];

                if (h.Key == key && h.Mod == mod)
                {
                    if (_actions.TryGetValue(h.KeyAction, out action))
                    {
                        return(true);
                    }

                    break;
                }
            }

            action = null;

            return(false);
        }