---
name: "windows"
description: >-
  Windows keyboard shortcuts.
initiallyActive: true
exclusive: false
commands:
  # Initiate window selection

  - name: "list windows" # hold alt, press tab
    description: >-
      Lists open windows for selection.
      Activates the "window selection" exclusive mode.
    alternates:
      - "with windows"
      - "coolest windows"
      - "oldest windows"
      - "mr windows"
      - "this windows"
      - "list window"
      - "b-list windows"
      - "west windows"
    functions:
      - name: "toggleMode"
        fixedArguments:
          - "on"
          - "window selection"
      - name: "keyHold"
        fixedArguments:
          - "alt"
      - name: "keyPress"
        fixedArguments:
          - "tab"

  # Window management

  - name: "other window" # hold alt, press tab, release alt
    description: >-
      Activates the previously active window.
    alternates:
      - "although window"
      - "of her window"
      - "oh their window"
      - "oh the window"
      - "have a window"
      - "over window"
      - "while the window"
      - "or the window"
      - "oh they're a window"
    functions:
      - name: "keyHold"
        fixedArguments:
          - "alt"
      - name: "keyPress"
        fixedArguments:
          - "tab"
      # without this sleep on windows 11, the window switch doesn't complete sometimes
      - name: "sleep"
        fixedArguments:
          - "200"
      - name: "keyRelease"
        fixedArguments:
          - "alt"
  - name: "maximize window"
    description: >-
      Maximizes the currently active window.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "up"
  - name: "minimize window"
    description: >-
      If a window is maximized, this restores it to unmaximized state.
      If a window is open unmaximized, this minimizes it.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "down"
  - name: "snap window left"
    description: >-
      Positions and sizes the window to the left side of the screen.
      A minor Windows bug prevents this window from sizing
      precisely under the Utterly Voice user interface.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "left"
  - name: "snap window right"
    description: >-
      Positions and sizes the window to the right side of the screen.
      A minor Windows bug prevents this window from sizing
      precisely under the Utterly Voice user interface.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "right"
  - name: "close window"
    description: >-
      This command closes the current window.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "alt"
          - "f4"
  - name: "show desktop"
    description: >-
      Show the Windows desktop.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "d"

  # Taskbar

  - name: "go to taskbar"
    description: >-
      Moves focus to the first item in the taskbar.
      You can then select a taskbar item
      by using the "go left" and "go right" commands.
      Use the "enter" command to execute the selected item.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "t"
  - name: "leave taskbar"
    description: >-
      Removes focus from the taskbar.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "escape"

  # Computer management

  - name: "computer sleep"
    description: >-
      Turns the microphone off, then puts the computer to sleep.
    alternates:
      - "computer asleep"
    functions:
      - name: "updateMicrophone"
        fixedArguments:
          - "off"
      - name: "keyPress"
        fixedArguments:
          - "escape"
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "x"
      - name: "sleep"
        fixedArguments:
          - "1000"
      - name: "keyPress"
        fixedArguments:
          - "u"
      - name: "sleep"
        fixedArguments:
          - "1000"
      - name: "keyPress"
        fixedArguments:
          - "s"
  - name: "computer sign out"
    description: >-
      Turns the microphone off, then signs out of the current account.
    functions:
      - name: "updateMicrophone"
        fixedArguments:
          - "off"
      - name: "keyPress"
        fixedArguments:
          - "escape"
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "x"
      - name: "sleep"
        fixedArguments:
          - "1000"
      - name: "keyPress"
        fixedArguments:
          - "u"
      - name: "sleep"
        fixedArguments:
          - "1000"
      - name: "keyPress"
        fixedArguments:
          - "i"

  # text navigation

  - name: "go left word"
    description: >-
      Moves the cursor one or more words to the left.
      The optional utterance argument is the number of times the key should be pressed.
      If the argument is not provided,
      the key is pressed once.
    alternates:
      - "go leftward"
      - "go left towards"
      - "go left toward"
      - "go leftwards"
    functions:
      - name: "keyRepeat"
        fixedArguments:
          - "control"
          - "left"
        utteranceArguments: 1
  - name: "go right word"
    description: >-
      Moves the cursor one or more words to the right.
      The optional utterance argument is the number of times the key should be pressed.
      If the argument is not provided,
      the key is pressed once.
    alternates:
      - "go rightward"
      - "go right forward"
      - "go right toward"
      - "go right towards"
    functions:
      - name: "keyRepeat"
        fixedArguments:
          - "control"
          - "right"
        utteranceArguments: 1
  - name: "select left word"
    description: >-
      Selects the word to the left of the cursor.
      The optional utterance argument is the number of times the key should be pressed.
      If the argument is not provided,
      the key is pressed once.
    alternates:
      - "select leftward"
      - "select a left word"
    functions:
      - name: "keyHold"
        fixedArguments:
          - "shift"
      - name: "keyRepeat"
        fixedArguments:
          - "control"
          - "left"
        utteranceArguments: 1
      - name: "keyRelease"
        fixedArguments:
          - "shift"
  - name: "select right word"
    description: >-
      Selects the word to the right of the cursor.
      The optional utterance argument is the number of times the key should be pressed.
      If the argument is not provided,
      the key is pressed once.
    alternates:
      - "select rightward"
    functions:
      - name: "keyHold"
        fixedArguments:
          - "shift"
      - name: "keyRepeat"
        fixedArguments:
          - "control"
          - "right"
        utteranceArguments: 1
      - name: "keyRelease"
        fixedArguments:
          - "shift"
  - name: "clear left word"
    description: >-
      Deletes one or more words to the left of the cursor.
      The optional utterance argument is the number of times the key should be pressed.
      If the argument is not provided,
      the key is pressed once.
    alternates:
      - "clear leftward"
      - "queer leftward"
      - "queer left"
      - "clearly leftward"
      - "clear left toward"
    functions:
      - name: "keyRepeat"
        fixedArguments:
          - "control"
          - "backspace"
        utteranceArguments: 1
  - name: "clear right word"
    description: >-
      Deletes one or more words to the right of the cursor.
      The optional utterance argument is the number of times the key should be pressed.
      If the argument is not provided,
      the key is pressed once.
    alternates:
      - "clear rightward"
      - "clear right toward"
      - "clearly the right word"
    functions:
      - name: "keyRepeat"
        fixedArguments:
          - "control"
          - "delete"
        utteranceArguments: 1
  - name: "clear line"
    description: >-
      Deletes the current line of text.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "home"
      - name: "keyHold"
        fixedArguments:
          - "shift"
      - name: "keyPress"
        fixedArguments:
          - "end"
      - name: "keyRelease"
        fixedArguments:
          - "shift"
      - name: "keyRepeat"
        fixedArguments:
          - "backspace"
          - "2"
  - name: "copy that"
    description: >-
      Types control-c to copy content to clipboard.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "c"
  - name: "cut that"
    description: >-
      Types control-x to cut content to the clipboard.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "x"
  - name: "paste that"
    description: >-
      Types control-shift-v to paste unformatted selected content.
    alternates:
      - "peace that"
      - "paste pet"
      - "piece that"
      - "peace to that"
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "shift"
          - "v"
  - name: "paste that formatted"
    description: >-
      Types control-v to paste formatted selected content.
    alternates:
      - "peace that formatted"
      - "piece that formatted"
      - "peace to that formatted"
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "v"
  - name: "scratch that"
    description: >-
      Types control-z to undo an edit.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "z"
  - name: "redo that"
    description: >-
      Types control-y to redo an edit.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "y"
  - name: "select all"
    description: >-
      Types control-a to select all.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "a"

  # Bank copy and paste

  - name: "bank copy"
    description: >-
      Use this command to copy selected content to a bank name of your choosing.
      The single utterance argument is the name of the bank.
      This is useful when you are copying and pasting multiple things.
      For example, if you say "bank copy apple", the selected content
      is saved to the bank name "apple".
      Later, you can say "bank paste apple" to paste that content.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "c"
      - name: "bankCopy"
        utteranceArguments: 1
  - name: "bank paste"
    description: >-
      Use this command to paste a bank you previously copied.
      The single utterance argument is the name of the bank.
    functions:
      - name: "bankPaste"
        utteranceArguments: 1

  # Windows Explorer

  - name: "open explorer"
    description: >-
      Opens Windows Explorer.
      Say "explorer address bar" to jump to the address bar,
      then use "tab" and "tab back" to jump between panels.
      To open a folder, select it and say "enter".
      To select and unselect items in the folder panel,
      use "hold control" to initiate selections,
      "go up" and "go down" to move cursor,
      "space" to toggle selection,
      and "release control" to finish selections.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "cmd"
          - "e"
  - name: "explorer address bar"
    description: >-
      Go to the explorer address bar.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "alt"
          - "d"
  - name: "explorer go up"
    description: >-
      Go up a folder.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "alt"
          - "up"
  - name: "explorer go back"
    description: >-
      Go back a folder.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "alt"
          - "left"
  - name: "explorer go forward"
    description: >-
      Go forward a folder.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "alt"
          - "right"
  - name: "explorer new folder"
    description: >-
      Creates a new folder.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "shift"
          - "n"
  - name: "explorer delete file"
    description: >-
      Deletes the currently selected file.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "control"
          - "d"
  - name: "explorer rename file"
    description: >-
      Renames the currently selected file.
    functions:
      - name: "keyPress"
        fixedArguments:
          - "f2"
