diff options
| author | Daniel Shields <daniel.shields@bcs.org> | 2019-09-21 19:04:27 +0100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-09-21 11:04:27 -0700 |
| commit | 63a0b1241d204873cd5156a959e913c602b0c386 (patch) | |
| tree | 69ec7c084ed0ef26c50e23017ec32a3e483de679 /users | |
| parent | 75c97477874b9354a90b8b4eca2d3b1ecfc15435 (diff) | |
| download | qmk_firmware-63a0b1241d204873cd5156a959e913c602b0c386.tar.gz qmk_firmware-63a0b1241d204873cd5156a959e913c602b0c386.zip | |
[Keymap] Move common code and configuration to userspace for dshields keymaps. (#6537)
Diffstat (limited to 'users')
| -rw-r--r-- | users/dshields/config.h | 14 | ||||
| -rw-r--r-- | users/dshields/dshields.c | 30 | ||||
| -rw-r--r-- | users/dshields/dshields.h | 31 | ||||
| -rw-r--r-- | users/dshields/rules.mk | 24 |
4 files changed, 99 insertions, 0 deletions
diff --git a/users/dshields/config.h b/users/dshields/config.h new file mode 100644 index 000000000..743f16f99 --- /dev/null +++ b/users/dshields/config.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS | ||
| 4 | #define USB_MAX_POWER_CONSUMPTION 100 | ||
| 5 | #define ONESHOT_TAP_TOGGLE 2 | ||
| 6 | #define ONESHOT_TIMEOUT 3000 | ||
| 7 | #define RETRO_TAPPING | ||
| 8 | |||
| 9 | #define MOUSEKEY_INTERVAL 20 | ||
| 10 | #define MOUSEKEY_DELAY 0 | ||
| 11 | #define MOUSEKEY_TIME_TO_MAX 40 | ||
| 12 | #define MOUSEKEY_MAX_SPEED 7 | ||
| 13 | #define MOUSEKEY_WHEEL_DELAY 0 | ||
| 14 | |||
diff --git a/users/dshields/dshields.c b/users/dshields/dshields.c new file mode 100644 index 000000000..6aff5c671 --- /dev/null +++ b/users/dshields/dshields.c | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | extern keymap_config_t keymap_config; | ||
| 2 | |||
| 3 | /* uncomment to reset | ||
| 4 | void matrix_init_user(void) { | ||
| 5 | eeconfig_init(); | ||
| 6 | }; | ||
| 7 | */ | ||
| 8 | |||
| 9 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 10 | if (!process_record_dynamic_macro(keycode, record)) { | ||
| 11 | return false; | ||
| 12 | } | ||
| 13 | return true; | ||
| 14 | } | ||
| 15 | |||
| 16 | // work in progress | ||
| 17 | uint32_t layer_state_set_user(uint32_t state) { | ||
| 18 | switch (biton32(state)) { | ||
| 19 | case DEF: | ||
| 20 | set_all_leds_to(0,0,0); | ||
| 21 | break; | ||
| 22 | case FUN: | ||
| 23 | // TODO light the fn keys | ||
| 24 | // set_led_to(?, 0, 128, 0); | ||
| 25 | // set_led_to(?, 0, 128, 0); | ||
| 26 | break; | ||
| 27 | } | ||
| 28 | return state; | ||
| 29 | } | ||
| 30 | |||
diff --git a/users/dshields/dshields.h b/users/dshields/dshields.h new file mode 100644 index 000000000..c746e74fb --- /dev/null +++ b/users/dshields/dshields.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | // dynamic macro keys | ||
| 4 | #define DM_PLAY DYN_MACRO_PLAY1 | ||
| 5 | #define DM_STRT DYN_REC_START1 | ||
| 6 | #define DM_STOP DYN_REC_STOP | ||
| 7 | |||
| 8 | // one-shot layer keys | ||
| 9 | #define OSL_RSE OSL(RSE) | ||
| 10 | #define OSL_LWR OSL(LWR) | ||
| 11 | #define OSL_FUN OSL(FUN) | ||
| 12 | |||
| 13 | // one-shot modifier keys | ||
| 14 | #define OSMLCTL OSM(MOD_LCTL) | ||
| 15 | #define OSMRCTL OSM(MOD_RCTL) | ||
| 16 | #define OSMLALT OSM(MOD_LALT) | ||
| 17 | #define OSMRALT OSM(MOD_RALT) | ||
| 18 | #define OSMLSFT OSM(MOD_LSFT) | ||
| 19 | #define OSMRSFT OSM(MOD_RSFT) | ||
| 20 | |||
| 21 | // mod-tap keys | ||
| 22 | #define MT_SPC SFT_T(KC_SPC) | ||
| 23 | |||
| 24 | #ifdef KEYBOARD_planck_light | ||
| 25 | #define LGT_TOG RGB_TOG | ||
| 26 | #define LGT_MOD RGB_MOD | ||
| 27 | #else | ||
| 28 | #define LGT_TOG BL_TOGG | ||
| 29 | #define LGT_MOD BL_STEP | ||
| 30 | #endif | ||
| 31 | |||
diff --git a/users/dshields/rules.mk b/users/dshields/rules.mk new file mode 100644 index 000000000..a2bec4335 --- /dev/null +++ b/users/dshields/rules.mk | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 2 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 3 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 4 | EXTRAKEY_ENABLE = no | ||
| 5 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 6 | API_SYSEX_ENABLE = no | ||
| 7 | |||
| 8 | ifeq ($(strip $(KEYBOARD)), planck/rev3) | ||
| 9 | AUDIO_ENABLE = no | ||
| 10 | BACKLIGHT_ENABLE = yes | ||
| 11 | RGB_MATRIX_ENABLE = no | ||
| 12 | endif | ||
| 13 | ifeq ($(strip $(KEYBOARD)), planck/rev6) | ||
| 14 | EXTRALDFLAGS = -Wl,--build-id=none | ||
| 15 | AUDIO_ENABLE = no | ||
| 16 | BACKLIGHT_ENABLE = no | ||
| 17 | RGB_MATRIX_ENABLE = no | ||
| 18 | endif | ||
| 19 | ifeq ($(strip $(KEYBOARD)), planck/light) | ||
| 20 | AUDIO_ENABLE = yes | ||
| 21 | BACKLIGHT_ENABLE = no | ||
| 22 | RGB_MATRIX_ENABLE = yes | ||
| 23 | endif | ||
| 24 | |||
