diff options
Diffstat (limited to 'keyboards/ergodox')
18 files changed, 1273 insertions, 71 deletions
diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h index 994a8c6433..2091999bb3 100644 --- a/keyboards/ergodox/config.h +++ b/keyboards/ergodox/config.h @@ -3,8 +3,8 @@ #define MOUSEKEY_INTERVAL 20 #define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 5 -#define MOUSEKEY_MAX_SPEED 2 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 #define MOUSEKEY_WHEEL_DELAY 0 #define TAPPING_TOGGLE 1 diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index a3347de45e..cc8aa3d40e 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -58,7 +58,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGBW 1 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 +#define DEBOUNCE 15 + +#define PREVENT_STUCK_MODIFIERS #define USB_MAX_POWER_CONSUMPTION 500 diff --git a/keyboards/ergodox/ez/matrix.c b/keyboards/ergodox/ez/matrix.c index 43f5152591..21b60a542e 100644 --- a/keyboards/ergodox/ez/matrix.c +++ b/keyboards/ergodox/ez/matrix.c @@ -53,11 +53,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef DEBOUNCE # define DEBOUNCE 5 #endif -static uint8_t debouncing = DEBOUNCE; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +// Debouncing: store for each key the number of scans until it's eligible to +// change. When scanning the matrix, ignore any changes in keys that have +// already changed in the last DEBOUNCE scans. +static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; static matrix_row_t read_cols(uint8_t row); static void init_cols(void); @@ -113,7 +116,9 @@ void matrix_init(void) // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix[i] = 0; - matrix_debouncing[i] = 0; + for (uint8_t j=0; j < MATRIX_COLS; ++j) { + debounce_matrix[i * MATRIX_COLS + j] = 0; + } } #ifdef DEBUG_MATRIX_SCAN_RATE @@ -134,14 +139,36 @@ void matrix_power_up(void) { // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix[i] = 0; - matrix_debouncing[i] = 0; } #ifdef DEBUG_MATRIX_SCAN_RATE matrix_timer = timer_read32(); matrix_scan_count = 0; #endif +} + +// Returns a matrix_row_t whose bits are set if the corresponding key should be +// eligible to change in this scan. +matrix_row_t debounce_mask(uint8_t row) { + matrix_row_t result = 0; + for (uint8_t j=0; j < MATRIX_COLS; ++j) { + if (debounce_matrix[row * MATRIX_COLS + j]) { + --debounce_matrix[row * MATRIX_COLS + j]; + } else { + result |= (1 << j); + } + } + return result; +} +// Report changed keys in the given row. Resets the debounce countdowns +// corresponding to each set bit in 'change' to DEBOUNCE. +void debounce_report(matrix_row_t change, uint8_t row) { + for (uint8_t i = 0; i < MATRIX_COLS; ++i) { + if (change & (1 << i)) { + debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; + } + } } uint8_t matrix_scan(void) @@ -178,26 +205,12 @@ uint8_t matrix_scan(void) for (uint8_t i = 0; i < MATRIX_ROWS; i++) { select_row(i); wait_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(i); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } + matrix_row_t mask = debounce_mask(i); + matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask); + debounce_report(cols ^ matrix[i], i); + matrix[i] = cols; - if (debouncing) { - if (--debouncing) { - wait_us(1); - // this should be wait_ms(1) but has been left as-is at EZ's request - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } + unselect_rows(); } matrix_scan_quantum(); @@ -205,9 +218,8 @@ uint8_t matrix_scan(void) return 1; } -bool matrix_is_modified(void) +bool matrix_is_modified(void) // deprecated and evidently not called. { - if (debouncing) return false; return true; } diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h index e8c17e6e33..9650ffb440 100644 --- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h @@ -75,7 +75,7 @@ static GFXINLINE void init_board(GDisplay *g) { palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); palSetPadModeRaw(MOSI, ST7565_SPI_MODE); palSetPadModeRaw(SLCK, ST7565_SPI_MODE); - palSetPadModeRaw(SS, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadModeNamed(SS, PAL_MODE_OUTPUT_PUSHPULL); spiInit(); spiStart(&SPID1, &spi1config); diff --git a/keyboards/ergodox/keymaps/333fred/Makefile b/keyboards/ergodox/keymaps/333fred/Makefile new file mode 100644 index 0000000000..87985bda19 --- /dev/null +++ b/keyboards/ergodox/keymaps/333fred/Makefile @@ -0,0 +1,12 @@ +SUBPROJECT_DEFAULT = infinity +LCD_BACKLIGHT_ENABLE = yes +LCD_ENABLE = yes +LED_ENABLE = yes +BACKLIGHT_ENABLE = yes +NKRO_ENABLE = yes +TAP_DANCE_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + diff --git a/keyboards/ergodox/keymaps/333fred/README.md b/keyboards/ergodox/keymaps/333fred/README.md new file mode 100644 index 0000000000..af8042d859 --- /dev/null +++ b/keyboards/ergodox/keymaps/333fred/README.md @@ -0,0 +1,122 @@ +## Layout + +### Keymap 0: Basic layer +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| TAB | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L |; / : | ' | +|--------+------+------+------+------+------| L1 | |TT(3) |------+------+------+------+------+--------| +| LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | Home | End | | Alt |Ctrl/Esc| + ,------|------|------| |------+--------+------. + | | | PgUp | | PgDn | | | + | Bcksp|OSL(2)|------| |------| Ent |Space | + | | | Del | |OSL(2)| | | + `--------------------' `----------------------' +``` +* Double-click `;` to get a `:` +* Press-and-hold `f` to go to the movement layer + +### Keymap 1: Code Layer +``` +,--------------------------------------------------. ,--------------------------------------------------. +| | | | | | | | | | | | | | | | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| | | | | | | F10 | | F11 | | | | | | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | | | |------| |------| | | | | | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | | | | | | | | | | | | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,---------------. + |Format| | | Test | DTest | + ,------|------|------| |------+--------+------. + | | |Refact| | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `----------------------' +``` +* Format - Visual Studio Format. Sends `CTRL + K, CTRL + D` +* Refact - Visual Studio Refactor. Sends `CTRL + R, R` +* Test - Visual Studio Run Test. Sends `CTRL + R, T` +* DTest - Visual Studio Debug Test. Sends `CTRL + R, CTRL + T` + +### Keymap 2: Symbol Layer +``` +,---------------------------------------------------. ,--------------------------------------------------. +|Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | +|---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| +| | ! | @ | ( | ) | | | | | | Up | 7 | 8 | 9 | * | F12 | +|---------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | # | $ | { | } | ` |------| |------| Down | 4 | 5 | 6 | + | | +|---------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | +`---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | EPRM | | | | | | 0 | 0 | . | = | | + `-----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | Caps | | | | + ,------|------|------| |------+------+------. + | | |APscr | | | | | + | | |------| |------| | | + | | | PScr | | | | | + `--------------------' `--------------------' +``` +* APscr - Take a printscreen of the current app. Sends `Alt + Print Screen` + +### Keymap 3: Media and Mouse Keys +``` +,--------------------------------------------------. ,--------------------------------------------------. +| | | | | | | | | | | | | | | | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| | | | MsUp | | | | | | | | | | | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | | | | | | | | | | | | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | Lclk | Rclk | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | Vol+ | | + ,------|------|------| |------+------+------. + | | | | | Vol- | | | + | | |------| |------| PL/PS| Next | + | | | | | Back | | | + `--------------------' `--------------------' +``` + +### Keymap 4: Movement +``` +,--------------------------------------------------. ,--------------------------------------------------. +| | | | | | | | | | | | | | | | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| | | | | | | | | | | | | | | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| |DLeft |DRight|LShift| | |------| |------| Left | Down | Up | Right| | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| |KOpen |KType | | | | | | | | | | | | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | CTRL |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` +* DLeft - Move to the left Desktop. Sends `Ctrl + Win + Left Arrow` +* DRight - Move to the right Desktop. Sends `Ctrl + Win + Right Arrow` +* KOpen - Opens KeePass. Sends `Ctrl + Alt + k` +* KType - Autotypes KeePass password. Sends `Ctrl + Alt + a` diff --git a/keyboards/ergodox/keymaps/333fred/keymap.c b/keyboards/ergodox/keymaps/333fred/keymap.c new file mode 100644 index 0000000000..070ad1f72a --- /dev/null +++ b/keyboards/ergodox/keymaps/333fred/keymap.c @@ -0,0 +1,361 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "version.h" + +#define BASE 0 // default layer +#define CODE 1 // code layer +#define SYMB 2 // symbols +#define MDIA 3 // media keys +#define MOVE 4 // movement layer + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, +}; + +enum custom_macros { + VERSION, + EEPROM, + + // Windows macros + DLEFT, + DRIGHT, + PSCREEN_APP, + + // VS Macros + REFACTOR, + TEST, + DEBUG_TEST, + FORMAT, + + // KeePass macros + KEEPASS_OPEN, + KEEPASS_TYPE, +}; + +// Tap Dance Definitions +enum tap_dance_custom_keys { + TD_SEMICOLON_COLON = 0 +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SEMICOLON_COLON] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLON) +}; + +// NOTE: Cells marked with ACCESS must remain transparent, they're the keys that actually get to that layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L |; / : | ' | + * |--------+------+------+------+------+------| L1 | |MO(3) |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Home | End | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | PgUp | | PgDn | | | + * | Bcksp|OSL(2)|------| |------| Ent |Space | + * | | | Del | |OSL(2)| | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_ESC, KC_A, KC_S, KC_D, LT(MOVE, KC_F),KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(CODE), + KC_LCTRL, KC_F4, KC_F5, KC_LGUI,KC_LALT, + KC_HOME, KC_END, + KC_PGUP, + KC_BSPC,OSL(SYMB),KC_DEL, + // right hand + TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, TD(TD_SEMICOLON_COLON),KC_QUOT, + MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI, + KC_RALT, CTL_T(KC_ESC), + KC_PGDN, + OSL(SYMB),KC_ENT, KC_SPC + ), +/* Keymap 1: Code Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | |ACCESS| | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | F10 | | F11 | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | | | | | + * |--------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * |Format| | | Test | DTest | + * ,------|------|------| |------+--------+------. + * | | |Refact| | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[CODE] = KEYMAP( // layer 1 : code + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + M(FORMAT), KC_TRNS, + M(REFACTOR), + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + M(TEST), M(DEBUG_TEST), + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), +/* Keymap 2: Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | ( | ) | | |ACCESS| |ACCESS| Up | 7 | 8 | 9 | * | F12 | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | { | } | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EPRM | | | | | | 0 | 0 | . | = | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | Caps | | | | + * ,------|------|------| |------+------+------. + * | | |APScr | | | | | + * | |ACCESS|------| |------| | | + * | | | PScr | |ACCESS| | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LPRN,KC_RPRN,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LCBR,KC_RCBR,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_CAPS, + M(PSCREEN_APP), + KC_TRNS,KC_TRNS,KC_PSCR, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 3: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | + * |--------+------+------+------+------+------| | |ACCESS|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | Vol+ | | + * ,------|------|------| |------+------+------. + * | | | | | Vol- | | | + * | | |------| |------| PL/PS| Next | + * | | | | | Back | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_TRNS, + KC_VOLD, + KC_MPRV, KC_MPLY, KC_MNXT +), +/* Keymap 4: Movement + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |DLeft |DRight|LShift|ACCESS| |------| |------| Left | Down | Up | Right| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |KOpen |KType | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | CTRL |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MOVE] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(DLEFT), M(DRIGHT), KC_LSFT, KC_TRNS, KC_TRNS, + KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_LCTRL,KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + +) +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case VERSION: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + case EEPROM: + if (record->event.pressed) { // For resetting EEPROM + eeconfig_init(); + } + break; + case DLEFT: + if (record->event.pressed) { // Windows move desktop left + return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); + } + break; + case DRIGHT: + if (record->event.pressed) { // Windows move desktop right + return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); + } + break; + case PSCREEN_APP: + if (record->event.pressed) { + return MACRO(D(LALT), T(PSCR), U(LALT)); + } + break; + case REFACTOR: + if (record->event.pressed) { // VS Refactor CTRL+R, R + return MACRO(D(LCTL), T(R), U(LCTL), T(R), END); + } + break; + case TEST: + if (record->event.pressed) { // VS Run Tests CTRL+R, T + return MACRO(D(LCTL), T(R), U(LCTL), T(T), END); + } + break; + case DEBUG_TEST: + if (record->event.pressed) { // VS Debug Tests CTRL+R, CTRL+T + return MACRO(D(LCTL), T(R), T(T), U(LCTL), END); + } + break; + case FORMAT: + if (record->event.pressed) { // VS Format Document, CTRL+K, CTRL+D + return MACRO(D(LCTL), T(K), T(D), U(LCTL), END); + } + break; + case KEEPASS_OPEN: + if (record->event.pressed) { // Keepass open application + return MACRO(D(LCTL), D(LALT), T(K), U(LALT), U(LCTL), END); + } + break; + case KEEPASS_TYPE: + if (record->event.pressed) { // Keepass autotype + return MACRO(D(LCTL), D(LALT), T(A), U(LALT), U(LCTL), END); + } + break; + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + ergodox_board_led_on(); + ergodox_led_all_on(); +}; + diff --git a/keyboards/ergodox/keymaps/333fred/visualizer.c b/keyboards/ergodox/keymaps/333fred/visualizer.c new file mode 100644 index 0000000000..2a30562ae7 --- /dev/null +++ b/keyboards/ergodox/keymaps/333fred/visualizer.c @@ -0,0 +1,33 @@ +/* +Note: this is a modified copy of ../default/visualizer.c, originally licensed GPL. +*/ + +#include "simple_visualizer.h" + +// This function should be implemented by the keymap visualizer +// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing +// that the simple_visualizer assumes that you are updating +// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is +// stopped. This can be done by either double buffering it or by using constant strings +static void get_visualizer_layer_and_color(visualizer_state_t* state) { + uint8_t saturation = 60; + if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) { + saturation = 255; + } + if (state->status.layer & 0x10) { + state->target_lcd_color = LCD_COLOR(140, 100, 60); |