Now that I can send commands, I am experimenting with this.
I am getting weird errors. Is there a bug, or am I doing something wrong?
I use this script (which also echoes the commands to the tty via tee
):
(base) max@max-framework:~/src/uhk-learn-layout$ cat uhk-cmd.sh
#!/bin/bash
hidraw=`grep 'UHK 60' /sys/class/hidraw/hidraw*/device/uevent | LC_ALL=C sort -rh | head -n 1 | grep -o 'hidraw[0-9][0-9]*'`
echo -e "\x14$*" | tee "/dev/$hidraw"
Now I try to send some longer sequences:
(base) max@max-framework:~/src/uhk-learn-layout$ ./uhk-cmd.sh "set keystrokeDelay 5" ; sleep 1; ./uhk-cmd.sh "tapKeySeq u d space minusAndUnderscore u enter"
set keystrokeDelay 5
tapKeySeq u d space minusAndUnderscore u enter
(base) max@max-framework:~/src/uhk-learn-layout$ ls -l
total 24
-rw-rw-r-- 1 max max 1075 Jun 23 2023 LICENSE
-rw-rw-r-- 1 max max 3483 Dez 23 04:05 README.md
-rwxrwxr-x 1 max max 175 Jun 11 10:01 uhk-cmd.sh
-rwxrwxr-x 1 max max 11021 Jul 6 2023 uhk-learn-layout.py
Which seems to work – the shell executes the intended ls -l
command. Interestingly, I had to set keystrokeDelay
; I never need that when I run tapKeySeq
directly from macros. But I get the UHK to type the commands. (Because of Colemak mapping on the host OS, I have to send u
d
for the ls
command… I know it’s weird…)
However, once this is complete, ERR
flashes on the display. So I start up Agent to find the following error message:
Error at 1/2/1: Unrecognized command: inus
> 2 | inus enter
???
Are there some length restrictions in the commands?
Also, how can I send a sequence of commands, i.e. a whole macro such as:
set something...
tapKey something...
delayUntil...
tapKey something else...
etc.