diff options
Diffstat (limited to 'keyboards/ergodox')
-rw-r--r-- | keyboards/ergodox/config.h | 4 | ||||
-rw-r--r-- | keyboards/ergodox/ez/config.h | 2 | ||||
-rw-r--r-- | keyboards/ergodox/ez/matrix.c | 62 | ||||
-rw-r--r-- | keyboards/ergodox/keymaps/coderkun_neo2/keymap.c | 53 | ||||
-rw-r--r-- | keyboards/ergodox/keymaps/coderkun_neo2/readme.md | 122 | ||||
-rw-r--r-- | keyboards/ergodox/keymaps/dvorak_programmer_swe/keymap.c | 331 | ||||
-rw-r--r-- | keyboards/ergodox/keymaps/dvorak_programmer_swe/readme.md | 28 | ||||
-rw-r--r-- | keyboards/ergodox/keymaps/xyverz/keymap.c | 8 |
8 files changed, 540 insertions, 70 deletions
diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h index 994a8c6433..e870835d85 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 40 +#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..aa17c3e8d3 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -58,7 +58,7 @@ 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 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/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c index aaf75d58f2..2d6f76856a 100644 --- a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c +++ b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤ * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ Alt │ CTL │ + * │ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ ALT │ CTL │ * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ * │ ← │ ↑ │ │ ↓ │ → │ * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R, TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT, - NEO_L2_R,KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, + NEO_L2_R,KC_RGUI,MO(FMU),KC_LALT,KC_RCTL, KC_DOWN, KC_RGHT, KC_MINS, MEH_T(KC_NO),KC_ENT,KC_SPC @@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ * │ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │ * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ + * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ ALT │ CTL │ * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ * │ ← │ ↑ │ │ ↓ │ → │ * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ @@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y, DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R, KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT, - MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, + MO(NHL),KC_RGUI,MO(FMU),KC_LALT,KC_RCTL, KC_DOWN, KC_RGHT, KC_MINS, MEH_T(KC_NO),KC_ENT,KC_SPC @@ -104,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ + * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ ALT │ CTL │ * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ * │ ← │ ↑ │ │ ↓ │ → │ * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ @@ -127,7 +127,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS, DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO, KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT, - MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, + MO(NHL),KC_RGUI,MO(FMU),KC_LALT,KC_RCTL, KC_DOWN, KC_RGHT, KC_MINS, MEH_T(KC_NO),KC_ENT,KC_SPC @@ -135,13 +135,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 3: F-keys, Mouse and Unicode * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ - * │ │ ┌ │ ┬ │ ┐ │ ─ │ │ │ │ │ │ │ F9 │ F10 │ F11 │ F12 │ │ + * │ │ ┌ │ ┬ │ ┐ │ ─ │ │ │ │ │ │ ↔ │ ← │ → │ ↑ │ ↓ │ │ * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ - * │ │ ├ │ ┼ │ ┤ │ ✓ │ ✕ ├─────┤ ├─────┤ │ F5 │ F6 │ F7 │ F8 │ │ + * │ │ ├ │ ┼ │ ┤ │ 〈 │ 〉 ├─────┤ ├─────┤ │ ✓ │ ✕ │ • │ ∶ │ │ * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ - * │ │ └ │ ┴ │ ┘ │ ↔ │ ⇔ │ │ │ │ │ F1 │ F2 │ F3 │ F4 │ │ + * │ │ └ │ ┴ │ ┘ │ │ │ │ │ │ ⇔ │ ⇐ │ ⇒ │ ⇑ │ ⇓ │ │ * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ @@ -154,23 +154,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [FMU] = KEYMAP( // left hand - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, UC(0x250C),UC(0x252C),UC(0x2510),UC(0x2500),UC(0x2502),KC_TRNS, - KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x2713),UC(0x2715), - KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),UC(0x2194),UC(0x21D4),KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_MS_L, KC_MS_U, + KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x3008),UC(0x3009), + KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MS_L, KC_MS_U, KC_BTN1, - 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_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS,KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, - KC_TRNS, KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, UC(0x2194),UC(0x2190),UC(0x2192),UC(0x2191),UC(0x2193),KC_TRNS, + KC_TRNS, UC(0x2713),UC(0x2715),UC(0x2022),UC(0x2236),KC_TRNS, + KC_TRNS, UC(0x21D4),UC(0x21D0),UC(0x21D2),UC(0x21D1),UC(0x21D3),KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_D, KC_MS_R, KC_BTN2, - KC_TRNS, KC_TRNS,KC_TRNS + KC_TRNS, KC_TRNS, KC_TRNS ), /* Layer 4: Neo’s software layer 4 rebuilt in Hardware @@ -294,11 +294,10 @@ void unicode_input_start (void) { // Override method to use NEO_A instead of KC_A uint16_t hex_to_keycode(uint8_t hex) { - if (hex == 0x0) { + if(hex == 0x0) { return KC_0; - } else if (hex < 0xA) { - return KC_1 + (hex - 0x1); - } else { + } + else if(hex >= 0xA) { switch(hex) { case 0xA: return NEO_A; @@ -316,4 +315,6 @@ uint16_t hex_to_keycode(uint8_t hex) return KC_NO; } } + + return KC_1 + (hex - 0x1); } diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/readme.md b/keyboards/ergodox/keymaps/coderkun_neo2/readme.md index 2a4d3a535b..0c9290bf08 100644 --- a/keyboards/ergodox/keymaps/coderkun_neo2/readme.md +++ b/keyboards/ergodox/keymaps/coderkun_neo2/readme.md @@ -4,10 +4,18 @@ The idea of this layout is to use it for [Neo2](http://www.neo-layout.org) but a The main goal of the default layer is to provide a complete symmetric layout with each modifier equally placed for both hands (mirror, of course). -It also features a layer for additional keys like F-keys (F1 – F12), some mouse keys and (hopefully in the near future) some useful Unicode symbols. +It also features a layer for additional keys like F-keys (F1 – F12), some mouse keys and some useful Unicode symbols. -## Layers +## Build + + ``` + make clean + make coderkun_neo2 + ``` + + +## Keymap 0. Default layer for Neo2 1. Poor man’s QWERTZ @@ -16,16 +24,106 @@ It also features a layer for additional keys like F-keys (F1 – F12), some mous 4. Neo’s software layers 4 rebuilt in hardware -## Build +### Layer 0: Default layer for Neo2 -1. Enable Unicode in Makefile + ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐ + │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ + ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + │ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │ + ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + │ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │ + ├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤ + │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ + └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + │ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ Alt │ CTL │ + └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ + │ ← │ ↑ │ │ ↓ │ → │ + ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ + │ │ │ ─ │ │ ─ │ │ │ + │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ + │ │ │ HYP │ │ MEH │ │ │ + └─────┴─────┴─────┘ └─────┴─────┴─────┘ - ``` - UNICODE_ENABLE = yes - ``` -2. Build as usual - ``` - make clean - make KEYMAP=coderkun_neo2 - ``` +### Layer 1: Poor man’s QWERTZ + + ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐ + │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ + ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + │ C │ P │ T │ F │ K │ L │ HOM │ │ END │ B │ A │ S │ G │ V │ Y │ + ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + │ Mod3 │ D │ H │ Ö │ O │ I ├─────┤ ├─────┤ U │ - │ Z │ E │ X │ Mod3 │ + ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ + │ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │ + └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ + └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ + │ ← │ ↑ │ │ ↓ │ → │ + ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ + │ │ │ ─ │ │ ─ │ │ │ + │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ + │ │ │ HYP │ │ MEH │ │ │ + └─────┴─────┴─────┘ └─────┴─────┴─────┘ + + +### Layer 2: Poor man’s Neo + + ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐ + │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ + ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + │ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │ + ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + │ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │ + ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ + │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ + └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ + └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ + │ ← │ ↑ │ │ ↓ │ → │ + ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ + │ │ │ ─ │ │ ─ │ │ │ + │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ + │ │ │ HYP │ │ MEH │ │ │ + └─────┴─────┴─────┘ └─────┴─────┴─────┘ + + +### Layer 3: F-keys, mouse keys und Unicode symbols + + ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐ + │ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ + ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + │ │ ┌ │ ┬ │ ┐ │ ─ │ │ │ │ │ │ ↔ │ ← │ → │ ↑ │ ↓ │ │ + ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + │ │ ├ │ ┼ │ ┤ │ 〈 │ 〉 ├─────┤ ├─────┤ │ ✓ │ ✕ │ • │ ∶ │ │ + ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ + │ │ └ │ ┴ │ ┘ │ │ │ │ │ │ ⇔ │ ⇐ │ ⇒ │ ⇑ │ ⇓ │ │ + └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ + └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ + │ Ms← │ Ms↑ │ │ Ms↓ │ Ms→ │ + ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ + │ │ │ MLC │ │ MRC │ │ │ + │ │ ├─────┤ ├─────┤ │ │ + │ │ │ │ │ │ │ │ + └─────┴─────┴─────┘ └─────┴─────┴─────┘ + + +### Layer 4: Neo’s software layers 4 rebuilt in hardware + + ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + │ │ PgUp│ BSpc│ ↑ │ Del │ PgDn│ │ │ │ │ 7 │ 8 │ 9 │ + │ − │ + ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + │ │ Home│ ← │ ↓ │ → │ End ├─────┤ ├─────┤ │ 4 │ 5 │ 6 │ , │ . │ + ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ + │ │ Esc │ Tab │ Ins │ Ret │ Undo│ │ │ │ │ 1 │ 2 │ 3 │ │ │ + └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ + └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ + │ │ │ │ │ │ + ┌─────┼─────┼─────┤ ├─────┼─────┼─────┐ + │ │ │ │ │ │ │ │ + │ │ ├─────┤ ├─────┤ │ │ + │ │ │ │ │ │ │ │ + └─────┴─────┴─────┘ └─────┴─────┴─────┘ diff --git a/keyboards/ergodox/keymaps/dvorak_programmer_swe/keymap.c b/keyboards/ergodox/keymaps/dvorak_programmer_swe/keymap.c new file mode 100644 index 0000000000..8d65f7c7a5 --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_programmer_swe/keymap.c @@ -0,0 +1,331 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "version.h" +#include "keymap_nordic.h" +#include "keymap_norwegian.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // mouse keys +#define DEVL 3 // dev keys + +#define MACRO_PUBLIC 10 +#define MACRO_PRIVATE 11 +#define MACRO_PROT 12 + +#define MACRO_SHARED 13 +#define MACRO_CONST 14 +#define MACRO_DIM 15 +#define MACRO_STRING 16 +#define MACRO_INT 17 +#define MACRO_DEC 18 +#define MACRO_BOOL 19 + +#define MACRO_RETURN 20 +#define MACRO_NOTHING 21 +#define MACRO_TODO 22 + +#define MACRO_SAVE 24 +#define MACRO_BUILD 25 +#define MACRO_DEBUG 26 + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | L3 | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | \ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | - | , | . | P | Y | LT1 | | LT1 | F | G | C | R | L | Å | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | WIN | A | O | E | U | I |------| |------| D | H | T | N | S | Ä | + * |--------+------+------+------+------+------| LT2 | | LT2 |------+------+------+------+------+--------| + * | LShift | Ö | Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | CTRL | L1 |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// 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 + MO(DEVL), KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, NO_MINS, KC_COMM, KC_DOT, KC_P, KC_Y, TG(SYMB), + KC_LGUI, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(MDIA), + CTL_T(KC_NO), MO(SYMB), LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLASH, + TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, NO_AM, + KC_D, KC_H, KC_T, KC_N, KC_S, NO_AE, + TG(MDIA),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | @ | { | } | [ | ] | | | | < | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | ( | ) | \ | / |------| |------| > | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | UND | CUT | COP | PAS | | | | ? | 1 | 2 | 3 | % | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | . | 0 | = | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, NO_AT, ALGR(KC_7), ALGR(KC_0), NO_LBRC, NO_RBRC, KC_TRNS, + KC_TRNS, KC_HASH, NO_LPRN, NO_RPRN, ALGR(KC_MINS), NO_SLSH, + KC_TRNS, KC_TRNS, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, NO_LESS, KC_7, KC_8, KC_9, KC_KP_ASTERISK, KC_F12, + LSFT(NO_LESS), KC_4, KC_5, KC_6, KC_KP_PLUS, KC_TRNS, + KC_TRNS, NO_QUES, KC_1, KC_2, KC_3, LSFT(KC_5), KC_TRNS, + KC_DOT,KC_0, LSFT(KC_0), KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// 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_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 3: Developer keys in vb.net + * shortened in layout beneth, for example int-> integer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | Save |Build |Debug | | | | | | bool | int |string| dec | Todo | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| priv | publ |shared| prot | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | const| dim |return|nothin| | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[DEVL] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(MACRO_SAVE), M(MACRO_BUILD), M(MACRO_DEBUG), 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, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(MACRO_BOOL), M(MACRO_INT), M(MACRO_STRING), M(MACRO_DEC), M(MACRO_TODO), KC_TRNS, + M(MACRO_PRIVATE), M(MACRO_PUBLIC), M(MACRO_SHARED), M(MACRO_PROT), KC_TRNS, KC_TRNS, + KC_TRNS, M(MACRO_CONST), M(MACRO_DIM), M(MACRO_RETURN), M(MACRO_NOTHING), 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 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + case MACRO_PUBLIC: + if (record->event.pressed) { + return MACRO( T(P), T(U), T(B), T(L), T(I), T(C), T(SPACE),END); + } + break; + case MACRO_PRIVATE: + if (record->event.pressed) { + return MACRO( T(P), T(R), T(I), T(V), T(A), T(T), T(E), T(SPACE),END); + } + break; + case MACRO_PROT: + if (record->event.pressed) { + return MACRO( T(P), T(R), T(O), T(T), T(E), T(C), T(T), T(E), T(D), T(SPACE),END); + } + break; + case MACRO_SHARED: + if (record->event.pressed) { + return MACRO( T(S), T(H), T(A), T(R), T(E), T(D), T(SPACE), END); + } + break; + case MACRO_CONST: + if (record->event.pressed) { + return MACRO( T(C), T(O), T(N), T(S), T(T), T(SPACE), END); + } + break; + case MACRO_DIM: + if (record->event.pressed) { + return MACRO( T(D), T(I), T(M), T(SPACE), END); + } + break; + case MACRO_STRING: + if (record->event.pressed) { + return MACRO( T(S), T(T), T(R), T(I), T(N), T(G), T(SPACE), END); + } + break; + case MACRO_BOOL: + if (record->event.pressed) { + return MACRO( T(B), T(O), T(O), T(L), T(E), T(A), T(N), T(SPACE), END); + } + break; + case MACRO_INT: + if (record->event.pressed) { + return MACRO( T(I), T(N), T(T), T(SPACE), END); + } + break; + case MACRO_DEC: + if (record->event.pressed) { + return MACRO( T(D), T(E), T(C), T(I), T(M), T(A), T(L), T(SPACE), END); + } + break; + case MACRO_RETURN: + if (record->event.pressed) { + return MACRO( T(R), T(E), T(T), T(U),T(R),T(N), T(SPACE), END); + } + break; + case MACRO_NOTHING: + if (record->event.pressed) { + return MACRO( T(N), T(O), T(T), T(H), T(I), T(N), T(G), T(SPACE), END); + } + case MACRO_TODO: + if (record->event.pressed) { + return MACRO( KC_BSLASH, D(LSHIFT) ,T(T), T(O), T(D), T(O), KC_DOT, U(LSHIFT), T(SPACE),END); + } + break; + case MACRO_SAVE: + if (record->event.pressed) { + return MACRO( D(LCTL) ,T(S), U(LCTL),END); + } + break; + case MACRO_BUILD: + if (record->event.pressed) { + return MACRO( D(LCTL), D(LSHIFT) ,T(B), U(LSHIFT), U(LCTL),END); + } + break; + case MACRO_DEBUG: + if (record->event.pressed) { + return MACRO( KC_F5 ,END); + } + break; + } + return MACRO_NONE; +}; + +// 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) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/dvorak_programmer_swe/readme.md b/keyboards/ergodox/keymaps/dvorak_programmer_swe/readme.md new file mode 100644 index 0000000000..552fa0e3ab --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_programmer_swe/readme.md @@ -0,0 +1,28 @@ +# ErgoDox EZ Dvorak Programmer SWEDISH + +Dvorak layout adjusted for a suitable programmer layout and swedish special characters added: + +* åäö characters added +* Layout for common vb.net keywords +* Common Visual Studio commands like Save, Build, Debug + +TODO: + +* (Layer 4 is qwerty (for easier gaming & less fortunate keyboard users)) Like this idea, will add it later on + +Known issues: + +* Keymap 2 modifier has not gotten its place yet.. +* Print screen, where? + + +## Changelog + +* 2017-05-16 + * Initial release + +# Author +Christian Westerlund +cwesterlund @ github + +Thanks to the author of keymap csharp_dev for inspiration!
\ No newline at end of file diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c index ec909ec53d..b186c70ba3 100644 --- a/keyboards/ergodox/keymaps/xyverz/keymap.c +++ b/keyboards/ergodox/keymaps/xyverz/keymap.c @@ -254,7 +254,7 @@ const uint16_t PROGMEM fn_actions[] = { }; -void persistant_default_layer_set(uint16_t default_layer) { +void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); } @@ -265,17 +265,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) switch(id) { case _DV: if (record->event.pressed) { - persistant_default_layer_set(1UL<<_DV); + persistent_default_layer_set(1UL<<_DV); } break; case _QW: if (record->event.pressed) { - persistant_default_layer_set(1UL<<_QW); + persistent_default_layer_set(1UL<<_QW); } break; case _CM: if (record->event.pressed) { - persistant_default_layer_set(1UL<<_CM); + persistent_default_layer_set(1UL<<_CM); } break; } |