Skip to content

Instantly share code, notes, and snippets.

@dglaude
Created September 27, 2022 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dglaude/022905f7e16496b8a8bf3f3a1ea9882c to your computer and use it in GitHub Desktop.
Save dglaude/022905f7e16496b8a8bf3f3a1ea9882c to your computer and use it in GitHub Desktop.
PASsive aggRESiVE writING with CirCUITPYthon (i diD IT oN A QT pY M0)
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import time
import random
# Initialize Keyboard
kbd = Keyboard(usb_hid.devices)
# Press and release CapsLock in loop.
while True:
kbd.send(Keycode.CAPS_LOCK)
time.sleep(random.random())
@rcarteraz
Copy link

Ha! I was able to get this to work. So cool. Thanks!

@rcarteraz
Copy link

Ha! I was able to get this to work. So cool. Thanks!

I'm wondering now, if rather than a time.sleep(random) if it's possible to simply alternate after each keystroke? "eXaMplE" each time I press a key it automatically sends the capslock keycode.... Although, now that I think about it, I worry it wouldn't keep up anyways due to the speed of which one types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment