Double or No tapKey triggered randomly by ifPrimary/ifSecondary

Turns out I have totally forgotten that we made cursor movement also trigger secondary role. For this reason, I have also forgotten to add logs for that one cause of secondary role activation, as it takes place in a different function from the main (timing-related) algorithm.

What right hand module are you using? Is it possible that the secondary roles are triggered by tiny 1 pixel activations of the module caused by typing-induced vibrations?

As to the above logs, there are no secondary activations logged, which means that either they are mouse-induced (as hypothesised above), or that there is something else that is horribly wrong. (It certainly does not look like the algorithm itself activates those secondaries.)

Here is another firmware version, with two fixed logs (the mouse-induced secondary, and one primary that was missed previously), which should confirm or refute the above hypothesis.

uhk-firmware-10.6.0-key_timing_hunt_v3.tar.gz

Again, please record some logs. One should probably suffice.

1 Like

Thanks for the updated firmware, will apply and revert with logs.

RH module is trackball, and is reasonably sensitive, and I am a “kinetic” typist :smiley: :smiley: so it’s definitely possible that cursor movement occurred when I was banging away…

EDIT:

**Clicked Print button, clicked in the "Pages" box and pressed "2" key, had to press 3 times before a 2 appeared in box, so I'm guessing the F2 secondary was firing**
DOWN leftModule.leftButton 1655424 1655424
UP leftModule.leftButton 1655537 1655537
DOWN leftModule.leftButton 1658896 1658896
UP leftModule.leftButton 1659034 1659034
DOWN leftModule.leftButton 1660534 1660534
UP leftModule.leftButton 1660628 1660628
DOWN leftModule.leftButton 1661282 1661282
UP leftModule.leftButton 1661373 1661373
DOWN 2 1661626 1661626
1661635 Secondary D: 2
1661635 OUT ?
1661636 OUT 
UP 2 1661757 1661757
DOWN 2 1662411 1662411
1662455 Secondary?
1662456 OUT 
UP 2 1662569 1662569
DOWN 2 1663081 1663081
1663200 Primary B: 2
1663200 Primary A: 2
1663200 OUT ?
1663201 OUT 
UP 2 1663199 1663202
DOWN leftModule.leftButton 1668048 1668048
UP leftModule.leftButton 1668164 1668164

EDIT2:

**Started typing "Purchased" but secondary fired on "p" keypress. Looking at the dump, maybe the "c" secondary fired also? Have left the leftButton and Fn 8 in - these were to click on text file and Fn 8 is my "dump log" key**
UP rightSpace 12091081 12091081
DOWN p 12091942 12091942
12092058 Secondary D: p
12092058 OUT LC 
12092058 OUT LC p
12092060 OUT LC 
12092062 OUT 
DOWN u 12092032 12092064
12092064 OUT u
UP p 12092073 12092073
DOWN r 12092127 12092127
12092127 OUT ru
UP u 12092135 12092135
12092135 OUT r
UP r 12092217 12092217
12092217 OUT 
DOWN c 12092384 12092384
12092470 Primary B: c
12092470 Primary A: c
12092471 OUT c
120924 c 12092470 12092474
DOWN leftModule.leftButton 12095569 12095569
UP leftModule.leftButton 12095695 12095695
DOWN rightFn 12098357 12098357
DOWN 8 12099146 12099146
1 Like

Yes, these are caused by the module.

Now the question is how to re solve it. Any brainstorming ideas? At the moment I am thinking about:

  • Just add new setting to configure whether secondaries are activated by mouse or not. (I dont like this, since it is a rather clumsy workaround, which does not solve many usecases.)
  • Activate secondaries by mouse only when used with non-cursor navigation mode. (I dont like this, again because it is a just a workaround, not a solution.)
  • Implement an algorithm (or maybe just tailor the axis locking algorithm) to require stronger than 1 pixel move to activate when there is an ongoing secondary role resolution (in order to activate the secondary). (I don’t like this since looks like a pain to implement and maintain.)

@mlac do you have any opinion on this? (Summary: some time ago, I have altered secondary roles to also activate by cursor movement, e.g., to work for ctrl+scrol or ctrl+mouse move. Now UHQueefboard has a problem that when he is typing, his trackball sometimes moves inadvertently, interfering with writing.)

I wouldn’t have made secondary roles dependent on cursor movement, thinking that it can lead to undesired behavior. I don’t mean to be unconstructive; It’s my honest answer.

Fair point, but secondary roles also activate layers, and therefore navigation modes. Does it mean that you would have made navigation modes ignore secondary role layer switchers?

Edit: Actually, how should I interpret your statement in light of Layer switcher secondary roles should trigger relevant navigation modes · Issue #395 · UltimateHackingKeyboard/firmware · GitHub ? Because if you don’t activate the secondary role, then on release you get an undesired primary activation.

(The scenario is that I press a secondary role key just to activate a navigation mode. Now as to my implementation options, either I do fully activate the secondary role when I detect cursor movement, which lead to the above problem, or I don’t activate the secondary role and as a consequence I get an unwanted primary activation on release.)

Secondary roles activating layers and, therefore, navigation modes is fine with me. However, I wouldn’t expect cursor movement to trigger secondary roles, assuming that it can cause unwanted behavior.

I don’t see a difference between the former and the latter.

Wouldn’t just using advancedStrategy and timeouts to trigger the secondary role be sufficient enough? e.g. 300ms to trigger secondary role? I’d hold shift, and by the time I start moving the mouse the secondary role has been triggered (layer switched etc.).

1 Like

Great point.

So I guess the conclusion is:

  • for simple strategy, leave the behavior as is, as it already is incompatible with alphanumeric keys.
  • for advanced strategy, add option to allow activation by mouse, set it to false by default.
1 Like