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

Jonavin murphpad keymap update #14637

Merged
merged 37 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ed1f2f8
fix NKRO - switch to get_mods()
Jonavin Sep 2, 2021
88a2c76
Merge branch 'qmk:master' into jonavin-get_mods-NKRO-fix
Jonavin Sep 2, 2021
d90ba04
refactor encoder action for better readability
Jonavin Sep 3, 2021
e9cf08a
Merge branch 'qmk:master' into jonavin-get_mods-NKRO-fix
Jonavin Sep 3, 2021
5b7abe3
refactor for better readability
Jonavin Sep 3, 2021
950a232
refactor fix - murphpad
Jonavin Sep 3, 2021
5dab943
refactor - encoder layer switching
Sep 3, 2021
4cfecda
Merge branch 'qmk:master' into jonavin-get_mods-NKRO-fix
Jonavin Sep 3, 2021
8c517c0
gmmk pro encoder override defaults
Sep 4, 2021
2db10c7
gmmk pro override defaults
Sep 4, 2021
9427644
cleanup ENCFUNC
Sep 4, 2021
a561272
update readme
Sep 4, 2021
366d7e3
fix readme typo
Sep 4, 2021
d63342f
Merge branch 'qmk:master' into jonavin-get_mods-NKRO-fix
Jonavin Sep 6, 2021
4f6aac6
Merge branch 'qmk:master' into jonavin-get_mods-NKRO-fix
Jonavin Sep 9, 2021
dec722c
Merge branch 'qmk:master' into jonavin-get_mods-NKRO-fix
Jonavin Sep 11, 2021
53ddde0
update vert layout
Jonavin Sep 11, 2021
d0de37d
update vert oled display
Sep 11, 2021
8a4cff9
Update readme.md
Jonavin Sep 11, 2021
d049639
add media keys
Sep 12, 2021
ff3d54e
Merge branch 'jonavin-murphpad-keymap-update' of https://github.com/j…
Sep 12, 2021
d1c5b75
update readme
Sep 12, 2021
70d8241
Update readme.md
Jonavin Sep 12, 2021
3666099
add rgb encoder actions
Sep 12, 2021
fe36e9d
remove duplicate prototype declaration
Sep 12, 2021
e4e25c8
Merge branch 'qmk:master' into jonavin-murphpad-keymap-update
Jonavin Sep 12, 2021
3b33346
update murphpad keymap
Sep 12, 2021
0776ef4
turn off rgb when oled when PC suspended
Sep 12, 2021
808d138
update murphpad keymap
Sep 13, 2021
01448a3
update enc 1 actions
Jonavin Sep 13, 2021
15872a8
Merge branch 'qmk:master' into jonavin-murphpad-keymap-update
Jonavin Sep 23, 2021
36f7c38
Merge branch 'qmk:master' into jonavin-murphpad-keymap-update
Jonavin Sep 25, 2021
4286b87
Merge branch 'qmk:master' into jonavin-murphpad-keymap-update
Jonavin Sep 26, 2021
1239c17
Merge branch 'master'
Sep 28, 2021
6e7951e
resolve conflicts
Sep 28, 2021
74fc9cc
Merge branch 'master' of git://github.com/qmk/qmk_firmware into qmk-m…
Sep 28, 2021
73657e8
Merge branch master
Sep 28, 2021
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
3 changes: 3 additions & 0 deletions keyboards/mechwild/murphpad/keymaps/jonavin/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@

// Increase layers to 6 for VIA
#define DYNAMIC_KEYMAP_LAYER_COUNT 6

// Remove line below for vertical layout
#define LANDSCAPE_MODE
128 changes: 111 additions & 17 deletions keyboards/mechwild/murphpad/keymaps/jonavin/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "jonavin.h"
#include "layout_landscape.h"

#define LANDSCAPE_MODE

// Defines names for use in layer keycodes and the keymap
enum layer_names {
Expand All @@ -28,6 +27,7 @@ enum layer_names {
_RGB
};

#ifdef LANDSCAPE_MODE
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_BASE] = LAYOUT_landscape(
Expand All @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_FN2] = LAYOUT_landscape(
_______, _______, RESET,

_______, _______, _______, _______, _______, _______,
_______, _______, KC_MPLY, KC_MPRV, KC_MNXT, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
Expand Down Expand Up @@ -91,6 +91,73 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______
),
};
#endif // LANDSCAPE_MODE

