Redox custom keymap (jeherve): updates to deprecated code and bugfixes (#12738)
Co-authored-by: Drashna Jael're <drashna@live.com>
This commit is contained in:
parent
3efd94014f
commit
6e5e34662b
3 changed files with 165 additions and 145 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2018 Jeremy Herve <jeremy@jeremy.hu>
|
Copyright 2021 Jeremy Herve <jeremy@jeremy.hu>
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -36,3 +36,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define RGBLIGHT_SAT_STEP 8
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
#define RGBLIGHT_VAL_STEP 8
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
#define RGBLIGHT_SLEEP
|
#define RGBLIGHT_SLEEP
|
||||||
|
|
||||||
|
/* Set Unicode mode by default */
|
||||||
|
#define UNICODE_SELECTED_MODES UC_MAC
|
||||||
|
|
||||||
|
/* Custom startup sound */
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
# define STARTUP_SONG SONG(ZELDA_PUZZLE)
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,6 +1,21 @@
|
||||||
#include QMK_KEYBOARD_H
|
/*
|
||||||
|
Copyright 2021 Jeremy Herve <jeremy@jeremy.hu>
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
// 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.
|
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||||
|
@ -12,6 +27,11 @@ extern keymap_config_t keymap_config;
|
||||||
#define _INTER 3
|
#define _INTER 3
|
||||||
#define _ADJUST 4
|
#define _ADJUST 4
|
||||||
|
|
||||||
|
// Define song.
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
float tone_zelda[][2] = SONG(ZELDA_TREASURE);
|
||||||
|
#endif
|
||||||
|
|
||||||
enum custom_keycodes {
|
enum custom_keycodes {
|
||||||
COLEMAK = SAFE_RANGE,
|
COLEMAK = SAFE_RANGE,
|
||||||
SYMB,
|
SYMB,
|
||||||
|
@ -25,7 +45,6 @@ enum custom_keycodes {
|
||||||
WAVE,
|
WAVE,
|
||||||
YOSHI,
|
YOSHI,
|
||||||
THUMB_UP,
|
THUMB_UP,
|
||||||
NBSP,
|
|
||||||
INV_1P,
|
INV_1P,
|
||||||
ALFRED
|
ALFRED
|
||||||
};
|
};
|
||||||
|
@ -34,46 +53,43 @@ enum custom_keycodes {
|
||||||
static bool shift_held = false;
|
static bool shift_held = false;
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch(keycode) {
|
switch (keycode) {
|
||||||
case SHRUG:
|
case SHRUG:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
|
send_unicode_string("¯\\_(ツ)_/¯");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case INV_1P:
|
case INV_1P:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
SEND_STRING(SS_DOWN(X_LGUI)SS_DOWN(X_LALT)SS_TAP(X_BSLASH)SS_UP(X_LGUI)SS_UP(X_LALT));
|
SEND_STRING(SS_DOWN(X_LGUI) SS_DOWN(X_LALT) SS_TAP(X_BSLASH) SS_UP(X_LGUI) SS_UP(X_LALT));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case ALFRED:
|
case ALFRED:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_SPACE)SS_UP(X_LALT));
|
SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_SPACE) SS_UP(X_LALT));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case YOSHI:
|
case YOSHI:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_SONG(tone_zelda);
|
||||||
|
#endif
|
||||||
SEND_STRING(":yellow_yoshi:");
|
SEND_STRING(":yellow_yoshi:");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case THUMB_UP:
|
case THUMB_UP:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
SEND_STRING(SS_LALT("D83D+DC4D"));
|
register_unicode(0x1F44D);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case WAVE:
|
case WAVE:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
SEND_STRING(SS_LALT("D83D+DC4B"));
|
register_unicode(0x1F44B);
|
||||||
}
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case NBSP:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
SEND_STRING(" ");
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
@ -128,7 +144,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Shortcut to make keymap more readable
|
// Shortcut to make keymap more readable
|
||||||
#define KC_SYQT LT(_SYMB,KC_QUOT)
|
#define KC_SYQT LT(_SYMB, KC_QUOT)
|
||||||
#define SYM_L MO(_SYMB)
|
#define SYM_L MO(_SYMB)
|
||||||
#define MO_INTR MO(_INTER)
|
#define MO_INTR MO(_INTER)
|
||||||
#define TT_ADJ TT(_ADJUST)
|
#define TT_ADJ TT(_ADJUST)
|
||||||
|
@ -147,6 +163,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
#define UC_0171 UC(0x0171)
|
#define UC_0171 UC(0x0171)
|
||||||
#define UC_00EA UC(0x00EA)
|
#define UC_00EA UC(0x00EA)
|
||||||
#define UC_0151 UC(0x0151)
|
#define UC_0151 UC(0x0151)
|
||||||
|
// Non-breaking space.
|
||||||
|
#define UC_00A0 UC(0x00a0)
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
@ -202,7 +220,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||||
XXXXXXX ,UC_00E2 ,XXXXXXX ,UC_00E7 ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,UC_0171 ,UC_00EA ,XXXXXXX ,UC_0151 ,XXXXXXX ,
|
XXXXXXX ,UC_00E2 ,XXXXXXX ,UC_00E7 ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,UC_0171 ,UC_00EA ,XXXXXXX ,UC_0151 ,XXXXXXX ,
|
||||||
//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
|
//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
|
||||||
_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,NBSP , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______
|
_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,UC_00A0 , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______
|
||||||
//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
|
//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -222,23 +240,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef AUDIO_ENABLE
|
|
||||||
float tone_colemak[][2] = SONG(ZELDA_TREASURE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void persistent_default_layer_set(uint16_t default_layer) {
|
void persistent_default_layer_set(uint16_t default_layer) {
|
||||||
eeconfig_update_default_layer(default_layer);
|
eeconfig_update_default_layer(default_layer);
|
||||||
default_layer_set(default_layer);
|
default_layer_set(default_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set unicode in Mac OS.
|
|
||||||
void eeconfig_init_user(void) {
|
|
||||||
set_unicode_input_mode(UC_OSX);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Change LED colors depending on the layer.
|
// Change LED colors depending on the layer.
|
||||||
uint32_t layer_state_set_user(uint32_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
switch (biton32(state)) {
|
switch (get_highest_layer(state)) {
|
||||||
case _SYMB:
|
case _SYMB:
|
||||||
rgblight_setrgb_orange();
|
rgblight_setrgb_orange();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# A Colemak keymap for the Redox keyboard
|
# A Colemak keymap for the Redox keyboard
|
||||||
|
|
||||||
----
|
----
|
||||||
![jeherve-redox-layout-4](https://user-images.githubusercontent.com/426388/50276398-2664be80-0442-11e9-86b9-fbd0f4275354.png)
|
![jeherve-redox-layout-5](https://user-images.githubusercontent.com/426388/116534030-56f67600-a8e2-11eb-9bf3-3ce5362d717a.png)
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@ -25,6 +25,9 @@ My keymap uses 5 layers:
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
- 2021.04.29
|
||||||
|
- Update code to replace deprecated code.
|
||||||
|
- Fix non-breaking space key.
|
||||||
- 2018.12.20
|
- 2018.12.20
|
||||||
- 2 new Macro keys, to invoke [Alfred](https://www.alfredapp.com/) and [1Password](https://1password.com/).
|
- 2 new Macro keys, to invoke [Alfred](https://www.alfredapp.com/) and [1Password](https://1password.com/).
|
||||||
- No more Right Command key or Expose key, I didn't use those much.
|
- No more Right Command key or Expose key, I didn't use those much.
|
||||||
|
|
Loading…
Reference in a new issue