コード例 #1
0
        void OnKeyUp(object Sender, KeyEventArgs Args)
        {
            if (!_keystrokesSettings.Display)
            {
                _records.Clear();

                return;
            }

            var record = new KeyRecord(Args);

            if (record.Display == "Ctrl" || record.Display == "Alt" || record.Display == "Shift")
            {
                if (_records.Last?.Display == record.Display)
                {
                    _records.Last = new RepeatKeyRecord(record);
                }
                else if (_records.Last is RepeatKeyRecord repeat && repeat.Repeated.Display == record.Display)
                {
                    repeat.Increment();
                }
                else
                {
                    _records.Add(record);
                }
            }
コード例 #2
0
        void OnKeyUp(object Sender, KeyEventArgs Args)
        {
            if (!_settings.Display)
            {
                _records.Clear();

                return;
            }

            var record = new KeyRecord(Args, _keymap);

            var display = record.Display;

            if (display == _keymap.Control ||
                display == _keymap.Alt ||
                display == _keymap.Shift)
            {
                if (_records.Last?.Display == display)
                {
                    _records.Last = new RepeatKeyRecord(record);
                }
                else if (_records.Last is RepeatKeyRecord repeat && repeat.Repeated.Display == display)
                {
                    repeat.Increment();
                }
                else if (_modifierSingleDown)
                {
                    _records.Add(record);
                }
            }
コード例 #3
0
        void OnKeyUp(object Sender, KeyEventArgs Args)
        {
            if (Args.KeyCode == Keys.W)
            {
                _keyVector.wPressed = false;
            }
            if (Args.KeyCode == Keys.A)
            {
                _keyVector.aPressed = false;
            }
            if (Args.KeyCode == Keys.S)
            {
                _keyVector.sPressed = false;
            }
            if (Args.KeyCode == Keys.D)
            {
                _keyVector.dPressed = false;
            }
            if (!_keystrokesSettings.Display)
            {
                _records.Clear();

                return;
            }

            var record = new KeyRecord(Args, _keymap);

            var display = record.Display;

            if (display == _keymap.Control ||
                display == _keymap.Alt ||
                display == _keymap.Shift)
            {
                if (_records.Last?.Display == display)
                {
                    _records.Last = new RepeatKeyRecord(record);
                }
                else if (_records.Last is RepeatKeyRecord repeat && repeat.Repeated.Display == display)
                {
                    repeat.Increment();
                }
                else if (_modifierSingleDown)
                {
                    _records.Add(record);
                }
            }