-
-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Adds a default value for IS_COMMAND for COMMAND feature #4301
Conversation
Yeah, I'd remove existing defines that aren't different from the default just because it'd make all the But in either case, you should definitely remove |
Well, one of those files doesn't actually need it removed, if you check. :) Though as for removing it everywhere else, I'll let @jackhumbert or @skullydazed make the call on that one, and then proceed accordingly. I'm not a fan of touching every keyboard, unless it's a significant change (like the PSM change). |
Totally understandable. Even though I can't see anything going wrong if it's done properly, it's still editing every or almost every keyboard's Regarding the |
2b21b18
to
3756601
Compare
Suggestions here: drashna#15 |
f6567d1
to
0786d1b
Compare
@@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
|
|||
|
|||
/* key combination for magic key command */ | |||
#undef IS_COMMAND |
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.
The keyboard doesn't have #ifndef
around its #define IS_COMMAND
?
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.
Nope, and no other board has.
And I think this should be fine, to be honest.
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.
Yeah, in that case the templates should probably be updated to prevent this for future boards.
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) | ||
/* key combination for magic key command */ | ||
/* defined by default; to change, uncomment and set to the combination you want */ | ||
// #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) |
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.
// #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) | |
// #ifndef IS_COMMAND | |
// #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) | |
// #endif |
@@ -18,3 +18,5 @@ | |||
#define PERMISSIVE_HOLD | |||
#define TAPPING_TERM 200 | |||
#define TAPPING_TOGGLE 2 | |||
|
|||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) |
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.
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) |
It's already defined above on lines 5 and 6, so remove these two lines. No idea how this passed CI.
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.
@drashna 👆
Also remove the #undef IS_COMMAND
on line 5, it works without that.
(You also have an undef in your Orthodox keymap, so you can remove that too.)
@@ -6,9 +6,8 @@ | |||
// keymap needs oneshot functionality | |||
#undef NO_ACTION_ONESHOT | |||
|
|||
#undef IS_COMMAND | |||
#define IS_COMMAND() ( \ |
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.
#define IS_COMMAND() ( \ |
This is the same as the existing definition for the keyboard, so this can be removed.
560d687
to
9de1a6a
Compare
9de1a6a
to
9cefbe8
Compare
f0a182d
to
7e7b388
Compare
/* key combination for magic key command */ | ||
#define IS_COMMAND() ( \ | ||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
) | ||
|
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 suggest removing the extra newlines as well so we don't end up with lots of files with double empty lines.
Here's a shell script that will find and replace these extra newlines in the files changed by this PR:
for file in $(git diff --numstat master...HEAD | awk '{print $3}'); do
tmp="$file.tmp"
tr '\n' '\f' < "$file" | sed -e 's/\f\f\f/\f\f/g' | tr '\f' '\n' > "$tmp" && mv "$tmp" "$file" &
done
0d6d63a
to
a127a18
Compare
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.
LGTM, would be cool to see this merged soon.
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 always misclick "Request changes" instead of "Approve" 🙄
I found some more candidates for removal:
|
I've removed these occurrences here: drashna#22 |
Removed double empty lines in modified There's one more redundant |
1ed2ed7
to
8fbe108
Compare
Jan 24th edition
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.
looks good!
* 'master' of https://github.com/qmk/qmk_firmware: Fix Command feature: use get_mods() instead of keyboard_report->mods (qmk#4955) [Keymap] Small improvements to Maxr1998's Contra keymap (qmk#4952) [Keymap] Minor updates to my dz60 keymap (qmk#4943) [Keyboard] UniGo66 keyboard added (qmk#4913) [Keymap] Move Iris via support to Via keymap (qmk#4893) Adds a default value for IS_COMMAND for COMMAND feature (qmk#4301) [Keyboard] drop unused i2c files (qmk#4948) [Keymap] Add Maxim keymap for Fourier (qmk#4534) use built-in arm stuff [Keymap] Add userspace files for vosechu (qmk#4912)
* Add default value for IS_COMMAND for COMMAND feature * Cleanup and consistency * Update Templates to reflect change * Fix IS_COMMAND in template * Fix IS_COMMAND define * Use consistent IS_COMMAND block in templates * Remove unnecessary `#undef IS_COMMAND` directives * Fix compile issue on orthodox * Reomve IS_COMMAND option for newer boards * Remove all existing definitions of IS_COMMAND if they use default LSHIFT and RSHIFT setting * Remove a couple of additional IS_COMMAND defines * Remove remaining redundant IS_COMMAND definitions * Remove #undef IS_COMMAND from orthodox:drashna and whitefox:konstantin * Remove multiple empty lines in modified config.h files * Update additional boards * Reomve IS_COMMAND from newer boards * Update Alice keyboard * Remove IS_COMMAND from additional boards Jan 24th edition
* Add default value for IS_COMMAND for COMMAND feature * Cleanup and consistency * Update Templates to reflect change * Fix IS_COMMAND in template * Fix IS_COMMAND define * Use consistent IS_COMMAND block in templates * Remove unnecessary `#undef IS_COMMAND` directives * Fix compile issue on orthodox * Reomve IS_COMMAND option for newer boards * Remove all existing definitions of IS_COMMAND if they use default LSHIFT and RSHIFT setting * Remove a couple of additional IS_COMMAND defines * Remove remaining redundant IS_COMMAND definitions * Remove #undef IS_COMMAND from orthodox:drashna and whitefox:konstantin * Remove multiple empty lines in modified config.h files * Update additional boards * Reomve IS_COMMAND from newer boards * Update Alice keyboard * Remove IS_COMMAND from additional boards Jan 24th edition
Fixes #4295
Wasn't sure if I should pull out all of the existing defines for this, but opted against it.