diff --git a/doc-dev/user-guide.md b/doc-dev/user-guide.md index f6ddd1239..8b0d3422e 100644 --- a/doc-dev/user-guide.md +++ b/doc-dev/user-guide.md @@ -495,6 +495,23 @@ setReg 22 1 ifGesture 89 final fork rotateHues ``` +### Executing commands over USB + +One way is to use the npm script that is packed with agent source code: + +1. Build the agent. +2. Navigate to `agent/packages/usb` +3. Execute `./exec-macro-command.ts "write hello world!"` + +Or, in linux, you can put following script into your path... and then use it as `uhkcmd "write hello world!"`: + +``` +#!/bin/bash +hidraw=`grep 'UHK 60' /sys/class/hidraw/hidraw*/device/uevent | LC_ALL=C sort -h | head -n 1 | grep -o 'hidraw[0-9][0-9]*'` +echo -e "\x14$*" > "/dev/$hidraw" +``` + + # Further reading - [reference manual](reference-manual.md) diff --git a/right/src/macro_shortcut_parser.c b/right/src/macro_shortcut_parser.c index 7536a9c44..91513af0e 100644 --- a/right/src/macro_shortcut_parser.c +++ b/right/src/macro_shortcut_parser.c @@ -594,7 +594,7 @@ bool MacroShortcutParser_Parse(const char* str, const char* strEnd, macro_sub_ac bool success = false; - if (FindChar('-', str, strEnd) == strEnd) { + if (FindChar('-', str, strEnd) == strEnd || str+1 == strEnd) { //"-" notation not used success = success || parseAbbrev(str, strEnd, outMacroAction, outKeyAction); success = success || parseMods(str, strEnd, outMacroAction, outKeyAction);