예제 #1
0
 private void OnKeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
 {
     if (e.Key == OpenTK.Input.Key.F10)
     {
         _gameLoop.Quit();
     }
     else
     {
         var key = new Ui.Framework.Input.Key(e.Key.ToString());
         _uiKeyboardState[key] = true;
         _gameControl.HandleKeyDown(key);
     }
 }
예제 #2
0
        public bool this[Key key]
        {
            get
            {
                return _pressedKeys.Contains(key);
            }

            set
            {
                if (value)
                {
                    _pressedKeys.Add(key);
                }
                else
                {
                    _pressedKeys.Remove(key);
                }
            }
        }
예제 #3
0
        protected override bool OnKeyDown(Key key)
        {
            if (key == Key.BackSpace)
            {
                if (_address.Length > 0) _address = _address.Substring(0, _address.Length - 1);
                return true;
            }

            if (key == Key.Enter)
            {
                if (!string.IsNullOrWhiteSpace(_address))
                {
                    var notAwaited = _connectionManager.ConnectAsync(_address);
                }

                return true;
            }

            return false;
        }
예제 #4
0
        protected override bool OnKeyDown(Key key)
        {
            if (key == Key.Escape)
            {
                IsVisible = !IsVisible;
                return true;
            }

            return false;
        }
예제 #5
0
 private void OnKeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
 {
     if (e.Key == OpenTK.Input.Key.F10)
     {
         _gameLoop.Quit();
     }
     else
     {
         var key = new Ui.Framework.Input.Key(e.Key.ToString());
         _uiKeyboardState[key] = true;
         _gameControl.HandleKeyDown(key);
     }
 }