示例#1
0
        public ToggleKey(IKeyboard <TKeyId, TAdditionalKeyEventData> keyboard, TKeyId keyId, bool initialState = false)
        {
            _key = new SimpleKey <TKeyId, TAdditionalKeyEventData>(keyboard, keyId);

            IsToggled = initialState;

            _key.OnKeyPress += OnKeyPress;
        }
        public void SetUp()
        {
            ResetKeyEvent();

            _keyboardMock = KeyboardTestUtils.CreateKeyboardMock();

            _keyId          = 123;
            _additionalData = 234;
            _key            = new SimpleKey <int, int>(_keyboardMock.Object, _keyId);

            _key.OnKeyPress += (sender, keyId) => _keyEvent = keyId;
        }