Advertisement
smeech

Delays in replacements, generic

Aug 23rd, 2024 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.34 KB | None | 0 0
  1. # Espanso trigger to be used in conjunction with the script test_pynput.py
  2. # Uses the Python pynput library to inject text, instead of Espanso. Enables the
  3. # addition of pauses (sleep) and <Tab> etc. keys and can include Espanso {{variables}}
  4. # See https://pynput.readthedocs.io/en/latest/keyboard.html#controlling-the-keyboard
  5. # Supports type, tap, press, release, and sleep
  6. # Whilst you can add to the replace:, anything there will be injected AFTER the script's
  7. # output
  8.  
  9.   - trigger: :delay
  10.     replace: '{{output}}'
  11.     vars:
  12.       - name: trig
  13.         type: echo
  14.         params:
  15.           echo: :delay # This must match the trigger text
  16.       - name: input
  17.         type: echo
  18.         params:
  19.           echo: |      # Amend the contents below to suit, adding variables etc.
  20.             type Hello, World!
  21.             tap enter
  22.             type Pausing for one second
  23.             tap enter
  24.             sleep 1    
  25.             type How are you?
  26.             tap space
  27.             press shift
  28.             type I am a bot
  29.             release shift
  30.             tap enter
  31.             type The trigger was {{trig}}
  32.             tap enter
  33.       - name: output
  34.         type: script
  35.         params:
  36.           args:
  37.            - python
  38.             - '%CONFIG%/scripts/test_pynput.py'
  39.             - '{{trig}}'
  40.             - '{{input}}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement