-
Notifications
You must be signed in to change notification settings - Fork 71
Firngrod/passive timeout #1436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Firngrod/passive timeout #1436
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -479,9 +479,10 @@ Firngrod's Home Row Mods (HRM) configuration (Recommended): | |
| set secondaryRole.defaultStrategy advanced | ||
| set secondaryRole.advanced.triggeringEvent release | ||
| set secondaryRole.advanced.timeout 300 | ||
| set secondaryRole.advanced.timeoutAction secondary | ||
| set secondaryRole.advanced.timeoutType passive | ||
| set secondaryRole.advanced.timeoutAction none | ||
|
Comment on lines
+482
to
+483
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are my settings, don't know if they should be recommended. The idea has been described on the Forum. Basically, mods only activate in combinations with a non-mod, otherwise not. If I need to activate a mod (combo) on it's own, I will activate it with a secondary key on the other half, but hold that key long enough to get a |
||
| set secondaryRole.advanced.doubletapToPrimary 1 | ||
| set secondaryRole.advanced.safetyMargin -100 | ||
| set secondaryRole.advanced.safetyMargin -40 | ||
| set secondaryRole.advanced.triggerByMouse 1 | ||
| set secondaryRole.advanced.minimumHoldTime 150 | ||
| set secondaryRole.advanced.acceptTriggersFromSameHalf 0 | ||
|
|
@@ -491,8 +492,9 @@ Full set of advanced strategy config values follows (for copy-paste convenience) | |
|
|
||
| ``` | ||
| set secondaryRole.defaultStrategy advanced | ||
| set secondaryRole.advanced.timeout 500 | ||
| set secondaryRole.advanced.timeout 200 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The text below states 200 ms. On second thought, I should update the text instead. 200 ms timeout is aggressive. |
||
| set secondaryRole.advanced.timeoutAction secondary | ||
| set secondaryRole.advanced.timeoutType active | ||
| set secondaryRole.advanced.safetyMargin 0 | ||
| set secondaryRole.advanced.triggeringEvent press | ||
| set secondaryRole.advanced.triggerByMouse 0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -404,33 +404,22 @@ void PostponerQuery_InfoByKeystate(key_state_t* key, postponer_buffer_record_typ | |
| } | ||
| } | ||
|
|
||
| void PostponerQuery_FindFirstPressed(postponer_buffer_record_type_t** press, postponer_buffer_record_type_t** release, | ||
| key_state_t *opposingKey) | ||
| void PostponerQuery_FindFirstPressed(const postponer_buffer_record_type_t** press, const key_state_t *opposingKey) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Release doesn't matter for the trigger on press and vice versa. We only actually need the time of the event to enforce safety margin. I don't know if we should reduce the function to just return a timestamp? |
||
| { | ||
| bool opposingIsRight = KeyState_IsRightSide(opposingKey); | ||
| for ( int i = 0; i < bufferSize; i++ ) { | ||
| *press = &buffer[POS(i)]; | ||
| if ((*press)->event.type == PostponerEventType_PressKey) { | ||
| if (opposingKey == NULL || opposingIsRight != KeyState_IsRightSide((*press)->event.key.keyState)) { | ||
| for ( int j = i + 1; j < bufferSize; j++ ) { | ||
| *release = &buffer[POS(j)]; | ||
| if ((*release)->event.type == PostponerEventType_ReleaseKey | ||
| && (*press)->event.key.keyState == (*release)->event.key.keyState ) { | ||
| return; | ||
| } | ||
| } | ||
| *release = NULL; | ||
| return; | ||
| } | ||
| } | ||
| } | ||
| *release = NULL; | ||
| *press = NULL; | ||
| return; | ||
| } | ||
|
|
||
| void PostponerQuery_FindFirstReleased(postponer_buffer_record_type_t** press, postponer_buffer_record_type_t** release, | ||
| key_state_t *opposingKey) | ||
| void PostponerQuery_FindFirstReleased(const postponer_buffer_record_type_t** release, const key_state_t *opposingKey) | ||
| { | ||
| bool opposingIsRight = KeyState_IsRightSide(opposingKey); | ||
| if (bufferSize > 1) { | ||
|
|
@@ -439,17 +428,16 @@ void PostponerQuery_FindFirstReleased(postponer_buffer_record_type_t** press, po | |
| if ((*release)->event.type == PostponerEventType_ReleaseKey) { | ||
| if (opposingKey == NULL || opposingIsRight != KeyState_IsRightSide((*release)->event.key.keyState)) { | ||
| for ( int j = 0; j < i; j++ ) { | ||
| *press = &buffer[POS(j)]; | ||
| if ((*press)->event.type == PostponerEventType_PressKey | ||
| && (*press)->event.key.keyState == (*release)->event.key.keyState ) { | ||
| const postponer_buffer_record_type_t * const press = &buffer[POS(j)]; | ||
| if (press->event.type == PostponerEventType_PressKey | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we still need to find the press to ensure that it's there. |
||
| && press->event.key.keyState == (*release)->event.key.keyState ) { | ||
| return; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| *press = NULL; | ||
| *release = NULL; | ||
| return; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming is obviously up for debate. I see
passiveas the timeout passively change the primary action whileactiveactively executes the timeout action. It is entirely reasonable to see it aspassiveas timeout executes passively while you do nothing andactiveis that the timeout executes on the activity of release. Probably different wording is in order.