-
-
Notifications
You must be signed in to change notification settings - Fork 40.5k
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
Update keyboards/planck/keymaps/vifon #4084
Conversation
Swapping the array indices should increase the locality of the memory access.
Useful for the macro recording because the "tap" modifiers always act as modifiers there.
When the limit is reached, the backlight blinks with each keypress.
- support for a second macro (saved using the end of the macro buffer) - improved reliability
Previously the auxiliary layers were numbered 30 and 31 which resulted in all 32 array elements being allocated regardless of the actually used layers in the user code.
It's not as disruptive as LGUI and it makes the LW/RS order kind of more consistent (LW on the left, RS on the right).
It was confusing to have the modifiers completely swapped. Just moving them is much more natural.
Hm, I don't remember rebasing this branch. Is the messy commit history a problem? |
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.
Additional general feedback:
qmk_firmware/keyboards/planck/keymaps/vifon/keymap.c
Lines 1 to 8 in 29155cb
#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" | |
#include "planck.h" | |
#ifdef BACKLIGHT_ENABLE | |
# include "backlight.h" | |
#endif | |
#include "timer.h" | |
#include <bootloader.h> |
This whole code block can be replaced by #include QMK_KEYBOARD_H
.
qmk_firmware/keyboards/planck/keymaps/vifon/keymap.c
Lines 41 to 42 in 29155cb
#define _______ KC_TRNS | |
#define XXXXXXX KC_NO |
qmk_firmware/keyboards/planck/keymaps/vifon/keymap.c
Lines 101 to 102 in 29155cb
#undef _______ | |
#undef XXXXXXX |
Both these sets of lines are unnecessary. QMK defines these automatically for every keymap.
qmk_firmware/quantum/quantum_keycodes.h
Lines 29 to 31 in 27e216f
// Fillers to make layering more clear | |
#define _______ KC_TRNS | |
#define XXXXXXX KC_NO |
@@ -55,14 +57,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
[_PP] = { /* Pure Pro */ |
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.
All your layers should be formatted to use an appropriate LAYOUT macro, as seen here:
qmk_firmware/keyboards/planck/keymaps/default/keymap.c
Lines 58 to 63 in 27e216f
[_QWERTY] = LAYOUT_planck_grid( | |
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | |
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | |
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , | |
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | |
), |
Regarding the messy commit history, a clean history is easier to review, but for something like this I typically use the Files Changed tab, which shows all the changes contained in the PR. It is best to keep a clean history if you're going to be submitting a PR, though. |
|
||
const uint16_t PROGMEM fn_actions[] = { | ||
ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), | ||
ACTION_MODS_TAP_KEY(MOD_RSFT, KC_DOT), |
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.
These all could be replaced with MT(mod, kc)
.
https://docs.qmk.fm/#/feature_advanced_keycodes?id=mod-tap
No need to use the fn_actions block here, especially as it's depreciated.
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.
Oh, great! I had the first action for over two years when MT()
wasn't available I believe, only SFT_T()
which only had the left shift modifier. And now I just added two analogous actions. I'm going to upgrade it in a few minutes.
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.
Well, SFT_T is an alias for MT, actually.
And there is RSFT_T
and RCTL_T
, too.
And yeah, all of the "functions" have an alias now, so, it's much better now. :)
Also, we squash keymap commits like this, so in the main QMK repo, it will only be a single commit. So no worries. |
Thanks for all the suggestions. I wasn't tracking the recent qmk development and indeed I was missing on some newish quality-of-life features. Fixed! |
Awesome, thanks! |
* 'master' of git://github.com/qmk/qmk_firmware: Keymap: Adds TheVan RoadKit Gamepad Layout (qmk#4090) Update and clarify Unicode documentation (qmk#4065) Update Contrib doc (qmk#4068) Add non-US Hash and Backslash to AutoShift handling Keymap: Update keyboards/planck/keymaps/vifon (qmk#4084)
* Implement macro recording * Remove off-by-one from the macro recorder * Holding both modifiers enables the third layer * Exit the 3rd layer into one of the secondary ones * Regular Enter and Escape on the secondary layers Useful for the macro recording because the "tap" modifiers always act as modifiers there. * Remove the buffer overflow from the macro recorder When the limit is reached, the backlight blinks with each keypress. * More robust macro recording implementation * Macro record refactoring and improvement - support for a second macro (saved using the end of the macro buffer) - improved reliability * Add comments to my macros * Macro recording: remove a redundant code * Separate the raise+lower layer from the special layer * Add back/forward keys * Bind mouse movement * More readable KC_TRNS * Improve the mouse bindings * Use a convenience macro instead of the low-level ACTION macro * Add mouse to the Dual layer; make most of the layer transparent * New "mouse" layer; clean up the "special" layer * CapsLock, NumLock and ScrollLock on the Special layer * Enable my fix for the stuck modifiers and adjust the dual layer to it * Fix the macro recording after enabling the stuck mods fix * Click with Lower/Raise+Space * Reduce the memory used by the macro recording Previously the auxiliary layers were numbered 30 and 31 which resulted in all 32 array elements being allocated regardless of the actually used layers in the user code. * Optimize source_layers_cache for the cache memory Swapping the array indices should increase the locality of the memory access. * Remove the mouse layer * Use update_tri_layer to simplify the code * Add some custom per-keymap build options * Add ShiftLock * Secure the reset button * Add numeric layer * Remove explicit layer keys on LW and RS layers * Replace Alt+left/right with Back/Forward keys * Sleep/delay key (for macro recording) * App/menu key * Fix stuff after merging to master * Local per-keymap config.h; minor cleanup * Remove the old macro_record.h Replaced with dynamic_macro.h * Adjust my keymap to the current API * Pure Pro Gaming layer Accessible by double tapping the Pure Pro layer. It features switched Lower and Raise layers, for one-handed access to numbers. * Pure Pro Gaming layer: no Mod4, persistent number layer under RShift * Pure Pro Gaming layer activated with long press, not double press * Reduce the size of the vifon keymap See: issue qmk#930 * Increase the dynamic macro buffer The default was actually decreased. The actual used value didn't change. * Add the context menu key * No more strange ideas in the gaming layer * Reduce the firmware size by disabling API_SYSEX_ENABLE * Make slash available on the PP layer (replaces the RESET key) * Add a generic "hold this key" macro * Add a missing undef * Turn LGUI in the gaming layer into LW instead of disabling it It's not as disruptive as LGUI and it makes the LW/RS order kind of more consistent (LW on the left, RS on the right). * Refactor the Pure Pro Gaming layer * Try out the 1st party qmk KC_LOCK (vs my own KM_HOLD) * Alternative way to switch keyboard layouts with the left hand * Add dot & slash to the Pure Pro layer (but not to the Gaming layer) * Now that there is a second KM_LW, we can simplify the layout a bit It was confusing to have the modifiers completely swapped. Just moving them is much more natural. * Disable the console now that qmk got bigger * Update the keymap for the modern qmk standards
* Implement macro recording * Remove off-by-one from the macro recorder * Holding both modifiers enables the third layer * Exit the 3rd layer into one of the secondary ones * Regular Enter and Escape on the secondary layers Useful for the macro recording because the "tap" modifiers always act as modifiers there. * Remove the buffer overflow from the macro recorder When the limit is reached, the backlight blinks with each keypress. * More robust macro recording implementation * Macro record refactoring and improvement - support for a second macro (saved using the end of the macro buffer) - improved reliability * Add comments to my macros * Macro recording: remove a redundant code * Separate the raise+lower layer from the special layer * Add back/forward keys * Bind mouse movement * More readable KC_TRNS * Improve the mouse bindings * Use a convenience macro instead of the low-level ACTION macro * Add mouse to the Dual layer; make most of the layer transparent * New "mouse" layer; clean up the "special" layer * CapsLock, NumLock and ScrollLock on the Special layer * Enable my fix for the stuck modifiers and adjust the dual layer to it * Fix the macro recording after enabling the stuck mods fix * Click with Lower/Raise+Space * Reduce the memory used by the macro recording Previously the auxiliary layers were numbered 30 and 31 which resulted in all 32 array elements being allocated regardless of the actually used layers in the user code. * Optimize source_layers_cache for the cache memory Swapping the array indices should increase the locality of the memory access. * Remove the mouse layer * Use update_tri_layer to simplify the code * Add some custom per-keymap build options * Add ShiftLock * Secure the reset button * Add numeric layer * Remove explicit layer keys on LW and RS layers * Replace Alt+left/right with Back/Forward keys * Sleep/delay key (for macro recording) * App/menu key * Fix stuff after merging to master * Local per-keymap config.h; minor cleanup * Remove the old macro_record.h Replaced with dynamic_macro.h * Adjust my keymap to the current API * Pure Pro Gaming layer Accessible by double tapping the Pure Pro layer. It features switched Lower and Raise layers, for one-handed access to numbers. * Pure Pro Gaming layer: no Mod4, persistent number layer under RShift * Pure Pro Gaming layer activated with long press, not double press * Reduce the size of the vifon keymap See: issue qmk#930 * Increase the dynamic macro buffer The default was actually decreased. The actual used value didn't change. * Add the context menu key * No more strange ideas in the gaming layer * Reduce the firmware size by disabling API_SYSEX_ENABLE * Make slash available on the PP layer (replaces the RESET key) * Add a generic "hold this key" macro * Add a missing undef * Turn LGUI in the gaming layer into LW instead of disabling it It's not as disruptive as LGUI and it makes the LW/RS order kind of more consistent (LW on the left, RS on the right). * Refactor the Pure Pro Gaming layer * Try out the 1st party qmk KC_LOCK (vs my own KM_HOLD) * Alternative way to switch keyboard layouts with the left hand * Add dot & slash to the Pure Pro layer (but not to the Gaming layer) * Now that there is a second KM_LW, we can simplify the layout a bit It was confusing to have the modifiers completely swapped. Just moving them is much more natural. * Disable the console now that qmk got bigger * Update the keymap for the modern qmk standards
* Implement macro recording * Remove off-by-one from the macro recorder * Holding both modifiers enables the third layer * Exit the 3rd layer into one of the secondary ones * Regular Enter and Escape on the secondary layers Useful for the macro recording because the "tap" modifiers always act as modifiers there. * Remove the buffer overflow from the macro recorder When the limit is reached, the backlight blinks with each keypress. * More robust macro recording implementation * Macro record refactoring and improvement - support for a second macro (saved using the end of the macro buffer) - improved reliability * Add comments to my macros * Macro recording: remove a redundant code * Separate the raise+lower layer from the special layer * Add back/forward keys * Bind mouse movement * More readable KC_TRNS * Improve the mouse bindings * Use a convenience macro instead of the low-level ACTION macro * Add mouse to the Dual layer; make most of the layer transparent * New "mouse" layer; clean up the "special" layer * CapsLock, NumLock and ScrollLock on the Special layer * Enable my fix for the stuck modifiers and adjust the dual layer to it * Fix the macro recording after enabling the stuck mods fix * Click with Lower/Raise+Space * Reduce the memory used by the macro recording Previously the auxiliary layers were numbered 30 and 31 which resulted in all 32 array elements being allocated regardless of the actually used layers in the user code. * Optimize source_layers_cache for the cache memory Swapping the array indices should increase the locality of the memory access. * Remove the mouse layer * Use update_tri_layer to simplify the code * Add some custom per-keymap build options * Add ShiftLock * Secure the reset button * Add numeric layer * Remove explicit layer keys on LW and RS layers * Replace Alt+left/right with Back/Forward keys * Sleep/delay key (for macro recording) * App/menu key * Fix stuff after merging to master * Local per-keymap config.h; minor cleanup * Remove the old macro_record.h Replaced with dynamic_macro.h * Adjust my keymap to the current API * Pure Pro Gaming layer Accessible by double tapping the Pure Pro layer. It features switched Lower and Raise layers, for one-handed access to numbers. * Pure Pro Gaming layer: no Mod4, persistent number layer under RShift * Pure Pro Gaming layer activated with long press, not double press * Reduce the size of the vifon keymap See: issue qmk#930 * Increase the dynamic macro buffer The default was actually decreased. The actual used value didn't change. * Add the context menu key * No more strange ideas in the gaming layer * Reduce the firmware size by disabling API_SYSEX_ENABLE * Make slash available on the PP layer (replaces the RESET key) * Add a generic "hold this key" macro * Add a missing undef * Turn LGUI in the gaming layer into LW instead of disabling it It's not as disruptive as LGUI and it makes the LW/RS order kind of more consistent (LW on the left, RS on the right). * Refactor the Pure Pro Gaming layer * Try out the 1st party qmk KC_LOCK (vs my own KM_HOLD) * Alternative way to switch keyboard layouts with the left hand * Add dot & slash to the Pure Pro layer (but not to the Gaming layer) * Now that there is a second KM_LW, we can simplify the layout a bit It was confusing to have the modifiers completely swapped. Just moving them is much more natural. * Disable the console now that qmk got bigger * Update the keymap for the modern qmk standards
Update my personal keymap. It contains a referential usage of the dynamic macros, and a few custom features, for example
KM_HOLD
similar to the built-inKC_LOCK
but a bit more powerful (it's possible to easily hold many keys).