#ifndef LANDSCAPE_MODE
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base */
[_BASE] = LAYOUT(
TT(_FN2),TT(_FN3),TT(_FN4),LT(_RGB,KC_PSCR),
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_MUTE, KC_P4, KC_P5, KC_P6, _______,
TT(_FN1), KC_P1, KC_P2, KC_P3, KC_PENT,
KC_RALT, KC_P0, _______, KC_PDOT, _______,

TT(_FN3), TT(_FN4), TT(_RGB)
),
[_FN1] = LAYOUT(
_______, _______, _______, RESET,
KC_CALC, _______, _______, _______,
_______, _______, _______, _______,
ENCFUNC, KC_TAB, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, KC_BSPC, _______, KC_DEL, _______,

_______, _______, _______
),
[_FN2] = LAYOUT(
_______, _______, _______, _______,
_______, _______, KC_MPLY, KC_MPRV,
_______, _______, _______, KC_MNXT,
RESET, _______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,

_______, _______, _______
),
[_FN3] = LAYOUT(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,

_______, _______, _______
),
[_FN4] = LAYOUT(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,

_______, _______, _______
),
[_RGB] = LAYOUT(
_______, _______, _______, _______,
_______, _______, _______, _______,
RGB_HUD, RGB_SPI, RGB_HUI, _______,
_______, RGB_RMOD, RGB_TOG, RGB_MOD, _______,
_______, RGB_VAD, RGB_SPD, RGB_VAI, _______,
_______, RGB_SAD, _______, RGB_SAI, _______,

_______, _______, _______
),
};
#endif // !LANDSCAPE_MODE

