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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9241c76
Optimize source_layers_cache for the cache memory
vifon Apr 13, 2016
0fa65b9
Implement macro recording
vifon Feb 8, 2016
147c283
Remove off-by-one from the macro recorder
vifon Feb 8, 2016
da8b5b0
Holding both modifiers enables the third layer
vifon Feb 8, 2016
eeb282f
Exit the 3rd layer into one of the secondary ones
vifon Feb 9, 2016
468ddf6
Regular Enter and Escape on the secondary layers
vifon Feb 9, 2016
2e77cfc
Remove the buffer overflow from the macro recorder
vifon Feb 9, 2016
7eb9a9d
More robust macro recording implementation
vifon Feb 11, 2016
116e5cd
Macro record refactoring and improvement
vifon Feb 14, 2016
a32f973
Add comments to my macros
vifon Feb 14, 2016
ba6c1e0
Macro recording: remove a redundant code
vifon Feb 14, 2016
2b9420a
Separate the raise+lower layer from the special layer
vifon Feb 20, 2016
571c5b5
Add back/forward keys
vifon Feb 22, 2016
3eedc30
Bind mouse movement
vifon Feb 24, 2016
03dc41a
More readable KC_TRNS
vifon Feb 24, 2016
942a1f2
Improve the mouse bindings
vifon Feb 24, 2016
8ee14f1
Use a convenience macro instead of the low-level ACTION macro
vifon Feb 28, 2016
be413b8
Add mouse to the Dual layer; make most of the layer transparent
vifon Feb 28, 2016
36c9171
New "mouse" layer; clean up the "special" layer
vifon Mar 1, 2016
504c1b0
CapsLock, NumLock and ScrollLock on the Special layer
vifon Mar 9, 2016
f20fb01
Enable my fix for the stuck modifiers and adjust the dual layer to it
vifon Mar 9, 2016
1da9014
Fix the macro recording after enabling the stuck mods fix
vifon Mar 12, 2016
bfcf02f
Click with Lower/Raise+Space
vifon Mar 12, 2016
3f56caa
Reduce the memory used by the macro recording
vifon Apr 3, 2016
0867cfd
Remove the mouse layer
vifon Apr 23, 2016
13976e9
Use update_tri_layer to simplify the code
vifon May 3, 2016
1a9905f
Add some custom per-keymap build options
vifon May 3, 2016
12a7736
Add ShiftLock
vifon May 11, 2016
1ad2097
Secure the reset button
vifon May 14, 2016
d7a21b8
Add numeric layer
vifon May 29, 2016
1b76eac
Remove explicit layer keys on LW and RS layers
vifon May 29, 2016
e9adad5
Replace Alt+left/right with Back/Forward keys
vifon May 29, 2016
2cc690f
Sleep/delay key (for macro recording)
vifon Jul 1, 2016
c87de98
App/menu key
vifon Jul 1, 2016
6105443
Merge branch 'master' into personal
vifon Aug 15, 2016
222179a
Fix stuff after merging to master
vifon Aug 15, 2016
09eafb9
Local per-keymap config.h; minor cleanup
vifon Aug 16, 2016
8302f54
Merge branch 'dynamic_macros' into personal
vifon Aug 17, 2016
dacd7a7
Adjust my keymap to the current API
vifon Aug 17, 2016
abf5fa8
Remove the old macro_record.h
vifon Aug 17, 2016
68daf27
Merge branch 'master' into personal
vifon Aug 18, 2016
16835b1
Pure Pro Gaming layer
vifon Aug 26, 2016
25e2989
Pure Pro Gaming layer: no Mod4, persistent number layer under RShift
vifon Sep 7, 2016
7ae04be
Pure Pro Gaming layer activated with long press, not double press
vifon Sep 7, 2016
1081d2d
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware …
vifon Oct 9, 2016
5a0bfc2
Merge branch 'master' into personal
vifon Dec 18, 2016
737afa5
Reduce the size of the vifon keymap
vifon Dec 18, 2016
38e3190
Increase the dynamic macro buffer
vifon Dec 18, 2016
7caed37
Add the context menu key
vifon Dec 18, 2016
ea835d1
No more strange ideas in the gaming layer
vifon Jan 13, 2017
b7eba86
Merge branch 'master' into personal
vifon Jan 13, 2017
f5a76a6
Reduce the firmware size by disabling API_SYSEX_ENABLE
vifon Feb 9, 2017
318f087
Make slash available on the PP layer (replaces the RESET key)
vifon May 3, 2017
91e5a9c
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware …
vifon May 3, 2017
77271d1
Merge branch 'pr_1267_fix' into personal
vifon May 3, 2017
ecca7ca
Merge branch 'master' into personal
vifon May 8, 2017
7f80c9d
Add a generic "hold this key" macro
vifon Jul 7, 2017
c0fc74f
Add a missing undef
vifon Mar 18, 2018
55473bf
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware …
vifon Mar 18, 2018
b650a5d
Turn LGUI in the gaming layer into LW instead of disabling it
vifon Oct 5, 2018
73f331c
Refactor the Pure Pro Gaming layer
vifon Oct 5, 2018
708063b
Try out the 1st party qmk KC_LOCK (vs my own KM_HOLD)
vifon Oct 5, 2018
8373a31
Alternative way to switch keyboard layouts with the left hand
vifon Oct 5, 2018
71a67b3
Add dot & slash to the Pure Pro layer (but not to the Gaming layer)
vifon Oct 5, 2018
65e866f
Now that there is a second KM_LW, we can simplify the layout a bit
vifon Oct 5, 2018
b65703f
Disable the console now that qmk got bigger
vifon Oct 5, 2018
29155cb
Merge branch 'master' of https://github.com/qmk/qmk_firmware into per…
vifon Oct 5, 2018
72cb23b
Update the keymap for the modern qmk standards
vifon Oct 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 103 additions & 76 deletions keyboards/planck/keymaps/vifon/keymap.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@

