ghosttyTerminalMatchesHalfPageScrollShortcut function

bool ghosttyTerminalMatchesHalfPageScrollShortcut(
  1. LogicalKeyboardKey key, {
  2. required GhosttyTerminalModifierState modifiers,
  3. required bool upward,
})

Whether the current key press should scroll the terminal by half a page.

Implementation

bool ghosttyTerminalMatchesHalfPageScrollShortcut(
  LogicalKeyboardKey key, {
  required GhosttyTerminalModifierState modifiers,
  required bool upward,
}) {
  return modifiers.shiftPressed &&
      !modifiers.controlPressed &&
      !modifiers.metaPressed &&
      !modifiers.altPressed &&
      key == (upward ? LogicalKeyboardKey.pageUp : LogicalKeyboardKey.pageDown);
}