Last active
January 31, 2022 10:11
-
-
Save Thesola10/e9c4cbff8c4b9020c474d2de2ba1a4f0 to your computer and use it in GitHub Desktop.
(in)elegant weapons, for a more civilized age.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# key-gnat by Karim Vergnes <me@thesola.io> | |
# License: WTFPL 1.0 | |
# Requires evdev python to be installed | |
from evdev import UInput, ecodes as e | |
import random, time | |
ui = UInput(name="Unsuspicious keyboard™") | |
while True: | |
nxt = random.randint(16, 49) | |
ui.write(e.EV_KEY, nxt, 1) | |
ui.syn() | |
ui.write(e.EV_KEY, nxt, 0) | |
ui.syn() | |
tnxt = random.randint(20, 100) | |
print("Sleeping for %d seconds..." %tnxt) | |
time.sleep(tnxt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a nutshell,
key-gnat
just creates a keyboard which will press one letter at random every 20 to 100 seconds. Just enough to annoy most people.