#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>
#include QMK_KEYBOARD_H

// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
Expand All @@ -27,90 +21,98 @@ enum planck_keycodes {
KM_LW = SAFE_RANGE,
KM_RS,
KM_SHLK, /* ShiftLock */
KM_HOLD, /* Any-key Lock */
KM_RST, /* Reset */
KM_NUM, /* Numeric layer */
KM_SLP, /* Sleep 250 ms */
KM_PPLR, /* Pure Pro layer */
KM_PP_GAME, /* Pure Pro Gaming layer */
KM_PP_HOLD, /* Pure Pro / PP Gaming layer */
DYNAMIC_MACRO_RANGE,
};

#include "dynamic_macro.h"

#define _______ KC_TRNS
#define XXXXXXX KC_NO

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QW] = { /* Qwerty */
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{CTL_T(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_FN0 },
{KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL}
},
[_CM] = { /* Colemak */
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN0 },
{KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL}
},
[_PP] = { /* Pure Pro */
{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_ENT },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_RSFT, KC_UP, KC_RCTL},
{KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT}
},
[_PPG] = { /* Pure Pro: Gaming */
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, XXXXXXX, _______, KM_RS , _______, _______, KM_LW , _______, _______, _______, _______},
},
[_NM] = { /* Numeric */
{KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{KC_LSFT, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, KC_FN0 },
{_______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, _______, _______, _______}
},
[_LW]= { /* LOWER */
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
{KC_ESC, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), KM_NUM, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{_______, LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), KM_SLP, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_ENT },
{_______, BL_TOGG, _______, _______, _______, KC_BTN1, KC_BTN1, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
[_RS]= { /* RAISE */
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL },
{KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), KM_PPLR, KM_RST, KC_ENT },
{_______, BL_STEP, _______, _______, _______, KC_BTN2, KC_BTN2, _______, KC_MPLY, KC_VOLD, KC_VOLU, _______}
},
[_DL]= { /* DUAL */
{_______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, _______},
{_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ACL0, KC_ACL2},
{_______, _______, KC_BTN2, KC_BTN3, KC_BTN1, KC_WWW_BACK, KC_WWW_FORWARD, KC_MUTE, _______, _______, _______, _______},
{_______, _______, KC_LGUI, KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______}
},
[_DYN]= { /* special */
{_______, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, KC_PAUS},
{_______, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_SLCK, KC_NLCK},
{KM_SHLK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
};

#undef _______

const uint16_t PROGMEM fn_actions[] = {
ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT),
[_QW] = LAYOUT_planck_mit( /* Qwerty */
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
CTL_T(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, MT(MOD_RSFT, KC_ENT),
KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL
),
[_CM] = LAYOUT_planck_mit( /* Colemak */
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT),
KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL
),
[_PP] = LAYOUT_planck_mit( /* Pure Pro */
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_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, MT(MOD_RSFT, KC_DOT), KC_UP, MT(MOD_RCTL, KC_SLSH),
KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT
),
[_PPG] = LAYOUT_planck_mit( /* Pure Pro: Gaming */
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, _______, KC_RCTL,
_______, _______, KM_LW, _______, KM_RS, _______, KM_RS , _______, _______, _______, _______
),
[_NM] = LAYOUT_planck_mit( /* Numeric */
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_LSFT, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, MT(MOD_RSFT, KC_ENT),
_______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______
),
[_LW] = LAYOUT_planck_mit( /* LOWER */
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
KC_ESC, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), KM_NUM, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), KM_SLP, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_ENT,
_______, BL_TOGG, _______, _______, _______, KC_BTN1, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
[_RS] = LAYOUT_planck_mit( /* RAISE */
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), KM_PP_HOLD, KM_RST, KC_ENT,
_______, BL_STEP, _______, _______, _______, KC_BTN2, _______, KC_MPLY, KC_VOLD, KC_VOLU, _______
),
[_DL] = LAYOUT_planck_mit( /* DUAL */
_______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, _______,
_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ACL0, KC_ACL2,
_______, _______, KC_BTN2, KC_BTN3, KC_BTN1, KC_WWW_BACK, KC_WWW_FORWARD, KC_MUTE, _______, _______, _______, _______,
_______, _______, KC_LGUI, KC_LALT, _______, _______, _______, _______, _______, _______, _______
),
[_DYN] = LAYOUT_planck_mit( /* special */
KM_HOLD, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, KC_PAUS,
KC_LOCK, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_SLCK, KC_NLCK,
KM_SHLK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, KM_PP_GAME, DF(_QW), DF(_PP), _______, _______, _______, _______
),
};