typedef struct {
char keydesc[6]; // this will be displayed on OLED
Expand All @@ -99,15 +166,15 @@ typedef struct {

static const keycodedescType PROGMEM keyselection[] = {
// list of key codes that will be scrolled through by encoder and description
{"TASK", KC_TASK},
{"INS", KC_INS},
{"DEL", KC_DEL},
{"PrtSc", KC_PSCR},
{"TASK ", KC_TASK},
{"PREV ", KC_MEDIA_PREV_TRACK},
{"NEXT ", KC_MEDIA_NEXT_TRACK},
{"PLAY ", KC_MEDIA_PLAY_PAUSE},
{"PrtScm", KC_PSCR},
{"ScrLk", KC_SCLN},
{"Break", KC_PAUS},
{"C-A-D", KC_CAD}, // Ctrl-Alt-Del
{"AltF4", KC_AF4},
{"PLAY", KC_MEDIA_PLAY_PAUSE},
{"RESET", RESET}, // firmware flash mode
};

Expand Down Expand Up @@ -168,7 +235,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
#endif
uint8_t mods_state = get_mods();
switch (index) {
case 0: // This is the only encoder right now, keeping for consistency
case 0: // main primary encoder
switch(get_highest_layer(layer_state)){ // special handling per layer
case _FN1: // on Fn layer select what the encoder does when pressed
if (!mods_state) {
Expand All @@ -177,6 +244,11 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
} else {
// continue to default
}
case _RGB:
if (!mods_state) {
encoder_action_rgb_hue(clockwise);
break;
}
default: // all other layers
if (mods_state & MOD_BIT(KC_RSFT) ) { // If you are holding R shift, encoder changes layers
encoder_action_layerchange(clockwise);
Expand All @@ -190,6 +262,17 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
break;
}
break;
case 1: // optional secondary encoder
switch(get_highest_layer(layer_state)){ // special handling per layer
case _RGB:
if (!mods_state) {
encoder_action_rgb_mode(clockwise);
break;
}
default: // all other layers
encoder_action_mediatrack(clockwise); // Otherwise prev/next track
break;
}
}
return true;
}
Expand Down Expand Up @@ -287,16 +370,19 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {

void oled_task_user(void) {
render_logo();
oled_set_cursor(0,6);
oled_set_cursor(0,5);

oled_write_ln_P(PSTR("Layer"), false);
oled_write_ln_P(PSTR("-JV-"), false);
oled_write_ln_P(PSTR(" "), false);

bool showSelectedKey = false;
switch (get_highest_layer(layer_state)) {
case _BASE:
oled_write_ln_P(PSTR("Base"), false);
oled_write_ln_P(PSTR("BASE"), false);
break;
case _FN1:
oled_write_ln_P(PSTR("FN 1"), false);
showSelectedKey = true;
break;
case _FN2:
oled_write_ln_P(PSTR("FN 2"), false);
Expand All @@ -311,18 +397,26 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
oled_write_ln_P(PSTR("RGB "), false);
break;
default:
oled_write_ln_P(PSTR("Undef"), false);
oled_write_ln_P(PSTR(" ?? "), false);
}
oled_write_ln_P(PSTR(""), false);
if (showSelectedKey) oled_write_ln(selectedkey_rec.keydesc, false);
else oled_write_ln_P(PSTR(" "), false);

// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
oled_set_cursor(0,11);
oled_write_ln_P(led_state.num_lock ? PSTR(" NUM") : PSTR(" "), false);
oled_write_ln_P(led_state.caps_lock ? PSTR(" CAP") : PSTR(" "), false);
oled_write_ln_P(led_state.scroll_lock ? PSTR(" SCR") : PSTR(" "), false);
}
#endif // !LANDSCAPE_MODE

void suspend_power_down_user(void) { // shutdown oled when powered down to prevent OLED from showing Mercutio all the time
oled_off();
oled_off();
rgblight_disable_noeeprom();
}

void suspend_wakeup_init_user(void) {
rgblight_enable_noeeprom();
}
#endif
43 changes: 27 additions & 16 deletions keyboards/mechwild/murphpad/keymaps/jonavin/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ This allows you to use Murphpad in a horizontal/landscape orientation with extra
[_BASE] = LAYOUT_landscape(
TT(_FN1), TT(_FN2), KC_MUTE,

KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_BSPC,
KC_TAB, KC_P7, KC_P8, KC_P9, KC_PDOT, KC_RGUI,
KC_RSFT, KC_P4, KC_P5, KC_P6, KC_COMMA, KC_RCTL,
KC_P0, KC_P1, KC_P2, KC_P3, KC_PENT, KC_RALT,
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_PPLS, KC_BSPC,
KC_TAB, KC_P7, KC_P8, KC_P9, KC_PDOT, KC_RGUI,
KC_RSFT, KC_P4, KC_P5, KC_P6, KC_COMMA, KC_RCTL,
KC_P0, KC_P1, KC_P2, KC_P3, KC_PENT, KC_RALT,

_______, _______, _______
_______, _______, _______
),

NOTE: VIA is enabled, but it will show it in the normal orientation until I build a landscape layout version
Expand All @@ -25,16 +25,16 @@ Special Features

static const keycodedescType PROGMEM keyselection[] = {
// list of key codes that will be scrollled through by encoder and description
{"TASK", KC_TASK},
{"INS", KC_INS},
{"DEL", KC_DEL},
{"PrtSc", KC_PSCR},
{"ScrLk", KC_SCLN},
{"Break", KC_PAUS},
{"C-A-D", KC_CAD}, // Ctrl-Alt-Del
{"AltF4", KC_AF4},
{"PLAY", KC_MEDIA_PLAY_PAUSE},
{"RESET", RESET}, // firmware flash mode
{"TASK ", KC_TASK},
{"PREV ", KC_MEDIA_PREV_TRACK},
{"NEXT ", KC_MEDIA_NEXT_TRACK},
{"PLAY ", KC_MEDIA_PLAY_PAUSE},
{"PrtScm", KC_PSCR},
{"ScrLk", KC_SCLN},
{"Break", KC_PAUS},
{"C-A-D", KC_CAD}, // Ctrl-Alt-Del
{"AltF4", KC_AF4},
{"RESET", RESET}, // firmware flash mode
};

- Additional encoder functionality
Expand All @@ -49,7 +49,7 @@ rules.mk OPTIONS - Active features from userspace
- STARTUP_NUMLOCK_ON = yes
- turns on NUMLOCK by default

DEFAULT MAPPING
DEFAULT LANDSCAPE MAPPING

![image](https://user-images.githubusercontent.com/71780717/131718965-b20afef6-3bc5-49e4-952f-5755a9d6d539.png)

Expand All @@ -59,7 +59,18 @@ FN1 Layer 1
![image](https://user-images.githubusercontent.com/71780717/131719025-d41cbcd9-80b1-4a0a-abb5-55d878752dc6.png)


FN2 Layer 2

![image](https://user-images.githubusercontent.com/71780717/132967003-63268514-2ac3-4069-bca1-6d92992ca403.png)


RGB Layer 5 - Use Shift+Encoder to get to RGB layer 5

![image](https://user-images.githubusercontent.com/71780717/131719492-e2d05a75-3a7a-48ca-94a3-faa3ff891914.png)

--------------

NORMAL / TRADITIONAL NON-LANDSCAPE NUMPAD LAYOUT

![image](https://user-images.githubusercontent.com/71780717/132966975-3b463fb4-059f-42c5-b8b3-a3d35f4a0d6b.png)

64 changes: 64 additions & 0 deletions users/jonavin/jonavin.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,70 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
}
}
}

#ifdef RGB_MATRIX_ENABLE
void encoder_action_rgb_speed(bool clockwise) {
if (clockwise)
rgb_matrix_increase_speed_noeeprom();
else
rgb_matrix_decrease_speed_noeeprom();
}
void encoder_action_rgb_hue(bool clockwise) {
if (clockwise)
rgb_matrix_increase_hue_noeeprom();
else
rgb_matrix_decrease_hue_noeeprom();
}
void encoder_action_rgb_saturation(bool clockwise) {
if (clockwise)
rgb_matrix_increase_sat_noeeprom();
else
rgb_matrix_decrease_sat_noeeprom();
}
void encoder_action_rgb_brightness(bool clockwise) {
if (clockwise)
rgb_matrix_increase_val_noeeprom();
else
rgb_matrix_decrease_val_noeeprom();
}
void encoder_action_rgb_mode(bool clockwise) {
if (clockwise)
rgb_matrix_step_noeeprom();
else
rgb_matrix_step_reverse_noeeprom();
}
#elif defined(RGBLIGHT_ENABLE)
void encoder_action_rgb_speed(bool clockwise) {
if (clockwise)
rgblight_increase_speed_noeeprom();
else
rgblight_decrease_speed_noeeprom();
}
void encoder_action_rgb_hue(bool clockwise) {
if (clockwise)
rgblight_increase_hue_noeeprom();
else
rgblight_decrease_hue_noeeprom();
}
void encoder_action_rgb_saturation(bool clockwise) {
if (clockwise)
rgblight_increase_sat_noeeprom();
else
rgblight_decrease_sat_noeeprom();
}
void encoder_action_rgb_brightness(bool clockwise) {
if (clockwise)
rgblight_increase_val_noeeprom();
else
rgblight_decrease_val_noeeprom();
}
void encoder_action_rgb_mode(bool clockwise) {
if (clockwise)
rgblight_step_noeeprom();
else
rgblight_step_reverse_noeeprom();
}
#endif // RGB_MATRIX_ENABLE || RGBLIGHT_ENABLE
#endif // ENCODER_ENABLE

#if defined(ENCODER_ENABLE) && defined(ENCODER_DEFAULTACTIONS_ENABLE) // Encoder Functionality
Expand Down
12 changes: 11 additions & 1 deletion users/jonavin/jonavin.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ enum custom_user_keycodes {
KC_WINLCK, //Toggles Win key on and off
RGB_TOI, // Timeout idle time up
RGB_TOD, // Timeout idle time down
RGB_NITE // Turns off all rgb but allow rgb indicators to work
RGB_NITE, // Turns off all rgb but allow rgb indicators to work

NEW_SAFE_RANGE // new safe range for keymap level custom keycodes
};

#define KC_CAD LALT(LCTL(KC_DEL))
Expand Down Expand Up @@ -67,6 +69,14 @@ enum custom_user_keycodes {

uint8_t get_selected_layer(void);
void encoder_action_layerchange(bool clockwise);

#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
void encoder_action_rgb_speed(bool clockwise);
void encoder_action_rgb_hue(bool clockwise);
void encoder_action_rgb_saturation(bool clockwise);
void encoder_action_rgb_brightness(bool clockwise);
void encoder_action_rgb_mode(bool clockwise);
#endif // RGB_MATRIX_ENABLE / RGBLIGHT_ENABLE
#endif // ENCODER_ENABLE


Expand Down