Skip to content

Commit

Permalink
fix: using QMK DEBUG and RESET functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
SjB committed Feb 3, 2017
1 parent f8d8cdf commit 7be82f2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
21 changes: 11 additions & 10 deletions keyboards/ergodox/keymaps/sjb/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ enum keymaps_layers {

enum custom_keycodes {
PLACE_HOLDER = 0, // can always be here
FLSH,
VRSN,
KDBG,
BROWSER,
TSKSWCH,
EDITOR,
CMD,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
Expand Down Expand Up @@ -260,7 +260,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[FNx] = KEYMAP(
// left hand
M(VRSN), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(FLSH),
M(VRSN), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,
F_MAX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR,
KC_TRNS, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5),
KC_TRNS, KC_TILD, KC_GRV, KC_PIPE, KC_NO, KC_NO, KC_LBRC,
Expand All @@ -269,12 +269,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
M(FLSH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(CMD),
KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_F12,
KC_PLUS, KC_EQUAL, KC_MINS, KC_UNDS, M(KDBG), KC_TRNS,
KC_RBRC,
KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_NO,
KC_RBRC, KC_PLUS, KC_EQUAL, KC_MINS, KC_UNDS, M(KDBG), KC_TRNS,
KC_NO, KC_TRNS, KC_NO, KC_TRNS, DEBUG,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
Expand Down Expand Up @@ -404,14 +403,16 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
break;
case FLSH:
case KDBG:
if (record->event.pressed) { // For resetting EEPROM
reset_keyboard();
debug_keyboard = true;
}
break;
case KDBG:
case CMD:
if (record->event.pressed) { // For resetting EEPROM
debug_keyboard = true;
register_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT));
} else {
unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT));
}
break;
case BROWSER:
Expand Down
8 changes: 1 addition & 7 deletions keyboards/infinity60/keymaps/sjb/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ enum keymaps_layers {

enum custom_keycodes {
PLACE_HOLDER = 0, // can always be here
FLSH,
VRSN,
KDBG,
BROWSER,
Expand All @@ -110,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
OSL_NAV, OSM_MEH, TD_LGUI, MT_SPC, OSM_LALT, OSM_HYPR, OSL_FNx, TD_TSKSWCH \
),
[FNx] = KEYMAP(
M(FLSH), KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MYCM, F_TERM, KC_CALC, KC_WSCH, KC_MAIL, F_BROWSER, M(EDITOR), KC_DELT, KC_DELT, \
RESET, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MYCM, F_TERM, KC_CALC, KC_WSCH, KC_MAIL, F_BROWSER, M(EDITOR), KC_DELT, KC_DELT, \
F_MAX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PWR, \
KC_TRNS, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TILD, KC_GRV, KC_PIPE, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQUAL, KC_MINS, KC_UNDS, KC_NO, KC_TRNS, KC_TRNS, \
Expand Down Expand Up @@ -160,11 +159,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
break;
case FLSH:
if (record->event.pressed) { // For resetting EEPROM
reset_keyboard();
}
break;
case KDBG:
if (record->event.pressed) { // For resetting EEPROM
debug_keyboard = true;
Expand Down
17 changes: 9 additions & 8 deletions keyboards/kc60/keymaps/sjb/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ enum keymaps_layers {

enum custom_keycodes {
PLACE_HOLDER = 0, // can always be here
FLSH,
VRSN,
KDBG,
CMD,
BROWSER,
TSKSWCH,
EDITOR,
ALTTAP,
};


Expand All @@ -111,7 +110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
OSL_NAV, OSM_MEH, TD(10), MT_SPC, KC_NO, TD_LGUI, OSM_HYPR, OSL_FNx, TD_TSKSWCH \
),
[FNx] = KEYMAP(
M(FLSH), KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MYCM, F_TERM, KC_CALC, KC_WSCH, KC_MAIL, F_BROWSER, M(EDITOR), KC_DELT, \
RESET, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MYCM, F_TERM, KC_CALC, KC_WSCH, KC_MAIL, F_BROWSER, M(EDITOR), KC_DELT, \
F_MAX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PWR, \
KC_TRNS, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_TRNS, KC_NO, KC_TRNS, \
KC_TRNS, KC_NO, KC_TILD, KC_GRV, KC_PIPE, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQUAL,KC_MINS, KC_UNDS, KC_NO, KC_NO, KC_TRNS, \
Expand All @@ -120,7 +119,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
[NAV] = KEYMAP(
M(VRSN), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, \
KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, KC_NO, KC_NO, KC_NO, KC_INS, KC_NO, KC_PSCR, KC_NO, KC_NO, KC_TRNS, \
KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, KC_NO, KC_NO, KC_NO, KC_INS, KC_NO, KC_PSCR, KC_NO, KC_NO, M(CMD), \
KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, TD_LEFT, KC_UP, KC_DOWN, TD_RGHT, KC_HOME, KC_PGUP, KC_NO, KC_TRNS, \
KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_END, KC_PGDN, KC_NO, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
Expand Down Expand Up @@ -163,14 +162,16 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
break;
case FLSH:
case KDBG:
if (record->event.pressed) { // For resetting EEPROM
reset_keyboard();
debug_keyboard = true;
}
break;
case KDBG:
case CMD:
if (record->event.pressed) { // For resetting EEPROM
debug_keyboard = true;
register_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT));
} else {
unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT));
}
break;
case BROWSER:
Expand Down

0 comments on commit 7be82f2

Please sign in to comment.