/* It's a pseudo-layer composed of two real layers, we need a function for this. */
void enable_gaming_layer(void) {
vifon marked this conversation as resolved.
Show resolved Hide resolved
default_layer_set((1UL << _PP) | (1UL << _PPG));
#ifdef BACKLIGHT_ENABLE
backlight_toggle();
_delay_ms(100);
backlight_toggle();
#endif
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint16_t key_timer;
static uint8_t ignore_up_events = 0;

uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
if (!process_record_dynamic_macro(macro_kc, record)) {
return false;
}

if (ignore_up_events > 0 && keycode != MO(_DYN) && keycode != KM_HOLD && !record->event.pressed) {
ignore_up_events -= 1;
return false;
}

switch (keycode) {
case KM_LW:
if (record->event.pressed) {
Expand All @@ -133,7 +135,30 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case KM_SHLK:
register_code(KC_LSFT);
break;
case KM_HOLD:
if (!record->event.pressed) {
ignore_up_events += 1;
}
break;
case KM_RST:
{
/* Make slash available on the PP layer. */
if ((1UL << _PP) & default_layer_state) {
int32_t old_default_layer_state = default_layer_state;
int32_t old_layer_state = layer_state;

layer_state = 0;
default_layer_state = (1UL << _QW);

process_record(record);

layer_state = old_layer_state;
default_layer_state = old_default_layer_state;

return false;
}
}

if (record->event.pressed) {
key_timer = timer_read();
} else {
Expand All @@ -146,15 +171,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
}
break;
case KM_PPLR:
case KM_PP_GAME:
if (!record->event.pressed) {
enable_gaming_layer();
}
break;
case KM_PP_HOLD:
if (record->event.pressed) {
key_timer = timer_read();
} else {
if (timer_elapsed(key_timer) >= 250) {
default_layer_set((1UL << _PP) | (1UL << _PPG));
backlight_toggle();
_delay_ms(100);
backlight_toggle();
enable_gaming_layer();
} else {
default_layer_set(1UL << _PP);
}
Expand Down
2 changes: 2 additions & 0 deletions keyboards/planck/keymaps/vifon/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
API_SYSEX_ENABLE = no # https://www.reddit.com/r/olkb/comments/5swhij/_/ddie6zq/
KEY_LOCK_ENABLE = yes

# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
Expand Down