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

Update keyboards/planck/keymaps/vifon #4084

Merged
merged 68 commits into from
Oct 6, 2018
Merged

Update keyboards/planck/keymaps/vifon #4084

merged 68 commits into from
Oct 6, 2018

Conversation

vifon
Copy link
Contributor

@vifon vifon commented Oct 5, 2018

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-in KC_LOCK but a bit more powerful (it's possible to easily hold many keys).

vifon added 30 commits May 3, 2016 22:34
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.
@vifon
Copy link
Contributor Author

vifon commented Oct 5, 2018

Hm, I don't remember rebasing this branch. Is the messy commit history a problem?

Copy link
Member

@noroadsleft noroadsleft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional general feedback:


#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.


#define _______ KC_TRNS
#define XXXXXXX KC_NO

#undef _______
#undef XXXXXXX

Both these sets of lines are unnecessary. QMK defines these automatically for every keymap.

// 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 */
Copy link
Member

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:

[_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
),

@noroadsleft
Copy link
Member

noroadsleft commented Oct 5, 2018

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),
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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. :)

keyboards/planck/keymaps/vifon/keymap.c Show resolved Hide resolved
@drashna
Copy link
Member

drashna commented Oct 5, 2018

Also, we squash keymap commits like this, so in the main QMK repo, it will only be a single commit. So no worries.

@vifon
Copy link
Contributor Author

vifon commented Oct 6, 2018

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!

@drashna
Copy link
Member

drashna commented Oct 6, 2018

Awesome, thanks!

@drashna drashna added the keymap label Oct 6, 2018
@drashna drashna merged commit 60f5ce8 into qmk:master Oct 6, 2018
akatrevorjay added a commit to akatrevorjay/qmk_firmware that referenced this pull request Oct 8, 2018
* '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)
zer09 pushed a commit to zer09/qmk_firmware that referenced this pull request Oct 13, 2018
* 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
rseymour pushed a commit to rseymour/qmk_firmware that referenced this pull request Mar 13, 2019
* 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
yamad pushed a commit to yamad/qmk_firmware that referenced this pull request Apr 10, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants