Skip to content
Snippets Groups Projects
Commit 9a0ccb9b authored by aa5g21's avatar aa5g21
Browse files

Upload New File

parents
No related branches found
No related tags found
No related merge requests found
code.py 0 → 100644
import time
import board
import digitalio
import usb_hid
import keycodes
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
# Create a keyboard object
kbd = Keyboard(usb_hid.devices)
command = "for /l %i in (1,1,100) do @echo %i & @timeout /t 1 >nul"
time.sleep(1)
kbd.press(Keycode.GUI)
kbd.send(Keycode.R)
kbd.release_all()
time.sleep(0.5)
kbd.send(Keycode.C, Keycode.M, Keycode.D)
kbd.send(Keycode.ENTER)
time.sleep(0.5)
for c in command:
if c.isupper() or c in keycodes.upperSymbols:
kbd.send(Keycode.SHIFT, keycodes.keys[c.lower()])
else:
kbd.send(keycodes.keys[c.lower()])
kbd.send(Keycode.ENTER)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment