Customisations for a trackball.
Firstly (as suggested when I started to type this) I looked at https://forum.remapper.org/t/h-scroll-activating-sticky-layer-problem/301/2 and could make no sense of it.
GPIO 19 is used to indicate whether a particular program (FreeCAD) has input focus.
This is used to customise some of the buttons specifically for FreeCAD and a couple of them for any application.
The problem here is that “Button 6 - Layer 2” assignment, ONLY works when FreeCAD doesn’t have input focus, i.e. Layer 1 is not active.
Activating the cursor slowdown (the last two entries) when FreeCAD does not have focus, does as expected and allows movement of the cursor with greater precision.
If I then give FreeCAD input focus, that precision remains until I click Button 6. That switches it off, but will not switch it on again.
I have no idea how to make this work properly.
Any clues?
hid-remapper-config (12).json (4.0 KB)
Update on my question.
I’ve changed the mappings slightly, but it has made no difference.
0xfff40013 is GPIO19
0x00090006 is BUTTON6
When GPIO19 is high (1) pressing and holding BUTTON6 has the desired effect of slowing down the mouse cursor.
When GPIO19 is low (1) button 6 has no effect.
This is exactly the same outcome as the previous simple assignment of
GPIO19 - layer 1
BUTTON6 - layer 2
It would appear that Layer 1 being active precludes Layer 2 being active.
In https://github.com/jfedor2/hid-remapper/blob/master/EXPRESSIONS.md there is reference to “When fetching the currently active layers with layer_state" - active layers, plural.
I’ve not found anything that clearly shows how to set multiple layers to be active.
How is this achieved?
This does not work when one of the inputs is a GPIO
I have not yet found an example which shows how to have more than one layer active. Very disappointing.
All I want to do is slow the mouse cursor down when button6 is held on my trackball, it seems a trivial ambition.
Yes, you can have multiple layers active at the same time (GPIO inputs make no difference). If you stop and think how it works perhaps you’ll reconsider if that’s really what you want.
When layers 1 and 2 are both active, mappings from both of these layers are processed.
If you have a Cursor X->Cursor X, scaling=1 mapping on layer 1 and Cursor X->Cursor X, scaling=0.25 mapping on layer 2, and both layers are active, you’re effectively getting 1.25x cursor speed (inputs that are sent to your PC are a sum of the results of all mappings).
You haven’t noticed such behavior with only one layer because layer 0 automatically deactivates whenever any other layer is active.
I don’t have cursors mapped in layer one, are you saying they are implicitly mapped?
How do I get cursor mapping only on layer2?
They are implicitly mapped because you have unmapped inputs passthrough enabled. If you unmap them your mouse will stop working on layer 1.
Ok, thanks.
As you can see Layer 1 is selected by the status of GPIO19, it tells us whether we are focussed on FreeCAD, for which the forward and middle buttons get remapped.
Whether we’re in FreeCAD or not, I want to slow the cursor down when button 6 is held.
I’m still no closer to finding out how to do that.
You can try something like this:
I’ve given that a try, the cursor slowdown only works when layer 1 is active.
I had started writing some expression stuff to try to get the right scaling…
My mistake, I didn’t have Button6 enable in all layers.
Works a treat now. here’s what it looks like, there are no expressions or macros.
hid-remapper-config FullyWorking.json (4.7 KB)
Config attached for anyone who wants to pinch it.
Huge thanks for your help.