Skip to content
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

Tapping: discrimination between tap and hold #476

Open
tmk opened this issue Jun 4, 2017 · 0 comments
Open

Tapping: discrimination between tap and hold #476

tmk opened this issue Jun 4, 2017 · 0 comments
Labels

Comments

@tmk
Copy link
Owner

tmk commented Jun 4, 2017

Consderations

TAPPING_TERM

By default in TMK you have to depress a key for period of TAPPING_TERM to get 'hold' action, otherwise you will get 'tap' action. This rule is apparently painful when TAPPING_TERM is long.

Original intention of conditional code below is to get 'hold' action without pressing a key during whole TAPPING_TERM, this exceptive behaviour is valid only when the term is beyhond 500ms. Some people prefer this behaviour than default tapping rule, it seems to be reasonable when they know what want exactly. qmk/qmk_firmware#1359

#if TAPPING_TERM >= 500
/* Process a key typed within TAPPING_TERM
* This can register the key before settlement of tapping,
* useful for long TAPPING_TERM but may prevent fast typing.
*/
else if (IS_RELEASED(event) && waiting_buffer_typed(event)) {
debug("Tapping: End. No tap. Interfered by typing key\n");
process_action(&tapping_key);
tapping_key = (keyrecord_t){};
debug_tapping_key();
// enqueue
return false;
}
#endif

#if TAPPING_TERM >= 500
                /* Process a key typed within TAPPING_TERM
                 * This can register the key before settlement of tapping,
                 * useful for long TAPPING_TERM but may prevent fast typing.
                 */
                else if (IS_RELEASED(event) && waiting_buffer_typed(event)) {
                    debug("Tapping: End. No tap. Interfered by typing key\n");
                    process_action(&tapping_key);
                    tapping_key = (keyrecord_t){};
                    debug_tapping_key();
                    // enqueue
                    return false;
                }
#endif

Timeout

Key repeating

Tap counting

When to start Modifier/Layer switch

How to disriminate

Time base

This is used currently in TMK.

Type base

used in TouchCursor. You can get 'hold' action if a tap key is depressed while affected key is typed. You cannot release tap key before releasing the affected key.

Terminology

Dual role key

https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys

Tapping in TMK

A kind of dual role key implementation that assign a key two roles; Tap and Hold action.

Tap action

Normal alpha key action without affecting against other keys.

Hold action

Action such as modifier or layer switching keys which modify behaviour of other keys.

Related issues

#85 #49

@tmk tmk added the KEYMAP label Jun 4, 2017
@tmk tmk changed the title TAPPING_TERM: discrimination between tap and hold Tapping: discrimination between tap and hold Jun 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant