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); } }
public bool this[Key key] { get { return _pressedKeys.Contains(key); } set { if (value) { _pressedKeys.Add(key); } else { _pressedKeys.Remove(key); } } }
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; }
protected override bool OnKeyDown(Key key) { if (key == Key.Escape) { IsVisible = !IsVisible; return true; } return false; }