Skip to content

Add support for multi-key button pres bindings#127

Merged
jtsiomb merged 2 commits intoFreeSpacenav:masterfrom
035059:master
Nov 21, 2025
Merged

Add support for multi-key button pres bindings#127
jtsiomb merged 2 commits intoFreeSpacenav:masterfrom
035059:master

Conversation

@035059
Copy link
Copy Markdown
Contributor

@035059 035059 commented Nov 20, 2025

Hi there,

This is my first time contributing to an open-source project, so apologies if there is some etiquette I'm not familiar with.

I wanted to be able to bind buttons to key combinations (eg. Shift+1) to get support for the view controls in Onshape without modifying the keybinds.

This extends the button-press handing to allow for the use of up to 8 keys being bound to a single button, without breaking existing configs. I also added some logic to the config parsing, to give feedback to the user if their config is malformed.

Example /etc/spnavrc line:
kbmap30 = Shift_L+7

The config I set up for Onshape is working properly, but I haven't done extensive testing for edge-cases.

@jtsiomb
Copy link
Copy Markdown
Contributor

jtsiomb commented Nov 21, 2025

Thank you, this looks great!

The only problem is that the protocol requests (SCFG_KBMAP/GCFG_KBMAP) don't support multiple keys. I added a TODO comment to see if I can find a way to add that capability in a backwards-compatible way (otherwise we'll have to introduce new requests).

The only thing I'd do different would be to terminate the key sequence with a 0, instead of having a separate count array. But it's not important enough to change it, so I left that part unchanged.

@jtsiomb jtsiomb merged commit 361aaf2 into FreeSpacenav:master Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants