Skip to content

Commit

Permalink
Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
mondalaci committed Jan 16, 2023
2 parents c6af98f + 75ece4c commit c8add7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions doc-dev/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion right/src/macro_shortcut_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c8add7c

Please sign in to comment.