phil wrote:the hook would simply set a timer when a modifier key is pressed. If the modifier key is released before the timer fires, or another key is pressed then the timer will be cancelled and nothing will happen. Only once the timer fires will the layer be switched.
I'm not sure I understand you right
. If by 'released before the timer fires' you mean 'before the set time period has elapsed', then this is just the opposite of what I suggested. My idea was to switch the layer
if the key is released before
the set time period elapses, e.g. if it's set to 100 ms - releasing the key somewhere between 0 and 100 ms would switch the layer
, while releasing it after
100 ms (or if another key is pressed, as you mentioned) would do nothing
. I'm sorry if I did not express myself clear enough but the idea is still not so clear in my head too
JTB3 wrote:While this is an interesting idea, It seems functionally different and wouldn't offer the same capability as the former. Injtsvetkov is suggesting that one would have to press and then release the key within a specified time-out window to change the layer, and then perform a similar sequence to switch it back [perhaps I'm not fully understanding what's being proposed here!]. This might help offer some additional use-case capability, but it certainly wouldn't solve the core issue of having quick, modifier-enabled mouse remappings (minus the modifier keys) - like simulating the tilt wheel by holding the shift key down and moving the wheel - and numerous others...
I think JT has grasped the idea. In short, the difference between current Layer modifiers and my suggestion is:
Current: Press and hold Shift - the layer changes, click desired mouse buttons, Release Shift - layer reverts. Your finger is constantly pressing Shift during the mouse clicks.
My suggestion: Hit Shift - the layer changes, click desired mouse buttons, Hit Shift again - layer reverts. Your finger could be placed on the Shift key during the mouse clicks like in the first scenario but you don't need to keep it constantly pressed, even you can move away your finger for a moment if you like
. And the whole point of this is that you can have any modifier combination you like.
Of course it's functionally different and I don't mean replacing the current Layer modifiers, but simply adding the new one with the timer as a workaround for cases with modifier interference. Of course most probably it won't be possible to use the same modifier key as both types simultaneously but this is just one of the problems and I'm sure there will be more, I just don't have enough knowledge to figure them out but Phil certainly does
I remember discussing this modifier interference before and the conclusion was that it's certainly not a good idea to block the physically pressed key so nothing could be done about it. That's why I thought some discussion could bring up fresh ideas and hopefully lead to implementing a decent workaround