diff options
| author | Viktor Eikman <viktor.eikman@gmail.com> | 2019-06-06 22:15:19 +0200 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-06-06 13:15:19 -0700 |
| commit | 983613c88d69501b184c52b08ea6a3a7d3f149f8 (patch) | |
| tree | 76b4f8f5fdcf1730bc772d49cf1c9b72d07193a5 | |
| parent | 29c7fa6efc48385445673a77ec58e880746e6524 (diff) | |
| download | qmk_firmware-983613c88d69501b184c52b08ea6a3a7d3f149f8.tar.gz qmk_firmware-983613c88d69501b184c52b08ea6a3a7d3f149f8.zip | |
[Keyboard] Added DMOTE (#6087)
* Added DMOTE as a variant of the Dactyl-ManuForm, with slight changes to
prior code organization to reflect differences.
15 files changed, 304 insertions, 10 deletions
diff --git a/keyboards/handwired/dactyl_manuform/4x5/config.h b/keyboards/handwired/dactyl_manuform/4x5/config.h index c8417a2f0..1f24c9aca 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/config.h +++ b/keyboards/handwired/dactyl_manuform/4x5/config.h | |||
| @@ -40,7 +40,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 40 | /* define if matrix has ghost */ | 40 | /* define if matrix has ghost */ |
| 41 | //#define MATRIX_HAS_GHOST | 41 | //#define MATRIX_HAS_GHOST |
| 42 | 42 | ||
| 43 | // WS2812 RGB LED strip input and number of LEDs | ||
| 44 | #define RGB_DI_PIN D3 | ||
| 45 | #define RGBLED_NUM 12 | ||
| 46 | |||
| 43 | /* number of backlight levels */ | 47 | /* number of backlight levels */ |
| 44 | // #define BACKLIGHT_LEVELS 3 | 48 | // #define BACKLIGHT_LEVELS 3 |
| 45 | |||
| 46 | |||
diff --git a/keyboards/handwired/dactyl_manuform/4x6/config.h b/keyboards/handwired/dactyl_manuform/4x6/config.h index d4a192287..a9ad1a36d 100644 --- a/keyboards/handwired/dactyl_manuform/4x6/config.h +++ b/keyboards/handwired/dactyl_manuform/4x6/config.h | |||
| @@ -38,3 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 38 | 38 | ||
| 39 | /* COL2ROW or ROW2COL */ | 39 | /* COL2ROW or ROW2COL */ |
| 40 | #define DIODE_DIRECTION COL2ROW | 40 | #define DIODE_DIRECTION COL2ROW |
| 41 | |||
| 42 | // WS2812 RGB LED strip input and number of LEDs | ||
| 43 | #define RGB_DI_PIN D3 | ||
| 44 | #define RGBLED_NUM 12 | ||
diff --git a/keyboards/handwired/dactyl_manuform/5x6/config.h b/keyboards/handwired/dactyl_manuform/5x6/config.h index 06ac02dfc..413039449 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/config.h +++ b/keyboards/handwired/dactyl_manuform/5x6/config.h | |||
| @@ -32,10 +32,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 32 | #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } | 32 | #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } |
| 33 | #define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } | 33 | #define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } |
| 34 | 34 | ||
| 35 | // WS2812 RGB LED strip input and number of LEDs | ||
| 36 | #define RGB_DI_PIN D3 | ||
| 37 | #define RGBLED_NUM 12 | ||
| 35 | 38 | ||
| 36 | /* define if matrix has ghost */ | 39 | /* define if matrix has ghost */ |
| 37 | //#define MATRIX_HAS_GHOST | 40 | //#define MATRIX_HAS_GHOST |
| 38 | 41 | ||
| 39 | /* number of backlight levels */ | 42 | /* number of backlight levels */ |
| 40 | // #define BACKLIGHT_LEVELS 3 | 43 | // #define BACKLIGHT_LEVELS 3 |
| 41 | |||
diff --git a/keyboards/handwired/dactyl_manuform/5x7/config.h b/keyboards/handwired/dactyl_manuform/5x7/config.h index bef48f17e..435837498 100644 --- a/keyboards/handwired/dactyl_manuform/5x7/config.h +++ b/keyboards/handwired/dactyl_manuform/5x7/config.h | |||
| @@ -31,3 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 31 | // wiring of each half | 31 | // wiring of each half |
| 32 | #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } | 32 | #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } |
| 33 | #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } | 33 | #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } |
| 34 | |||
| 35 | // WS2812 RGB LED strip input and number of LEDs | ||
| 36 | #define RGB_DI_PIN D3 | ||
| 37 | #define RGBLED_NUM 12 | ||
diff --git a/keyboards/handwired/dactyl_manuform/6x6/config.h b/keyboards/handwired/dactyl_manuform/6x6/config.h index 9bb7b07bf..9bc501c5e 100644 --- a/keyboards/handwired/dactyl_manuform/6x6/config.h +++ b/keyboards/handwired/dactyl_manuform/6x6/config.h | |||
| @@ -31,3 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 31 | // wiring of each half | 31 | // wiring of each half |
| 32 | #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } | 32 | #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } |
| 33 | #define MATRIX_ROW_PINS { F5, F6, F7, B1, B3, B2, B6 } | 33 | #define MATRIX_ROW_PINS { F5, F6, F7, B1, B3, B2, B6 } |
| 34 | |||
| 35 | // WS2812 RGB LED strip input and number of LEDs | ||
| 36 | #define RGB_DI_PIN D3 | ||
| 37 | #define RGBLED_NUM 12 | ||
diff --git a/keyboards/handwired/dactyl_manuform/config.h b/keyboards/handwired/dactyl_manuform/config.h index 6979821b6..7c95f7058 100644 --- a/keyboards/handwired/dactyl_manuform/config.h +++ b/keyboards/handwired/dactyl_manuform/config.h | |||
| @@ -49,11 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 49 | /* Enables This makes it easier for fast typists to use dual-function keys */ | 49 | /* Enables This makes it easier for fast typists to use dual-function keys */ |
| 50 | #define PERMISSIVE_HOLD | 50 | #define PERMISSIVE_HOLD |
| 51 | 51 | ||
| 52 | /* ws2812 RGB LED */ | ||
| 53 | #define RGB_DI_PIN D3 | ||
| 54 | |||
| 55 | #define RGBLED_NUM 12 // Number of LEDs | ||
| 56 | |||
| 57 | /* | 52 | /* |
| 58 | * Feature disable options | 53 | * Feature disable options |
| 59 | * These options are also useful to firmware size reduction. | 54 | * These options are also useful to firmware size reduction. |
diff --git a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h index eea0757d5..72f2acaab 100644 --- a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h +++ b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h | |||
| @@ -10,6 +10,8 @@ | |||
| 10 | #include "5x7.h" | 10 | #include "5x7.h" |
| 11 | #elif KEYBOARD_handwired_dactyl_manuform_6x6 | 11 | #elif KEYBOARD_handwired_dactyl_manuform_6x6 |
| 12 | #include "6x6.h" | 12 | #include "6x6.h" |
| 13 | #elif KEYBOARD_handwired_dactyl_manuform_dmote_62key | ||
| 14 | #include "62key.h" | ||
| 13 | #endif | 15 | #endif |
| 14 | 16 | ||
| 15 | //void promicro_bootloader_jmp(bool program); | 17 | //void promicro_bootloader_jmp(bool program); |
| @@ -23,5 +25,3 @@ | |||
| 23 | #include <avr/interrupt.h> | 25 | #include <avr/interrupt.h> |
| 24 | #endif | 26 | #endif |
| 25 | #endif | 27 | #endif |
| 26 | |||
| 27 | |||
diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/62key.c b/keyboards/handwired/dactyl_manuform/dmote/62key/62key.c new file mode 100644 index 000000000..e5d444277 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/62key.c | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #include "62key.h" | ||
| 2 | |||
| 3 | void matrix_init_kb(void) { | ||
| 4 | matrix_init_user(); | ||
| 5 | }; | ||
diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/62key.h b/keyboards/handwired/dactyl_manuform/dmote/62key/62key.h new file mode 100644 index 000000000..273410165 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/62key.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "dactyl_manuform.h" | ||
| 4 | #include "quantum.h" | ||
| 5 | |||
| 6 | #ifdef USE_I2C | ||
| 7 | #include <stddef.h> | ||
| 8 | #ifdef __AVR__ | ||
| 9 | #include <avr/io.h> | ||
| 10 | #include <avr/interrupt.h> | ||
| 11 | #endif | ||
| 12 | #endif | ||
| 13 | |||
| 14 | // This uses the same coordinate system as the program that defines | ||
| 15 | // the case model, but not the same coordinates. | ||
| 16 | // Numbers increase going to the right and away from the user on the | ||
| 17 | // right-hand side of the keyboard. This is mirrored for the | ||
| 18 | // left-hand side. | ||
| 19 | // The matrix is constructed for ease of soldering, with the columns | ||
| 20 | // of the thumb cluster extending along the sides of the finger | ||
| 21 | // cluster so that everything can be contained in a 6x6 pattern. | ||
| 22 | |||
| 23 | #define LAYOUT_62key( \ | ||
| 24 | LA_20, LA_10, LF_35, LF_25, LF_15, LF_05, \ | ||
| 25 | LF_55, LF_45, LF_34, LF_24, LF_14, LF_04, \ | ||
| 26 | LF_54, LF_44, LF_33, LF_23, LF_13, LF_03, \ | ||
| 27 | LF_53, LF_43, LF_32, LF_22, LF_12, \ | ||
| 28 | LF_21, LT_21, LT_22, \ | ||
| 29 | LT_10, LT_11, LT_12, \ | ||
| 30 | LT_01, LT_02, \ | ||
| 31 | \ | ||
| 32 | RF_05, RF_15, RF_25, RF_35, RA_10, RA_20, \ | ||
| 33 | RF_04, RF_14, RF_24, RF_34, RF_45, RF_55, \ | ||
| 34 | RF_03, RF_13, RF_23, RF_33, RF_44, RF_54, \ | ||
| 35 | RF_12, RF_22, RF_32, RF_43, RF_53, \ | ||
| 36 | RT_22, RT_21, RF_21, \ | ||
| 37 | RT_12, RT_11, RT_10, \ | ||
| 38 | RT_02, RT_01 \ | ||
| 39 | ) \ | ||
| 40 | { \ | ||
| 41 | { LA_20, LA_10, LF_35, LF_25, LF_15, LF_05 }, \ | ||
| 42 | { LF_55, LF_45, LF_34, LF_24, LF_14, LF_04 }, \ | ||
| 43 | { LF_54, LF_44, LF_33, LF_23, LF_13, LF_03 }, \ | ||
| 44 | { LF_53, LF_43, LF_32, LF_22, LF_12, LT_22 }, \ | ||
| 45 | { KC_NO, KC_NO, LT_21, LF_21, LT_11, LT_12 }, \ | ||
| 46 | { KC_NO, KC_NO, LT_10, KC_NO, LT_01, LT_02 }, \ | ||
| 47 | \ | ||
| 48 | { RA_20, RA_10, RF_35, RF_25, RF_15, RF_05 }, \ | ||
| 49 | { RF_55, RF_45, RF_34, RF_24, RF_14, RF_04 }, \ | ||
| 50 | { RF_54, RF_44, RF_33, RF_23, RF_13, RF_03 }, \ | ||
| 51 | { RF_53, RF_43, RF_32, RF_22, RF_12, RT_22 }, \ | ||
| 52 | { KC_NO, KC_NO, RT_21, RF_21, RT_11, RT_12 }, \ | ||
| 53 | { KC_NO, KC_NO, RT_10, KC_NO, RT_01, RT_02 }, \ | ||
| 54 | } | ||
diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/config.h b/keyboards/handwired/dactyl_manuform/dmote/62key/config.h new file mode 100644 index 000000000..7db3ceb75 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/config.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "config_common.h" | ||
| 4 | |||
| 5 | #define PRODUCT DMOTE (62-key) | ||
| 6 | #define MATRIX_ROWS 12 | ||
| 7 | #define MATRIX_COLS 6 | ||
| 8 | |||
| 9 | // MCUs are flipped on each side, relative to the shape of the case, | ||
| 10 | // but for ease of mounting, the pinout is not flipped with the controller. | ||
| 11 | // The same finger on each hand uses a column connected to the pin with the | ||
| 12 | // same silk-screen label on each Pro Micro. | ||
| 13 | |||
| 14 | // Pin use: | ||
| 15 | // | ||
| 16 | // MCU | Silk | DMOTE | ||
| 17 | // -----+------+---------- | ||
| 18 | // D3 | TX0 | | ||
| 19 | // D2 | RX1 | | ||
| 20 | // D1 | 2 | LED strip input (dominant half only) | ||
| 21 | // D0 | 3 | Serial interface between halves | ||
| 22 | // D4 | 4 | Outermost pinky-finger column | ||
| 23 | // C6 | 5 | Column | ||
| 24 | // D7 | 6 | Column | ||
| 25 | // E6 | 7 | Column | ||
| 26 | // B4 | 8 | Column | ||
| 27 | // B5 | 9 | Outermost index-finger column | ||
| 28 | // -----+------+---------- | ||
| 29 | // F4 | A3 | | ||
| 30 | // F5 | A2 | | ||
| 31 | // F6 | A1 | Top row (furthest from user) | ||
| 32 | // F7 | A0 | Row | ||
| 33 | // B1 | 15 | Row | ||
| 34 | // B3 | 14 | Row | ||
| 35 | // B2 | 16 | Row | ||
| 36 | // B6 | 10 | Bottom row (closest to user) | ||
| 37 | #define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } | ||
| 38 | #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } | ||
| 39 | |||
| 40 | // WS2812 RGB LED, normally used to indicate keyboard state: | ||
| 41 | #define RGBLIGHT_EFFECT_KNIGHT | ||
| 42 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | ||
| 43 | #define RGBLIGHT_EFFECT_CHRISTMAS | ||
| 44 | #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 | ||
| 45 | #define RGB_DI_PIN D1 | ||
| 46 | #define RGBLED_NUM 6 // Used when chaining strips | ||
| 47 | #define RGBLED_SPLIT { 3, 3 } // Used when not chaining strips | ||
| 48 | #define ws2812_PORTREG PORTD | ||
| 49 | #define ws2812_DDRREG DDRD | ||
diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/config.h new file mode 100644 index 000000000..2e1d4f8dc --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/config.h | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #define USE_SERIAL | ||
| 4 | |||
| 5 | #define EE_HANDS | ||
diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/keymap.c new file mode 100644 index 000000000..3012d40a1 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/keymaps/default/keymap.c | |||
| @@ -0,0 +1,146 @@ | |||
| 1 | #include "62key.h" | ||
| 2 | #include "rgblight.h" | ||
| 3 | #include <keymap_colemak.h> | ||
| 4 | #include <sendstring_colemak.h> | ||
| 5 | |||
| 6 | extern keymap_config_t keymap_config; | ||
| 7 | |||
| 8 | // Automatic Layer ID: | ||
| 9 | enum layer_names { | ||
| 10 | _QWERTY, // OS-side Colemak. Default. | ||
| 11 | _COLEMAK, // Keyboard-side Colemak. Portability, emergency. | ||
| 12 | _NUMERIC | ||
| 13 | }; | ||
| 14 | |||
| 15 | // Shorthand: | ||
| 16 | #define LAYER_N MO(_NUMERIC) | ||
| 17 | #define LAYER_C TG(_COLEMAK) | ||
| 18 | #define PASTE LSFT(KC_INS) // Terminal-compatible paste. | ||
| 19 | #define SLQ RALT(KC_9) // Single left-side quotation mark (in Colemak). | ||
| 20 | #define SRQ RALT(KC_0) | ||
| 21 | #define EMDASH RALT(LSFT(KC_MINUS)) // Em dash character (in Colemak). | ||
| 22 | #define BK_LCTL CTL_T(KC_LBRACKET) | ||
| 23 | #define BK_RCTL RCTL_T(KC_RBRACKET) | ||
| 24 | // TODO: Mod-tap ALT with a curvilinear brace. | ||
| 25 | // https://github.com/qmk/qmk_firmware/pull/2055 | ||
| 26 | |||
| 27 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 28 | |||
| 29 | [_QWERTY] = LAYOUT_62key( | ||
| 30 | KC_VOLD, KC_VOLU, CM_W, CM_F, CM_P, CM_G, | ||
| 31 | KC_TAB, CM_Q, CM_R, CM_S, CM_T, CM_D, | ||
| 32 | KC_BSPC, CM_A, CM_X, CM_C, CM_V, CM_B, | ||
| 33 | SLQ, CM_Z, KC_HOME, KC_PGUP, KC_END, | ||
| 34 | KC_PGDN, KC_ENT, KC_SPC, | ||
| 35 | KC_LSPO, KC_LGUI, KC_MINS, | ||
| 36 | BK_LCTL, KC_LALT, | ||
| 37 | |||
| 38 | CM_J, CM_L, CM_U, CM_Y, KC_MPLY, KC_MUTE, | ||
| 39 | CM_H, CM_N, CM_E, CM_I, CM_SCLN, KC_BSLS, | ||
| 40 | CM_K, CM_M, KC_COMM, KC_DOT, CM_O, KC_QUOT, | ||
| 41 | KC_LEFT, KC_UP, KC_RGHT, KC_SLSH, SRQ, | ||
| 42 | KC_DEL, KC_ESC, KC_DOWN, | ||
| 43 | KC_EQL, LAYER_N, KC_RSPC, | ||
| 44 | KC_RALT, BK_RCTL | ||
| 45 | ), | ||
| 46 | |||
| 47 | [_COLEMAK] = LAYOUT_62key( | ||
| 48 | _______, _______, KC_W, KC_F, KC_P, KC_G, | ||
| 49 | _______, KC_Q, KC_R, KC_S, KC_T, KC_D, | ||
| 50 | _______, KC_A, KC_X, KC_C, KC_V, KC_B, | ||
| 51 | _______, KC_Z, _______, _______, _______, | ||
| 52 | _______, _______, _______, | ||
| 53 | _______, _______, _______, | ||
| 54 | _______, _______, | ||
| 55 | |||
| 56 | KC_J, KC_L, KC_U, KC_Y, _______, _______, | ||
| 57 | KC_H, KC_N, KC_E, KC_I, KC_SCLN, _______, | ||
| 58 | KC_K, KC_M, _______, _______, KC_O, _______, | ||
| 59 | _______, _______, _______, _______, _______, | ||
| 60 | _______, _______, _______, | ||
| 61 | _______, _______, _______, | ||
| 62 | _______, _______ | ||
| 63 | ), | ||
| 64 | |||
| 65 | [_NUMERIC] = LAYOUT_62key( | ||
| 66 | LAYER_C, KC_INS, KC_F2, KC_F3, KC_F4, KC_F5, | ||
| 67 | KC_F12, KC_F1, KC_2, KC_3, KC_4, KC_5, | ||
| 68 | _______, KC_1, KC_AT, KC_HASH, KC_DLR, KC_PERC, | ||
| 69 | KC_GRV, KC_EXLM, KC_BTN1, KC_WH_U, KC_BTN2, | ||
| 70 | KC_WH_D, RGB_MOD, _______, | ||
| 71 | _______, _______, EMDASH, | ||
| 72 | _______, _______, | ||
| 73 | |||
| 74 | KC_F6, KC_F7, KC_F8, KC_F9, RESET, KC_WAKE, // * | ||
| 75 | KC_6, KC_7, KC_8, KC_9, KC_F10, KC_F11, | ||
| 76 | KC_CIRC, KC_AMPR, KC_ASTR, KC_APP, KC_0, PASTE, | ||
| 77 | KC_MS_L, KC_MS_U, KC_MS_R, KC_PSCR, RGB_TOG, | ||
| 78 | KC_ACL1, KC_ACL2, KC_MS_D, | ||
| 79 | KC_ACL0, _______, _______, | ||
| 80 | _______, _______ | ||
| 81 | ) | ||
| 82 | }; | ||
| 83 | // *KC_WAKE: Used in place of KC_SLEP because X11 with i3 on prerelease | ||
| 84 | // Debian 10 was seeing duplicate keypress and release events for sleep | ||
| 85 | // (regardless of i3 binding), which ruined the function. | ||
| 86 | |||
| 87 | |||
| 88 | /* | ||
| 89 | The rest is all about lighting control. | ||
| 90 | The logic here represents a pretty poor compromise solution between the | ||
| 91 | following concerns: | ||
| 92 | |||
| 93 | - Feedback on active modifiers. | ||
| 94 | - Flexibility: Both sides of the keyboard are interchangeable. | ||
| 95 | - Regular QMK RBG lighting modes. Specifically, Knight and Xmas. | ||
| 96 | |||
| 97 | Currently, the last item suffers, because the first two seem to require | ||
| 98 | calling a function that implements the RGBLIGHT_SPLIT_SET_CHANGE_HSVS macro, | ||
| 99 | which most of the rgblight.c functions do not. In particular, functions that | ||
| 100 | target an individual LED do not do so correctly across the wire, so instead | ||
| 101 | we let HSV vary without ever targeting LEDs. | ||
| 102 | */ | ||
| 103 | |||
| 104 | // How long to wait between animation steps for "Knight" animation: | ||
| 105 | const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {255, 200, 100}; | ||
| 106 | |||
| 107 | bool _initialized = false; | ||
| 108 | bool _leds_dirty = false; | ||
| 109 | |||
| 110 | void modal_leds(void) { | ||
| 111 | uint8_t mods = get_mods(); | ||
| 112 | uint16_t hue = 355; // Rough match to printed case. | ||
| 113 | uint8_t saturation = 255; | ||
| 114 | uint8_t value = 0; | ||
| 115 | if (layer_state_is(_COLEMAK)) { hue -= 50; saturation -= 20; value += 20; }; | ||
| 116 | if (layer_state_is(_NUMERIC)) { value += 30; }; | ||
| 117 | if (mods & MOD_MASK_SHIFT) { saturation -= 20; value += 30; }; | ||
| 118 | if (mods & MOD_MASK_ALT) { hue -= 100; saturation -= 20; value += 30; }; | ||
| 119 | if (mods & MOD_MASK_CTRL) { hue -= 200; saturation -= 20; value += 30; }; | ||
| 120 | // rgblight_sethsv_eeprom_helper is not a great API function but it does | ||
| 121 | // affect both halves of a split keyboard. | ||
| 122 | rgblight_sethsv_eeprom_helper(hue, saturation, value, false); | ||
| 123 | _leds_dirty = false; | ||
| 124 | } | ||
| 125 | |||
| 126 | void matrix_init_user(void) { | ||
| 127 | } | ||
| 128 | |||
| 129 | void matrix_scan_user(void) { | ||
| 130 | if (_leds_dirty) { modal_leds(); }; | ||
| 131 | } | ||
| 132 | |||
| 133 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 134 | if (!_initialized) { | ||
| 135 | // Static lighting is amenable to customization. | ||
| 136 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 137 | _initialized = true; | ||
| 138 | }; | ||
| 139 | if (keycode == KC_WAKE) { | ||
| 140 | // Turn the lights off before going to sleep. | ||
| 141 | rgblight_sethsv_eeprom_helper(0, 0, 0, false); | ||
| 142 | } else { | ||
| 143 | _leds_dirty = true; | ||
| 144 | }; | ||
| 145 | return true; | ||
| 146 | } | ||
diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/rules.mk b/keyboards/handwired/dactyl_manuform/dmote/62key/rules.mk new file mode 100644 index 000000000..28d0bfb5c --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/rules.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # Build-process overrides for the DMOTE. | ||
| 2 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 3 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 4 | RGBLIGHT_ENABLE = yes # Needed for the C linker with lighting control. | ||
| 5 | COMMAND_ENABLE = no # Not a good combo with Space Cadet shift. | ||
diff --git a/keyboards/handwired/dactyl_manuform/dmote/config.h b/keyboards/handwired/dactyl_manuform/dmote/config.h new file mode 100644 index 000000000..b8c5759db --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/config.h | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "config_common.h" | ||
diff --git a/keyboards/handwired/dactyl_manuform/dmote/readme.md b/keyboards/handwired/dactyl_manuform/dmote/readme.md new file mode 100644 index 000000000..7aff2df52 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dmote/readme.md | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | DMOTE | ||
| 2 | ====== | ||
| 3 | |||
| 4 | The “Dactyl-ManuForm: Opposable Thumb Edition” is made from a Clojure | ||
| 5 | application maintained [here](https://github.com/veikman/dactyl-keyboard). | ||
| 6 | The application supports varied physical layouts and therefore matrices. | ||
| 7 | This physical variability is its main feature; its QMK firmware is ordinary. | ||
| 8 | |||
| 9 | Consult the general [Dactyl-ManuForm readme](../readme.md). | ||
| 10 | |||
| 11 | ## The `62key` layout | ||
| 12 | |||
| 13 | This folder represents the default build target of the Clojure application | ||
| 14 | as of its version 0.4.0. The default keymap for this layout has a QWERTY base | ||
| 15 | layer but is intended for running Colemak on the OS side with the i3 tiling | ||
| 16 | window manager. It’s also got a layer that forces Colemak from the QMK side. | ||
