Skip to content

Conversation

nickconway
Copy link
Contributor

Addresses #1393

@Sixzero
Copy link

Sixzero commented Jul 24, 2022

Wow, we even can merge it soon? You guys are crazy fast! Loving it!

@Sixzero
Copy link

Sixzero commented Jul 24, 2022

I am trying to understand why the modkey getting stuck with this option, but I don't see a problem in your code.

@Sixzero
Copy link

Sixzero commented Aug 1, 2022

If someone would review the pull, I would suggest it to get merged. :) The solution seems to be working perfectly! Also any code that was added, only runs if this flavor is turned on, so it won't have effect on other things.

@Sixzero
Copy link

Sixzero commented Aug 23, 2022

Could someone review and approve this? Would be good if it is out in official! It has been working like a charm since the last update! The readme of zmk changed on master AFAIK, so maybe that will need a little evident correction.

@Sixzero
Copy link

Sixzero commented Oct 5, 2022

Could we get it reviewed. I have been using it since aug 1, and everything is working perfectly.
It really is and important feature, not just for me but for anyone trying to use SHIFT + mouse.

Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@okke-formsma Thoughts on this?

Comment on lines +443 to +446
bool keyTap =
!(hold_tap->status == STATUS_HOLD_TIMER || hold_tap->status == STATUS_HOLD_INTERRUPT);
bool holdRelease =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style issue... we use snake_case variable names.

Comment on lines +446 to +448
(hold_tap->status == STATUS_HOLD_TIMER || hold_tap->status == STATUS_HOLD_INTERRUPT) &&
decision_moment == HT_KEY_UP;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(hold_tap->status == STATUS_HOLD_TIMER || hold_tap->status == STATUS_HOLD_INTERRUPT) &&
decision_moment == HT_KEY_UP;
!key_tap && decision_moment == HT_KEY_UP;

@petejohanson petejohanson self-assigned this Oct 8, 2022
@petejohanson petejohanson added behaviors enhancement New feature or request labels Oct 8, 2022
return ZMK_EV_EVENT_BUBBLE;
}

if (undecided_hold_tap->first_press && undecided_hold_tap->config->hold_while_undecided) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the only place where 'first_press' is used and I do not understand why it is needed at all. What does this code solve? Why should we not capture the events that would be captured on line 697?

@okke-formsma
Copy link
Collaborator

okke-formsma commented Oct 15, 2022

I do not feel this MR is on the right track implementation-wise. It adds two new state variables (first_pressed and hold_released) while completely ignoring the existing status variable.

I would suggest to implement this in the following way, more in line with the original implementation of hold-tap. It uses the existing status variable and existing machinery to centralise decisionmaking.

  • add a new status enum value STATUS_UNDECIDED_INITIAL_HOLD
  • add a new function status_is_undecided which returns true if a status is STATUS_UNDECIDED or STATUS_UNDECIDED_INITIAL_HOLD. Replace all tests for STATUS_UNDECIDED with this new function.
  • add a new decision_moment enum value HT_KEY_DOWN. Call decide_hold_tap on initial press with this new value.
  • add a new function decide_initial_hold which is called at the top of decide_hold_tap which sets STATUS_UNDECIDED_INITIAL_HOLD when appropriate and presses the hold key binding.
  • modify press_binding. If 'hold' is decided, do not press the hold again when initial_hold is enabled. If 'tap' is decided, make sure to release the initial hold.

@Sixzero
Copy link

Sixzero commented Nov 3, 2022

@okke-formsma your idea, of trying to solve the functionality without that 2 extra states, seems to be an important request. I also think the functionality should be more deeply integrated, while I think Nicon thought things would be more modular if he used these two states.

I can't reach @nickconway on discord anymore, I have tried to do so in the last 3 weeks. I don't know what is happening to him, so probably the correction of the pull request is on us.

@sporkus
Copy link
Contributor

sporkus commented Mar 21, 2023

Just want to add that this PR works perfectly for me. I am using this for shift, gui(Mac) and ctrl(Windows). Without this option, homerow mods aren't very usable with mouse clicks.

@Sixzero
Copy link

Sixzero commented Mar 28, 2023

I am using it also, and shift + mouseclicks are insanely good! Loving it so much! I hope some day we will merge it!

@nickconway nickconway force-pushed the hold_while_undecided branch from 95b8551 to c3f74bb Compare June 3, 2023 00:54
@theol0403
Copy link
Contributor

Close this in favor of #1811

@caksoylar caksoylar closed this Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

behaviors enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants