diff options
| author | Joel Challis <git@zvecr.com> | 2020-05-01 17:59:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-01 17:59:22 +0100 |
| commit | f7324ec68494026c27b9c4af4b34bf4a98d2c75b (patch) | |
| tree | ce303538e8eed3d667ef5097eb7b279ad3030e77 /keyboards/xd002/keymaps | |
| parent | 750c7c2bdbfb4b4e9d3a9efe6cb3f95ef0b43c53 (diff) | |
| download | qmk_firmware-f7324ec68494026c27b9c4af4b34bf4a98d2c75b.tar.gz qmk_firmware-f7324ec68494026c27b9c4af4b34bf4a98d2c75b.zip | |
Add xd002 support (#8598)
* Add xd002 support
* tidy some whitespace
* align filename
* Update keyboards/xd002/info.json
Co-authored-by: Erovia <Erovia@users.noreply.github.com>
Co-authored-by: Erovia <Erovia@users.noreply.github.com>
Diffstat (limited to 'keyboards/xd002/keymaps')
| -rw-r--r-- | keyboards/xd002/keymaps/default/keymap.c | 7 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/rgb/keymap.c | 46 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/rgb/rules.mk | 1 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/rgb_lite/keymap.c | 31 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/rgb_lite/rgblite.h | 26 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/rgb_lite/rules.mk | 1 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/tap_dance/config.h | 3 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/tap_dance/keymap.c | 19 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/tap_dance/rules.mk | 1 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/volume/keymap.c | 7 | ||||
| -rw-r--r-- | keyboards/xd002/keymaps/volume/rules.mk | 1 |
11 files changed, 143 insertions, 0 deletions
diff --git a/keyboards/xd002/keymaps/default/keymap.c b/keyboards/xd002/keymaps/default/keymap.c new file mode 100644 index 000000000..ae53d396d --- /dev/null +++ b/keyboards/xd002/keymaps/default/keymap.c | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 4 | [0] = LAYOUT( | ||
| 5 | KC_A, KC_B | ||
| 6 | ) | ||
| 7 | }; | ||
diff --git a/keyboards/xd002/keymaps/rgb/keymap.c b/keyboards/xd002/keymaps/rgb/keymap.c new file mode 100644 index 000000000..af0473413 --- /dev/null +++ b/keyboards/xd002/keymaps/rgb/keymap.c | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | // Defines the keycodes used by our macros in process_record_user | ||
| 4 | enum custom_keycodes { | ||
| 5 | QMKURL = SAFE_RANGE, | ||
| 6 | }; | ||
| 7 | |||
| 8 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 9 | [0] = LAYOUT( | ||
| 10 | RGB_HUI, QMKURL | ||
| 11 | ) | ||
| 12 | }; | ||
| 13 | |||
| 14 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 15 | if (record->event.pressed) { | ||
| 16 | switch (keycode) { | ||
| 17 | case QMKURL: | ||
| 18 | // Using SEND_STRING here adds 400bytes ... | ||
| 19 | // SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); | ||
| 20 | tap_code(KC_H); | ||
| 21 | tap_code(KC_T); | ||
| 22 | tap_code(KC_T); | ||
| 23 | tap_code(KC_P); | ||
| 24 | tap_code(KC_S); | ||
| 25 | tap_code16(KC_COLON); | ||
| 26 | tap_code(KC_SLASH); | ||
| 27 | tap_code(KC_SLASH); | ||
| 28 | tap_code(KC_Q); | ||
| 29 | tap_code(KC_M); | ||
| 30 | tap_code(KC_K); | ||
| 31 | tap_code(KC_DOT); | ||
| 32 | tap_code(KC_F); | ||
| 33 | tap_code(KC_M); | ||
| 34 | tap_code(KC_SLASH); | ||
| 35 | tap_code(KC_ENTER); | ||
| 36 | break; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | return true; | ||
| 40 | } | ||
| 41 | |||
| 42 | void keyboard_post_init_user(void) { | ||
| 43 | rgblight_enable_noeeprom(); // enables Rgb, without saving settings | ||
| 44 | rgblight_sethsv_noeeprom(180, 255, 255); // sets the color to teal/cyan without saving | ||
| 45 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // sets mode to Fast breathing without saving | ||
| 46 | } | ||
diff --git a/keyboards/xd002/keymaps/rgb/rules.mk b/keyboards/xd002/keymaps/rgb/rules.mk new file mode 100644 index 000000000..1e3cebb14 --- /dev/null +++ b/keyboards/xd002/keymaps/rgb/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| RGBLIGHT_ENABLE = yes | |||
diff --git a/keyboards/xd002/keymaps/rgb_lite/keymap.c b/keyboards/xd002/keymaps/rgb_lite/keymap.c new file mode 100644 index 000000000..ed9185e3b --- /dev/null +++ b/keyboards/xd002/keymaps/rgb_lite/keymap.c | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | #include "rgblite.h" | ||
| 3 | |||
| 4 | // Defines the keycodes used by our macros in process_record_user | ||
| 5 | enum custom_keycodes { | ||
| 6 | QMKURL = SAFE_RANGE, | ||
| 7 | }; | ||
| 8 | |||
| 9 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 10 | [0] = LAYOUT( | ||
| 11 | RGB_HUI, QMKURL | ||
| 12 | ) | ||
| 13 | }; | ||
| 14 | |||
| 15 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 16 | if (record->event.pressed) { | ||
| 17 | switch (keycode) { | ||
| 18 | case RGB_HUI: | ||
| 19 | rgblight_increase_hue(); | ||
| 20 | break; | ||
| 21 | case QMKURL: | ||
| 22 | SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); | ||
| 23 | break; | ||
| 24 | } | ||
| 25 | } | ||
| 26 | return true; | ||
| 27 | } | ||
| 28 | |||
| 29 | void keyboard_post_init_user(void) { | ||
| 30 | rgblight_increase_hue(); | ||
| 31 | } | ||
diff --git a/keyboards/xd002/keymaps/rgb_lite/rgblite.h b/keyboards/xd002/keymaps/rgb_lite/rgblite.h new file mode 100644 index 000000000..ca98484b8 --- /dev/null +++ b/keyboards/xd002/keymaps/rgb_lite/rgblite.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "ws2812.h" | ||
| 4 | #include "rgblight_list.h" | ||
| 5 | |||
| 6 | static inline void rgblight_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) { | ||
| 7 | LED_TYPE leds[RGBLED_NUM] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}}; | ||
| 8 | ws2812_setleds(leds, RGBLED_NUM); | ||
| 9 | } | ||
| 10 | |||
| 11 | static void rgblight_increase_hue(void) { | ||
| 12 | static uint8_t state = 0; | ||
| 13 | |||
| 14 | state = (state + 1) % 3; | ||
| 15 | switch (state) { | ||
| 16 | case 1: | ||
| 17 | rgblight_setrgb_red(); | ||
| 18 | break; | ||
| 19 | case 2: | ||
| 20 | rgblight_setrgb_blue(); | ||
| 21 | break; | ||
| 22 | default: | ||
| 23 | rgblight_setrgb_green(); | ||
| 24 | break; | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/keyboards/xd002/keymaps/rgb_lite/rules.mk b/keyboards/xd002/keymaps/rgb_lite/rules.mk new file mode 100644 index 000000000..227bbcae3 --- /dev/null +++ b/keyboards/xd002/keymaps/rgb_lite/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| SRC += ws2812.c | |||
diff --git a/keyboards/xd002/keymaps/tap_dance/config.h b/keyboards/xd002/keymaps/tap_dance/config.h new file mode 100644 index 000000000..b86e862d3 --- /dev/null +++ b/keyboards/xd002/keymaps/tap_dance/config.h | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #define TAPPING_TERM 500 | ||
diff --git a/keyboards/xd002/keymaps/tap_dance/keymap.c b/keyboards/xd002/keymaps/tap_dance/keymap.c new file mode 100644 index 000000000..0f384ce99 --- /dev/null +++ b/keyboards/xd002/keymaps/tap_dance/keymap.c | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | enum layers { | ||
| 4 | _BASE = 0, | ||
| 5 | }; | ||
| 6 | |||
| 7 | enum { | ||
| 8 | TD_BC = 0 | ||
| 9 | }; | ||
| 10 | |||
| 11 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 12 | [TD_BC] = ACTION_TAP_DANCE_DOUBLE(KC_B, KC_C) | ||
| 13 | }; | ||
| 14 | |||
| 15 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 16 | [_BASE] = LAYOUT( | ||
| 17 | KC_A, TD(TD_BC) | ||
| 18 | ) | ||
| 19 | }; | ||
diff --git a/keyboards/xd002/keymaps/tap_dance/rules.mk b/keyboards/xd002/keymaps/tap_dance/rules.mk new file mode 100644 index 000000000..e5ddcae8d --- /dev/null +++ b/keyboards/xd002/keymaps/tap_dance/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| TAP_DANCE_ENABLE = yes | |||
diff --git a/keyboards/xd002/keymaps/volume/keymap.c b/keyboards/xd002/keymaps/volume/keymap.c new file mode 100644 index 000000000..2365d7b24 --- /dev/null +++ b/keyboards/xd002/keymaps/volume/keymap.c | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 4 | [0] = LAYOUT( | ||
| 5 | KC_VOLU, KC_VOLD | ||
| 6 | ) | ||
| 7 | }; | ||
diff --git a/keyboards/xd002/keymaps/volume/rules.mk b/keyboards/xd002/keymaps/volume/rules.mk new file mode 100644 index 000000000..fcfd2225b --- /dev/null +++ b/keyboards/xd002/keymaps/volume/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| EXTRAKEY_ENABLE = yes | |||
