Skip to content

Commit

Permalink
[Keymap] ninjonas keymap updates (qmk#8373)
Browse files Browse the repository at this point in the history
* [keymap(ninjonas)] ninjonas keymap updates

* [refactor] switching encoder rotation logic. recent pull seems to have flipped encoder stuff

* [keymap(lily58)] added chrome change profile key on RAISE

Co-authored-by: Jonas Avellana <[email protected]>
  • Loading branch information
2 people authored and HokieGeek committed Apr 10, 2020
1 parent c7b65e5 commit 0ef7b46
Show file tree
Hide file tree
Showing 20 changed files with 293 additions and 173 deletions.
2 changes: 1 addition & 1 deletion keyboards/crkbd/keymaps/ninjonas/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#define TAPPING_TERM 300
#define TAPPING_TERM 200

#define MASTER_LEFT

Expand Down
2 changes: 1 addition & 1 deletion keyboards/kyria/keymaps/ninjonas/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#pragma once

#define TAPPING_TERM 300
#define TAPPING_TERM 200

#ifdef OLED_DRIVER_ENABLE
#define OLED_DISPLAY_128X64
Expand Down
84 changes: 0 additions & 84 deletions keyboards/kyria/keymaps/ninjonas/encoder.c

This file was deleted.

6 changes: 3 additions & 3 deletions keyboards/kyria/keymaps/ninjonas/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
_____________________QWERTY_L2______________________, _____________________QWERTY_R2______________________,
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
_____________________QWERTY_L3______________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________QWERTY_R3______________________,
_____________________QWERTY_L3______________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________QWERTY_R3______________________,
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
// `----------------------------------------' `----------------------------------------'
Expand All @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
_____________________DVORAK_L2______________________, _____________________DVORAK_R2______________________,
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
_____________________DVORAK_L3______________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________DVORAK_R3______________________,
_____________________DVORAK_L3______________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________DVORAK_R3______________________,
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
// `----------------------------------------' `----------------------------------------'
Expand All @@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
_____________________COLEMAK_L2_____________________, _____________________COLEMAK_R2_____________________,
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
_____________________COLEMAK_L3_____________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________COLEMAK_R3_____________________,
_____________________COLEMAK_L3_____________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________COLEMAK_R3_____________________,
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
// `----------------------------------------' `----------------------------------------'
Expand Down
40 changes: 39 additions & 1 deletion keyboards/kyria/keymaps/ninjonas/oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ void oled_white_space(void){
oled_write_P(PSTR(" "), false);
}

void oled_slash_separator(void){
oled_write_P(PSTR(" / "), false);
}

void render_layout_state(void) {
oled_write_P(PSTR("\nLayout: "), false);
oled_write_P(PSTR("Layout: "), false);
switch (biton32(default_layer_state)) {
case _COLEMAK:
oled_write_P(PSTR("Colemak"), false);
Expand All @@ -121,6 +125,37 @@ void render_layout_state(void) {
oled_write_ln_P(PSTR("Undefined"), false);
}
}
#ifdef ENCODER_ENABLE
static void render_encoder_state(void) {
oled_write_P(PSTR("\nEnc: "), false);
bool lower = layer_state_is(_LOWER) & !layer_state_is(_ADJUST);
bool raise = layer_state_is(_RAISE) & !layer_state_is(_ADJUST);
bool adjust = layer_state_is(_ADJUST);

if(lower){
oled_write_P(PSTR("APPSW"), left_encoder_rotated);
oled_slash_separator();
oled_write_P(PSTR("UPDN"), right_encoder_rotated);
} else if(raise){
oled_write_P(PSTR("PGUD"), left_encoder_rotated);
oled_slash_separator();
oled_write_P(PSTR("TABSW"), right_encoder_rotated);
} else if(adjust){
oled_write_P(PSTR("RHUE"), left_encoder_rotated);
oled_slash_separator();
oled_write_P(PSTR("RBRI"), right_encoder_rotated);
} else {
oled_write_P(PSTR("BRI"), left_encoder_rotated);
oled_slash_separator();
oled_write_P(PSTR("VOL"), right_encoder_rotated);
}

if (timer_elapsed(encoder_rotated_timer) > 200) {
left_encoder_rotated = false;
right_encoder_rotated = false;
}
}
#endif

static void render_layer_state(void) {
oled_write_P(PSTR("\nLayer:"), false);
Expand Down Expand Up @@ -156,6 +191,9 @@ void render_mod_state(uint8_t modifiers) {
static void render_status(void) {
render_qmk_logo();
render_layout_state();
#ifdef ENCODER_ENABLE
render_encoder_state();
#endif
render_layer_state();
render_mod_state(get_mods()|get_oneshot_mods());
}
Expand Down
3 changes: 1 addition & 2 deletions keyboards/kyria/keymaps/ninjonas/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ ENCODER_ENABLE = yes # Enables the use of one or more encoders
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
LINK_TIME_OPTIMIZATION_ENABLE = yes

SRC += encoder.c \
oled.c
SRC += oled.c
2 changes: 1 addition & 1 deletion keyboards/lily58/keymaps/ninjonas/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, _____________MOUSE_1______________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, _____________MOUSE_2______________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
__________________________________, __________________________________
__________________________________, _______, _______, _______, K_CPRF
),

/* ADJUST
Expand Down
1 change: 1 addition & 0 deletions keyboards/lily58/keymaps/ninjonas/rules.mk
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
OLED_DRIVER_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
2 changes: 1 addition & 1 deletion keyboards/pinky/3/keymaps/ninjonas/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
#define USE_SERIAL_PD2

#define TAPPING_FORCE_HOLD
#define TAPPING_TERM 300
#define TAPPING_TERM 200
#define RETRO_TAPPPING
6 changes: 3 additions & 3 deletions keyboards/pinky/3/keymaps/ninjonas/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
_____________________QWERTY_L3______________________, LT_RAI, LT_LOW, _____________________QWERTY_R3______________________,
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
//`---------------------------------------' `---------------------------------------'
),

Expand All @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
_____________________DVORAK_L3______________________, LT_RAI, LT_LOW, _____________________DVORAK_R3______________________,
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
//`---------------------------------------' `---------------------------------------'
),

Expand All @@ -55,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
_____________________COLEMAK_L3_____________________, LT_RAI, LT_LOW, _____________________COLEMAK_R3_____________________,
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
//`---------------------------------------' `---------------------------------------'
),

Expand Down
25 changes: 12 additions & 13 deletions users/ninjonas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,19 @@ See: https://docs.qmk.fm/#/feature_userspace
|K_LOCK | MacOS shortcut to execute lock command Cmd + CTRL + Q |
|K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard |
|K_MDSH | MacOS shortcut to get em-dash `` |
|K_RAPP | MacOS shortcut to switch apps to the right |
|K_LAPP | MacOS shortcut to switch apps to the left |
|K_CPRF | Cmd + Shift + M. Used for switching Google Chrome profiles |

### [Layers](ninjonas.h)
|Code | Description |
|---|---|
|LT_LOW | Tap for ENTER, hold for RAISE |
|LT_RAI | Tap for SPACE, hold for LOWER |
|LT_LOW + LT_RAI | Hold for ADJUST |
|LM_LOW | Dedicated key to momentarily toggle to use LOWER layer |
|LM_RAI | Dedicated key to momentarily toggle to use RAISE layer |
|LG_LOW | Press to toggle LOWER layer |
|LG_RAI | Press to toggle RAISE layer |

### [Mod-Taps](ninjonas.h)
|Code | Description |
|---|---|
|MT_DEL | Tap for Delete, hold for Cmd + ALT + SHIFT |
|MT_EQL | Tap for =, hold for ALT + SHIFT |
|MT_DEL | Tap for Delete, hold for ALT + SHIFT |
|MT_EQL | Tap for =, SHIFT |

### [Layout Blocks](ninjonas.h)
Predefined keyboard layout templates to speed up configuring split keyboards
Expand Down Expand Up @@ -72,7 +65,6 @@ Predefined keyboard layout templates to speed up configuring split keyboards
|M_SHFT | Sends Cmd + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) |
|M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory |
|M_TERM | Launches Spotlight and calls Terminal |
|M_COPA | Single key copy/paste |
|M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) |

### [Tap-Dance](tap_dances.h)
Expand All @@ -84,11 +76,18 @@ Predefined keyboard layout templates to speed up configuring split keyboards
|T_TAB | Tap once for TAB, double for CTRL + TAB |
|T_GRV | Tap once for GRV, double for Cmd + GRV |
|T_GUI | Tap once for Cmd, double to open spotlight |
|T_W | Tap for W, double tap for Cmd + W |
|T_Q | Tap for Q, double tap for Cmd + Q |
|T_CPNU | Tap for Cmd + V, hold for Cmd + C, double tap for NUMPAD layer |
|T_CPAP | Tap for Cmd + V, hold for Cmd + C, double tap to open [Line](https://line.me/en/) app, triple tap for itunes. |
|T_Y | Tap for Y, double tap for NUMPAD layer |

### [Combos](combos.h)
|Code | Description |
|---|---|
|EQ_QUIT | Press E + Q will trigger Cmd + Q |
|RW_CLOSE | Press R + W will trigger Cmd + W|
|ET_TAB | Press E + T will trigger Cmd + T|
|ZC_COPY | Press Z + C will trigger Cmd + C|
|XV_PASTE | Press X + V will trigger Cmd + V|

### Secrets
There's times where you have macros you don't want to share like emails, an address you need but you always forget, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used.

Expand Down
55 changes: 55 additions & 0 deletions users/ninjonas/combos.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include "ninjonas.h"

#ifdef COMBO_ENABLE
enum combo_events {
EQ_QUIT,
RW_CLOSE,
QT_TAB,
ZC_COPY,
XV_PASTE
};

const uint16_t PROGMEM quit_combo[] = {KC_E, KC_Q, COMBO_END};
const uint16_t PROGMEM close_combo[] = {KC_R, KC_W, COMBO_END};
const uint16_t PROGMEM tab_combo[] = {KC_Q, KC_T, COMBO_END};
const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END};

combo_t key_combos[COMBO_COUNT] = {
[EQ_QUIT] = COMBO_ACTION(quit_combo),
[RW_CLOSE] = COMBO_ACTION(close_combo),
[QT_TAB] = COMBO_ACTION(tab_combo),
[ZC_COPY] = COMBO_ACTION(copy_combo),
[XV_PASTE] = COMBO_ACTION(paste_combo),
};

void process_combo_event(uint8_t combo_index, bool pressed) {
switch(combo_index) {
case EQ_QUIT:
if (pressed) {
tap_code16(LGUI(KC_Q));
}
break;
case RW_CLOSE:
if (pressed) {
tap_code16(LGUI(KC_W));
}
break;
case QT_TAB:
if (pressed) {
tap_code16(LGUI(KC_T));
}
break;
case ZC_COPY:
if (pressed) {
tap_code16(LGUI(KC_C));
}
break;
case XV_PASTE:
if (pressed) {
tap_code16(LGUI(KC_V));
}
break;
}
}
#endif
11 changes: 9 additions & 2 deletions users/ninjonas/config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifdef TAPPING_TERM
#undef TAPPING_TERM
#define TAPPING_TERM 300
#define TAPPING_TERM 200
#endif

// Mouse Settings: Smoothing out mouse movement on keypress
Expand All @@ -11,4 +11,11 @@
#define MOUSEKEY_DELAY 0
#define MOUSEKEY_TIME_TO_MAX 60
#define MOUSEKEY_MAX_SPEED 7
#define MOUSEKEY_WHEEL_DELAY 0
#define MOUSEKEY_WHEEL_DELAY 0

#ifdef COMBO_ENABLE
#undef COMBO_COUNT
#undef COMBO_TERM
#define COMBO_COUNT 5
#define COMBO_TERM 60
#endif
Loading

0 comments on commit 0ef7b46

Please sign in to comment.