Repository navigation
Is there a way to code a text in bash and send to target computer using the OTG keyboard #826
Answered
by
mtlynch
wilsonnkwan
asked this question in
Q&A
|
Hi, I am writing to check with you if we can manually code some text like "Hello World" using bash and use cron to activate that script and send the input into the OTG USB Keyboard to target computer. This is particularly helpful when I want to type something repetitive but I don't want to store it in the target computer. Hope you can help. Thanks :) |
Answered by
mtlynch
Nov 24, 2021
Replies: 1 comment 2 replies
|
It's possible, though we don't have great tooling around it in the community version. From bash, you can run commands like the following to type "Hi" on the target system's keyboard: # H (Right shift + h)
echo -ne "\x20\0\xb\0\0\0\0\0" > /dev/hidg0
# i
echo -ne "\0\0\xc\0\0\0\0\0" > /dev/hidg0
# Release all keys
echo -ne "\0\0\0\0\0\0\0\0" > /dev/hidg0For more details, see: https://mtlynch.io/key-mime-pi/#usb-device-emulation If you're interested in an Enterprise license, it includes a REST API for sending keystrokes programmatically. |
2 replies
Answer selected by
mtlynch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's possible, though we don't have great tooling around it in the community version.
From bash, you can run commands like the following to type "Hi" on the target system's keyboard:
For more details, see: https://mtlynch.io/key-mime-pi/#usb-device-emulation
If you're interested in an Enterprise license, it includes a REST API for sending keystrokes programmatically.