Sticky not working as expected for drag-lock on mouse button
I am trying to set up hid-remapper so that holding the left trackball button activates drag lock for the right trackball button (via layer 1) and also turns on the scroll lock led on the keyboard while layer 1 is active.
This config:
does turn scroll lock on and off when the left mouse button is held, but does not make the right button sticky as expected.
This config, with Expression 1 = 1:
does not turn on the scroll lock LED as expected when the left button is held. (The trackball, not the keyboard, is connected to the RP2040 board; is that why?) This config also does not alter the behavior of the right button as expected.
Am I misunderstanding how layers or the S/T/H flags are supposed to work?
I just tested this configuration and it works as expected with regard to the right button being sticky while left button is held:
You'd probably also want to add a Left button->Left button mapping with the "tap" flag set so that you can continue to use it as the left button.
Also keep in mind with this configuration, you have to be on layer 1 to "unstick" the right button by pressing it again.
To control the Scroll Lock LED directly, the keyboard needs to be plugged into HID Remapper.
Thank you for the fast and helpful response! I did not understand that a layer activation works like a momentary switch, not a toggle. A tiny change to the documentation would have prevented my confusion--I'd suggest changing "when" to "while" in the sentence "This means that when that button is pressed, layer X is active and therefore mappings from layer X are applied."
I would add that an option to toggle a layer--e.g., to activate layer 3 with a button tap and keep that layer active until that button is tapped again--would be a powerful new feature for hid-remapper. It would allow users to change how the attached device works for a specific application or class of applications, e.g. drawing apps or certain kinds of games.
For my use case, where I want to be able to make the primary mouse button sticky by holding a button for more than the threshold and then releasing it, I found a solution in the Windows 10 mouse settings. Going to advanced mouse settings reveals a checkbox and slider for controlling the activation of click lock after a configurable delay.
You can set the sticky flag on a mapping that activates a layer, making it a toggle.
Very cool, thanks! In case it is helpful to others as an example, here is a set of mappings I am using that:
- reverses the left and right mouse buttons (because I am left-handed)
- uses button 7 to toggle click lock on and off for the right (primary) mouse button
- activates scroll lock (lighting the led on the keyboard) when in click lock mode