private void onKeyUp(object sender, KeyboardEventArgs args) { switch (SkipTrigger) { case SkipCutsceneTrigger.EscapeKeyOnly: if (args.Key != Key.Escape) return; break; case SkipCutsceneTrigger.Custom: return; } BeginSkip(); }
private async Task onKeyDown(object sender, KeyboardEventArgs args) { if (!Enabled) return; _keysDown.Add(args.Key); Direction? direction = getDirection(); if (Mode == KeyboardMovementMode.Pressing) { if (direction == CurrentDirection) return; } else { if (direction == CurrentDirection) { if (direction == null) return; CurrentDirection = null; await _character.StopWalkingAsync(); return; } } CurrentDirection = direction; if (direction == null) return; await _character.WalkAsync(getTarget(direction.Value)); }
private void onKeyDown(object sender, KeyboardEventArgs args) { if (args.Key == Key.ShiftLeft) { _leftShiftOn = true; return; } if (args.Key == Key.ShiftRight) { _rightShiftOn = true; return; } if (!IsFocused) return; TextBoxKeyPressingEventArgs pressingArgs = new TextBoxKeyPressingEventArgs(args.Key); OnPressingKey.Invoke(this, pressingArgs); if (pressingArgs.ShouldCancel) return; processKey(args.Key); }
private void onKeyUp(object sender, KeyboardEventArgs args) { if (args.Key == Key.ShiftLeft) { _leftShiftOn = false; return; } if (args.Key == Key.ShiftRight) { _rightShiftOn = false; return; } }
private async Task onKeyUp(object sender, KeyboardEventArgs args) { if (!Enabled) return; _keysDown.Remove(args.Key); if (Mode == KeyboardMovementMode.Tapping) return; Direction? direction = getDirection(); if (direction == CurrentDirection) return; CurrentDirection = direction; if (direction == null) { await _character.StopWalkingAsync(); return; } await _character.WalkAsync(getTarget(direction.Value)); }