void game_KeyPress(object sender, OpenTK.KeyPressEventArgs e) { if (game.Active == this && !pickDiff && !Game.pbox.expanded) { if ((int)e.KeyChar == 8) { //backspace if (resetSearch) { resetSearch = false; } try { searchLabel.Text = searchLabel.Text.Remove(searchLabel.Text.Length - 1); } catch { } } else { if (!char.IsControl(e.KeyChar)) { if (resetSearch) { resetSearch = false; } searchLabel.Text += e.KeyChar; } } searchCountdown = 500; } }
private void window_KeyPress(object sender, OpenTK.KeyPressEventArgs e) { // Drop any keypresses if the control, alt, or windows/command key are being held. // This is a workaround for an issue on macOS where OpenTK will fire KeyPress events even // if modifier keys are held. This can be reverted when it is fixed on OpenTK's side. if (RuntimeInfo.OS == RuntimeInfo.Platform.MacOsx) { var state = OpenTK.Input.Keyboard.GetState(); if (state.IsKeyDown(OpenTK.Input.Key.LControl) || state.IsKeyDown(OpenTK.Input.Key.RControl) || state.IsKeyDown(OpenTK.Input.Key.LAlt) || state.IsKeyDown(OpenTK.Input.Key.RAlt) || state.IsKeyDown(OpenTK.Input.Key.LWin) || state.IsKeyDown(OpenTK.Input.Key.RWin)) { return; } // arbitrary choice here, but it caters for any non-printable keys on an A1243 Apple Keyboard if (e.KeyChar > 63000) { return; } } pending += e.KeyChar; }
public void ClientKeyPress(object sender, OpenTK.KeyPressEventArgs e) { var code = e.KeyChar.ToString().ToUpper(); //left or right if (this._forwardDirection == Direction.N || this._forwardDirection == Direction.S) { if (code == Keys.Left.ToString() || code == Keys.D.ToString()) { this._quarriedDirection = Direction.O; } if (code == Keys.Right.ToString() || code == Keys.A.ToString()) { this._quarriedDirection = Direction.W; } } //up or down else { if (code == Keys.Up.ToString() || code == Keys.W.ToString()) { this._quarriedDirection = Direction.N; } if (code == Keys.Down.ToString() || code == Keys.S.ToString()) { this._quarriedDirection = Direction.S; } } }
private void Window_KeyPress(object sender, OpenTK.KeyPressEventArgs e) { if (currently_editing) { //AppendText(e.KeyChar.ToString()); InsertText(cursor_index, e.KeyChar.ToString()); } }
private void TextBox_KeyPress(OpenTK.KeyPressEventArgs e) { if (Text.Length >= MaxLength) { return; } Text = Text.Insert(CaretPosition, e.KeyChar.ToString()); CaretPosition++; }
private void DateBox_KeyPress(OpenTK.KeyPressEventArgs e) { if (Text.Length >= MaxLength || !validChars.Contains(e.KeyChar)) { return; } Text = Text.Insert(CaretPosition, e.KeyChar.ToString()); CaretPosition++; }
private static void Window_KeyPress(object sender, OpenTK.KeyPressEventArgs e) { if (_acceptInput) { if (e.KeyChar != '\t') { _inputStream.WriteByte((byte)e.KeyChar); } } }
protected override void OnKeyPress(TkKeyPressArgs args) { if (TopScreen == null) { return; } char keyChar = (char)args.KeyChar; if (keyChar == '.' || keyChar == ',') { TopScreen.KeyDown(new KeyboardEventArgs(keyChar)); } if (char.IsLetter(keyChar)) { TopScreen.KeyDown(new KeyboardEventArgs(char.ToUpper((char)args.KeyChar), _keyModifier)); } }
private void Parent_KeyPress(object sender, OpenTK.KeyPressEventArgs e) { Parent.CurrentMenu?.PerformKeyPress(e); }
private void window_KeyPress(object sender, OpenTK.KeyPressEventArgs e) { pending += e.KeyChar; }
internal KeyboardPressEventArgs(OpenTK.KeyPressEventArgs e) { KeyChar = e.KeyChar; }
public void Event_KeyPress(object sender, OpenTK.KeyPressEventArgs e) { }
public virtual void KeyPress(OpenTK.KeyPressEventArgs e) { }
private void Game_KeyPress(object sender, OpenTK.KeyPressEventArgs e) { activeInterface.Game_KeyPress(sender, e); }
private void InputBridge_OnKeyPressed(OpenTK.KeyPressEventArgs e) { }