-
-
Save jmingov/baa62db53ca26ad20241 to your computer and use it in GitHub Desktop.
NH - Read text file > output to hid
This file contains hidden or 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
#!/bin/bash | |
INPUT=$1 | |
HIDKEY="/system/xbin/hid-keyboard" | |
while IFS= read -r -N 1 char; do | |
if [ "$char" == $'\n' ] || [ "$char" == $'\r' ]; then | |
# For each new line = return key | |
echo enter | $HIDKEY /dev/hidg0 keyboard | |
else | |
echo "$char" | $HIDKEY /dev/hidg0 keyboard | |
fi | |
done < "$INPUT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment