-
-
Notifications
You must be signed in to change notification settings - Fork 40.3k
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
[Keymap] Update brauner preonic layout #20439
Conversation
case MOD_TAP_LSFT_ESC: | ||
/* Immediately select the hold action when another key is pressed. */ | ||
return true; | ||
case MOD_TAP_LSFT_ENT: | ||
/* Immediately select the hold action when another key is pressed. */ | ||
return true; |
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.
Not a big difference, but writing it like this reduces repetition a bit, and would help adding other keycodes here easier and faster in the future
case MOD_TAP_LSFT_ESC: | |
/* Immediately select the hold action when another key is pressed. */ | |
return true; | |
case MOD_TAP_LSFT_ENT: | |
/* Immediately select the hold action when another key is pressed. */ | |
return true; | |
case MOD_TAP_LSFT_ESC: | |
case MOD_TAP_LSFT_ENT: | |
/* Immediately select the hold action when another key is pressed. */ | |
return true; |
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.
I'm fine with that change. Note, that if you do allow that in the code you probably want to use fallthrough
semantics going forward, i.e.,
#if HAVE_COMPILER_ATTR_FALLTHROUGH || __GNUC__ >= 7
#define fallthrough __attribute__((__fallthrough__))
#else
#define fallthrough /* fall through */
#endif
bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case MOD_TAP_LSFT_ESC:
fallthrough;
case MOD_TAP_LSFT_ENT:
/* Immediately select the hold action when another key is pressed. */
return true;
default:
/* Do not select the hold action when another key is pressed. */
return false;
}
}
Then all places can be converted to use fallthrough
and then you can ultimately enable -Wimplicit-fallthrough=5
.
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.
updated
Signed-off-by: Christian Brauner <[email protected]>
Adapt to changes that make
IGNORE_MOD_TAP_INTERRUPT
the default.