Is there a way to code a text in bash and send to target computer using the OTG keyboard #826
-
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 :) |
Beta Was this translation helpful? Give feedback.
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/hidg0 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. |
Beta Was this translation helpful? Give feedback.
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.