From eb99e515b3b058781fc57a2f7db130b6bc73281e Mon Sep 17 00:00:00 2001 From: Christopher Browne Date: Mon, 22 Feb 2016 15:31:13 -0500 Subject: More documentation --- keyboard/planck/keymaps/cbbrowne/README.md | 20 ++++++++++++++++---- keyboard/planck/keymaps/cbbrowne/keymap.c | 10 +++++----- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/keyboard/planck/keymaps/cbbrowne/README.md b/keyboard/planck/keymaps/cbbrowne/README.md index 323e9a8596..e190c8b41e 100644 --- a/keyboard/planck/keymaps/cbbrowne/README.md +++ b/keyboard/planck/keymaps/cbbrowne/README.md @@ -10,7 +10,19 @@ doing sundry experimentation: * To figure things out about the toolset * I'm an Emacs guy, so will be needing a fair bit of tuning * It made sense to mess around some with keyboard maps. - - I added Workman alongside Dvorak and Colemak - - Boy, oh boy, these don't help - - I have done 30 years of learning of Emacs key mappings, and these alternative keyboards massively mess me up - - I added a keypad, originally based on keymaps/numpad.c, but mighty substantially revised, as that one seems to be rotated 90 degrees from usual conventions for number pads \ No newline at end of file + - I tried added Workman alongside Dvorak and Colemak + - Boy, oh boy, these don't help!!! + - I have done 30 years of learning of Emacs key mappings, and + these alternative keyboards massively mess me up + - I added a keypad, originally based on keymaps/numpad.c, but + mighty substantially revised, as that one seems to be rotated 90 + degrees from usual conventions for number pads + * The keypad layer also includes some sample "hacks" of cool things, + all using actions attached in using the function action_get_macro() + - Key [1][2] aka "q" types out my name, cbbrowne, as a fun example + of a key generating a bunch of keystrokes. The keystroke is + sufficiently inconvenient that it isn't terribly practical for me + to use it, but hey, it shows how others might use this facility + in a more useful context. + - Key [2][2] aka "a" uses a random number generator to select a digit 0-9 at random + - Key [3][2] aka "z" uses a random number generator to select a letter a-z at random diff --git a/keyboard/planck/keymaps/cbbrowne/keymap.c b/keyboard/planck/keymaps/cbbrowne/keymap.c index 250d412ced..f46ca85de9 100644 --- a/keyboard/planck/keymaps/cbbrowne/keymap.c +++ b/keyboard/planck/keymaps/cbbrowne/keymap.c @@ -99,10 +99,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TRNS, DF(_KP), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, [_KP] = { /* Key Pad */ - {KC_ESC, M(M_USERNAME), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_KP_ENTER, KC_KP_PLUS, KC_KP_PLUS, KC_KP_ENTER, KC_BSPC}, - {KC_LCTL, M(M_RANDDIGIT), KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_MINUS, KC_7, KC_8, KC_9, KC_ENT}, - {KC_LSFT, M(M_RANDLETTER), KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_PLUS, KC_4, KC_5, KC_6, KC_DOT}, - {BL_STEP, M(M_LED), KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_SPC, DF(_QW), KC_1, KC_2, KC_3, KC_0} + {KC_ESC, M(M_USERNAME), KC_F9, KC_F10, KC_F11, KC_F12, KC_PGUP, KC_KP_ENTER, KC_7, KC_8, KC_9, KC_BSPC}, + {KC_LCTL, M(M_RANDDIGIT), KC_F5, KC_F6, KC_F7, KC_F8, KC_PGDN, KC_KP_MINUS, KC_4, KC_5, KC_6, KC_PIPE}, + {KC_LSFT, M(M_RANDLETTER), KC_F1, KC_F2, KC_F3, KC_F4, KC_DEL, KC_KP_PLUS, KC_1, KC_2, KC_3, KC_ENTER}, + {BL_STEP, M(M_LED), KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_SPC, DF(_QW), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT} } }; @@ -110,7 +110,7 @@ const uint16_t PROGMEM fn_actions[] = { }; /* This bit of logic seeds a wee linear congruential random number generator */ - +/* lots of prime numbers everywhere... */ static uint16_t random_value = 157; #define randadd 53 #define randmul 181 -- cgit v1.2.3 From f044edbed9b542de573a321628ddd6a3afc348b0 Mon Sep 17 00:00:00 2001 From: Didier Loiseau Date: Sun, 31 Jan 2016 15:30:48 +0100 Subject: Initial bepo layout based on tm2030 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No more SFT_T: - moved ] (bépo W) below Tab - moved - (bépo =) in place of ] (top right) - removed SFT_T from ' (bépo M) - moved \ (bépo Ç) in place of = (bépo %) - moved = (bépo %) in place of - (bépo =) --- keyboard/ergodox_ez/keymaps/bepo/keymap.c | 242 ++++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 keyboard/ergodox_ez/keymaps/bepo/keymap.c diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c new file mode 100644 index 0000000000..1fe23a9323 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -0,0 +1,242 @@ +/* TypeMatrix-2030-like keymap */ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "led.h" + +#define BASE 0 // default layer +#define DVRK 1 // Dvorak layer +#define NUMR 8 // numeric layer +#define FNLR 9 // fn layer + +#define MDBL0 1 +#define MFNLR 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T |Backsp| |Backsp| Y | U | I | O | P | [ | + * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| + * | ] | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | = | Home | \ |End/Ctl| + * `-----------------------------------' `-----------------------------------' + * ,--------------. ,-------------. + * |Esc/Alt| num | | Left |Right | + * ,------+-------+------| |------+------+------. + * | | | PgUp | | Up | | | + * |Space |LShift |------| |------|RShift|Space | + * | | | PgDn | | Down | | | + * `---------------------' `--------------------' + */ +// 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_DELT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, + KC_RBRC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT, + KC_LCTL, M(MFNLR), KC_LGUI,KC_MPLY,ALT_T(KC_APP), + + ALT_T(KC_ESC), TG(NUMR), + KC_PGUP, + KC_SPC, KC_LSFT, KC_PGDN, + + // right hand + KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_RALT, KC_EQL, KC_HOME, KC_BSLS, CTL_T(KC_END), + + KC_LEFT, KC_RGHT, + KC_UP, + KC_DOWN, KC_RSFT, KC_SPC + ), +/* Dvorak layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | ' | , | . | P | Y |Backsp| |Backsp| F | G | C | R | L | / | + * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| + * | LShift | A | O | E | U | I |------| |------| D | H | T | N | S | -/Shift| + * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| + * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | \/Shift| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | [ | Home | ] |End/Ctl| + * `-----------------------------------' `-----------------------------------' + * ,--------------. ,-------------. + * |Esc/Alt| num | | Left |Right | + * ,------+-------+------| |------+------+------. + * | | | PgUp | | Up | | | + * |Space |LShift |------| |------|RShift|Space | + * | | | PgDn | | Down | | | + * `---------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[DVRK] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_BSPC, + KC_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_ENT, + KC_LCTL, M(MFNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), + + ALT_T(KC_ESC), TG(NUMR), + KC_PGUP, + KC_SPC, KC_LSFT, KC_PGDN, + + // right hand + KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_BSPC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, KC_S, SFT_T(KC_MINS), + KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_BSLS), + KC_RALT, KC_LBRC, KC_HOME, KC_RBRC, CTL_T(KC_END), + + KC_LEFT, KC_RGHT, + KC_UP, + KC_DOWN, KC_RSFT, KC_SPC + ), +/* Numeric Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | | | Tab | / | * | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | F6 | F7 | F8 | F9 | F10 | | | | | Home | 7 | 8 | 9 | + | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | F11 | F12 | | | |------| |------| Up | End | 4 | 5 | 6 | + | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | Left | Down | Right| 1 | 2 | 3 |KpEnter | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | 0 | 00 | . |Etr/Ctl| + * `----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | | | |n.lock|c.lock| + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[NUMR] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_F11, KC_F12, 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_F6, KC_F7, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS, + KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_UP, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LEFT, KC_DOWN, KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_TRNS, KC_P0, M(MDBL0),KC_PDOT, CTL_T(KC_PENT), + + KC_NLCK, KC_CAPS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* fn layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | |Insert| |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk| + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | |VolUp | | | | | | | | Pause | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | Calc | Mail |Browsr|------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | cut | copy |paste | Mute |VolDn | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | Next | | | + * | Mute | |------| |------| | | + * | | | | | Prev | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[FNLR] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, + KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_MUTE, KC_TRNS, KC_TRNS, + // right hand + KC_INS, KC_EJCT, KC_PWR, KC_SLEP, KC_WAKE, KC_PSCR, KC_SLCK, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, + 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_MPRV, + KC_MNXT, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case MDBL0: + if (record->event.pressed) { + return MACRO( I(25), T(P0), T(P0), END ); + } + break; + case MFNLR: + layer_invert(NUMR); + layer_invert(FNLR); + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void * matrix_init_user(void) { + return NULL; +}; + +// Runs constantly in the background, in a loop. +void * matrix_scan_user(void) { + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + // led 1: numeric layer + if (layer_state & (1 << NUMR)) { + ergodox_right_led_1_on(); + } + // led 2: Dvorak layer + if (default_layer_state == 1 << DVRK) { + ergodox_right_led_2_on(); + } + // led 3: caps lock + if (host_keyboard_leds() & (1< Date: Sun, 7 Feb 2016 19:29:49 +0100 Subject: =?UTF-8?q?Use=20B=C3=89PO=20sp=C3=A9cific=20key=20aliases=20with?= =?UTF-8?q?=20BP=5F=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit keymap_bepo.h: define BP_* keycodes for all possible characters bepo/keymap.c: use those keycodes in the bépo keymap --- keyboard/ergodox_ez/keymaps/bepo/keymap.c | 90 +++++++------------------------ 1 file changed, 20 insertions(+), 70 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c index 1fe23a9323..835db147af 100644 --- a/keyboard/ergodox_ez/keymaps/bepo/keymap.c +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -3,9 +3,9 @@ #include "debug.h" #include "action_layer.h" #include "led.h" +#include "keymap_extras/keymap_bepo.h" #define BASE 0 // default layer -#define DVRK 1 // Dvorak layer #define NUMR 8 // numeric layer #define FNLR 9 // fn layer @@ -16,15 +16,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | - | + * | $ | " | « | » | ( | ) | Del | | Del | @ | + | - | / | * | = | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T |Backsp| |Backsp| Y | U | I | O | P | [ | + * | Tab | B | É | P | O | È |Backsp| |Backsp| ^ | V | D | L | J | Z | * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| - * | ] | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * | W | A | U | I | E | , |------| |------| C | T | S | R | N | M | * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * | LShift | À | Y | X | . | K | | | | ' | Q | G | H | F | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | = | Home | \ |End/Ctl| + * |LCtrl | fn | LGui | Play |App/Alt| |Alt Gr| % | Home | Ç |End/Ctl| * `-----------------------------------' `-----------------------------------' * ,--------------. ,-------------. * |Esc/Alt| num | | Left |Right | @@ -38,72 +38,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, - KC_RBRC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT, - KC_LCTL, M(MFNLR), KC_LGUI,KC_MPLY,ALT_T(KC_APP), + BP_DLR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, + KC_TAB, BP_B, BP_ECUT, BP_P, BP_O, BP_EGRV, KC_BSPC, + BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMM, + KC_LSFT, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, KC_ENT, + KC_LCTL, M(MFNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), ALT_T(KC_ESC), TG(NUMR), KC_PGUP, KC_SPC, KC_LSFT, KC_PGDN, // right hand - KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_RALT, KC_EQL, KC_HOME, KC_BSLS, CTL_T(KC_END), - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, KC_RSFT, KC_SPC - ), -/* Dvorak layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | ' | , | . | P | Y |Backsp| |Backsp| F | G | C | R | L | / | - * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| - * | LShift | A | O | E | U | I |------| |------| D | H | T | N | S | -/Shift| - * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| - * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | \/Shift| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | [ | Home | ] |End/Ctl| - * `-----------------------------------' `-----------------------------------' - * ,--------------. ,-------------. - * |Esc/Alt| num | | Left |Right | - * ,------+-------+------| |------+------+------. - * | | | PgUp | | Up | | | - * |Space |LShift |------| |------|RShift|Space | - * | | | PgDn | | Down | | | - * `---------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[DVRK] = KEYMAP( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_BSPC, - KC_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_ENT, - KC_LCTL, M(MFNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), - - ALT_T(KC_ESC), TG(NUMR), - KC_PGUP, - KC_SPC, KC_LSFT, KC_PGDN, - - // right hand - KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_BSPC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, SFT_T(KC_MINS), - KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_BSLS), - KC_RALT, KC_LBRC, KC_HOME, KC_RBRC, CTL_T(KC_END), - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, KC_RSFT, KC_SPC + KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, BP_EQL, + KC_BSPC, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, + BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, + KC_ENT, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_RSFT, + BP_ALGR, BP_PERC, KC_HOME, BP_CCED, CTL_T(KC_END), + + KC_LEFT, KC_RGHT, + KC_UP, + KC_DOWN, KC_RSFT, KC_SPC ), /* Numeric Layer * @@ -230,10 +184,6 @@ void * matrix_scan_user(void) { if (layer_state & (1 << NUMR)) { ergodox_right_led_1_on(); } - // led 2: Dvorak layer - if (default_layer_state == 1 << DVRK) { - ergodox_right_led_2_on(); - } // led 3: caps lock if (host_keyboard_leds() & (1< Date: Sun, 14 Feb 2016 15:18:04 +0100 Subject: Swapped w and = to keep the w on the right hand (better for English) --- keyboard/ergodox_ez/keymaps/bepo/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c index 835db147af..2a4cce075e 100644 --- a/keyboard/ergodox_ez/keymaps/bepo/keymap.c +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -16,11 +16,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | « | » | ( | ) | Del | | Del | @ | + | - | / | * | = | + * | $ | " | « | » | ( | ) | Del | | Del | @ | + | - | / | * | W | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | Tab | B | É | P | O | È |Backsp| |Backsp| ^ | V | D | L | J | Z | * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| - * | W | A | U | I | E | , |------| |------| C | T | S | R | N | M | + * | = | A | U | I | E | , |------| |------| C | T | S | R | N | M | * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| * | LShift | À | Y | X | . | K | | | | ' | Q | G | H | F | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -40,7 +40,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand BP_DLR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, KC_TAB, BP_B, BP_ECUT, BP_P, BP_O, BP_EGRV, KC_BSPC, - BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMM, + BP_EQL, BP_A, BP_U, BP_I, BP_E, BP_COMM, KC_LSFT, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, KC_ENT, KC_LCTL, M(MFNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), @@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_SPC, KC_LSFT, KC_PGDN, // right hand - KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, BP_EQL, + KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, BP_W, KC_BSPC, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, KC_ENT, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_RSFT, -- cgit v1.2.3 From bf78ca1ef2983f87e9acb5f115326290f9626931 Mon Sep 17 00:00:00 2001 From: Didier Loiseau Date: Wed, 17 Feb 2016 21:07:38 +0100 Subject: Use enums to define layers and macros --- keyboard/ergodox_ez/keymaps/bepo/keymap.c | 56 +++++++++++++++++-------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c index 2a4cce075e..855379e3cf 100644 --- a/keyboard/ergodox_ez/keymaps/bepo/keymap.c +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -5,12 +5,16 @@ #include "led.h" #include "keymap_extras/keymap_bepo.h" -#define BASE 0 // default layer -#define NUMR 8 // numeric layer -#define FNLR 9 // fn layer +enum layers { + LR_BASE, // default layer + LR_NUMR, // numeric layer + LR_FN, // fn layer +}; -#define MDBL0 1 -#define MFNLR 2 +enum macros { + M_DBL0, + M_FNLR, +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Basic layer @@ -36,15 +40,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default +[LR_BASE] = KEYMAP( // layer 0 : default // left hand BP_DLR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, KC_TAB, BP_B, BP_ECUT, BP_P, BP_O, BP_EGRV, KC_BSPC, BP_EQL, BP_A, BP_U, BP_I, BP_E, BP_COMM, KC_LSFT, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, KC_ENT, - KC_LCTL, M(MFNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), + KC_LCTL, M(M_FNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), - ALT_T(KC_ESC), TG(NUMR), + ALT_T(KC_ESC), TG(LR_NUMR), KC_PGUP, KC_SPC, KC_LSFT, KC_PGDN, @@ -81,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ // SYMBOLS -[NUMR] = KEYMAP( +[LR_NUMR] = KEYMAP( // left hand KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, @@ -91,13 +95,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_TAB, KC_PSLS, KC_PAST, KC_PMNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_UP, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_LEFT, KC_DOWN, KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_TRNS, KC_P0, M(MDBL0),KC_PDOT, CTL_T(KC_PENT), + KC_TRNS, KC_F6, KC_F7, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS, + KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_UP, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LEFT, KC_DOWN, KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_TRNS, KC_P0, M(M_DBL0),KC_PDOT, CTL_T(KC_PENT), KC_NLCK, KC_CAPS, KC_TRNS, @@ -125,12 +129,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ // MEDIA AND MOUSE -[FNLR] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, - KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, +[LR_FN] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, + KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -155,14 +159,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function switch(id) { - case MDBL0: + case M_DBL0: if (record->event.pressed) { return MACRO( I(25), T(P0), T(P0), END ); } break; - case MFNLR: - layer_invert(NUMR); - layer_invert(FNLR); + case M_FNLR: + layer_invert(LR_NUMR); + layer_invert(LR_FN); break; } return MACRO_NONE; @@ -181,7 +185,7 @@ void * matrix_scan_user(void) { ergodox_right_led_2_off(); ergodox_right_led_3_off(); // led 1: numeric layer - if (layer_state & (1 << NUMR)) { + if (layer_state & (1 << LR_NUMR)) { ergodox_right_led_1_on(); } // led 3: caps lock -- cgit v1.2.3 From b8ddbd21810951f64a081e4c3096bbc6aedc9aeb Mon Sep 17 00:00:00 2001 From: Didier Loiseau Date: Fri, 26 Feb 2016 00:54:19 +0100 Subject: Added RESET key on fn-= --- keyboard/ergodox_ez/keymaps/bepo/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c index 855379e3cf..1cebf8c9e8 100644 --- a/keyboard/ergodox_ez/keymaps/bepo/keymap.c +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -114,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | | | | |VolUp | | | | | | | | Pause | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | Calc | Mail |Browsr|------| |------| | | | | | | + * | RESET | | | Calc | Mail |Browsr|------| |------| | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | cut | copy |paste | Mute |VolDn | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -132,7 +132,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LR_FN] = KEYMAP( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, + RESET, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -- cgit v1.2.3 From a7cef2ca0a2322448d02008337013936b1d550ec Mon Sep 17 00:00:00 2001 From: Didier Loiseau Date: Wed, 17 Feb 2016 21:45:38 +0100 Subject: =?UTF-8?q?Initial=20B=C3=89PO=20over=20CSA=20with=20Shift=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initial implementation of the BÉPO layout for use with the Canadian Multilingual Standard layout (a.k.a. CSA / ACNOR layout) on the OS-side. - support all bépo characters from the default and shifted layers --- keyboard/ergodox_ez/keymaps/bepo/keymap.c | 159 ++++++++++++++++++++- .../keymap_extras/keymap_canadian_multilingual.h | 105 ++++++++++++++ 2 files changed, 262 insertions(+), 2 deletions(-) create mode 100644 quantum/keymap_extras/keymap_canadian_multilingual.h diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c index 1cebf8c9e8..ce887997e7 100644 --- a/keyboard/ergodox_ez/keymaps/bepo/keymap.c +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -4,14 +4,39 @@ #include "action_layer.h" #include "led.h" #include "keymap_extras/keymap_bepo.h" +#include "keymap_extras/keymap_canadian_multilingual.h" enum layers { LR_BASE, // default layer + LR_CSA, // BÉPO over Canadian Multilingual (CSA) + LR_CSA_SFT, // shifted BÉPO over CSA + LR_CSA_AGR, // altgr-ed BÉPO over CSA + LR_CSA_AGR_SFT, // altgr-shifted BÉPO over CSA LR_NUMR, // numeric layer LR_FN, // fn layer }; +#define IS_CA_MULT_ENABLED() (default_layer_state & (1 << LR_CSA)) + enum macros { + M_TGCM, // toggle CA-mult + M_CMSFT, // toggle shift on CA-mult + // macros for characters that need to be un-shifted in LR_CA_MULT_SHIFT + M_1, + M_2, + M_3, + M_4, + M_5, + M_6, + M_7, + M_8, + M_9, + M_0, + M_DEGR, + M_SCLN, + M_GRV, + M_NBSP, + // other layer macros M_DBL0, M_FNLR, }; @@ -63,6 +88,76 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_UP, KC_DOWN, KC_RSFT, KC_SPC ), +/** + * Same as default but for use with Canadian Multilingual on OS side + */ +[LR_CSA] = KEYMAP( + // left hand + KC_DLR, CM_DQOT, CM_LGIL, CM_RGIL, KC_LPRN, KC_RPRN, KC_DELT, + KC_TAB, KC_B, CM_ECUT, KC_P, KC_O, CM_EGRV, KC_BSPC, + KC_EQL, KC_A, KC_U, KC_I, KC_E, KC_COMM, + M(M_CMSFT), CM_AGRV, KC_Y, KC_X, KC_DOT, KC_K, KC_ENT, + KC_LCTL, M(M_FNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), + + ALT_T(KC_ESC), TG(LR_NUMR), + KC_PGUP, + KC_SPC, KC_LSFT, KC_PGDN, + + // right hand + KC_DELT, KC_AT, KC_PLUS, KC_MINS, CM_SLSH, KC_ASTR, KC_W, + KC_BSPC, CM_DCRC, KC_V, KC_D, KC_L, KC_J, KC_Z, + KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, + KC_ENT, CM_APOS, KC_Q, KC_G, KC_H, KC_F, M(M_CMSFT), + CM_ALGR, KC_PERC, KC_HOME, CM_CCED, CTL_T(KC_END), + + KC_LEFT, KC_RGHT, + KC_UP, + KC_DOWN, KC_RSFT, KC_SPC + ), +/* Shifted BÉPO over Canadian Multilingual + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | # | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | ! | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ° | | | | | ; |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | : | | | | | ? | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | ` | | | | + * `----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[LR_CSA_SFT] = KEYMAP( + // left hand + KC_HASH, M(M_1), M(M_2), M(M_3), M(M_4), M(M_5), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + M(M_DEGR),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(M_SCLN), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_COLN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, + M(M_NBSP), KC_TRNS, KC_TRNS, + + // right hand + KC_TRNS, M(M_6), M(M_7), M(M_8), M(M_9), M(M_0), KC_TRNS, + KC_TRNS, KC_EXLM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, CM_QEST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(M_GRV), KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, M(M_NBSP) + ), /* Numeric Layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -110,7 +205,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* fn layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | |Insert| |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk| + * |~CA-mult| | | | | |Insert| |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | | | | |VolUp | | | | | | | | Pause | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -130,7 +225,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // MEDIA AND MOUSE [LR_FN] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, + M(M_TGCM), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, RESET, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD, @@ -155,10 +250,66 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM fn_actions[] = { }; +void hold_shift(void) { + register_code(KC_LSHIFT); +} + +void release_shift(void) { + unregister_code(KC_LSHIFT); +} + const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function switch(id) { + case M_TGCM: + if (record->event.pressed) { + default_layer_xor(1 << LR_CSA); + } + break; + case M_CMSFT: + if (record->event.pressed) { + layer_on(LR_CSA_SFT); + hold_shift(); + } else { + release_shift(); + layer_off(LR_CSA_SFT); + } + break; + case M_1 ... M_0: + case M_DEGR: + case M_SCLN: + case M_GRV: + case M_NBSP: + // macros of the shift layer that require to release shift + if (record->event.pressed) { + release_shift(); + switch (id) { + case M_1 ... M_0: + register_code(KC_1 + (id - M_1)); + break; + case M_DEGR: + return MACRO(DOWN(CM_ALTGR), D(SCLN), END); + case M_SCLN: + return MACRO(D(SCLN), END); + case M_GRV: + return MACRO(DOWN(CM_ALTGR), TYPE(CM_DCRC), UP(CM_ALTGR), T(SPACE), END); + case M_NBSP: + return MACRO(DOWN(CM_ALTGR), T(SPACE), UP(CM_ALTGR), END); + } + } else { + hold_shift(); + switch (id) { + case M_1 ... M_0: + unregister_code(KC_1 + (id - M_1)); + break; + case M_DEGR: + return MACRO(UP(CM_ALTGR), D(LSFT), U(SCLN), END); + case M_SCLN: + return MACRO(D(LSFT), U(SCLN), END); + } + } + break; case M_DBL0: if (record->event.pressed) { return MACRO( I(25), T(P0), T(P0), END ); @@ -188,6 +339,10 @@ void * matrix_scan_user(void) { if (layer_state & (1 << LR_NUMR)) { ergodox_right_led_1_on(); } + // led 2: BÉPO over Canadian Multilingual + if (IS_CA_MULT_ENABLED()) { + ergodox_right_led_2_on(); + } // led 3: caps lock if (host_keyboard_leds() & (1< +#define CM_GRTR CM_GREATER + +// Space bar +#define CM_NON_BREAKING_SPACE ALTGR(KC_SPACE) +#define CM_NBSP CM_NON_BREAKING_SPACE + +#endif -- cgit v1.2.3 From 7840e69bfaee1d67de273c235b532d6f20c905a9 Mon Sep 17 00:00:00 2001 From: Didier Loiseau Date: Thu, 18 Feb 2016 00:47:23 +0100 Subject: =?UTF-8?q?B=C3=89PO=20over=20CSA:=20AltGr=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - implemented the most useful characters: - all French characters + € - common programmer characters - other keys implemented as KC_NO to avoid mistyping a character from a lower layer - AltGr+Shift not supported (yet) --- keyboard/ergodox_ez/keymaps/bepo/keymap.c | 54 +++++++++++++++++++++- .../keymap_extras/keymap_canadian_multilingual.h | 11 +++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c index ce887997e7..64fac7f9ba 100644 --- a/keyboard/ergodox_ez/keymaps/bepo/keymap.c +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -36,6 +36,8 @@ enum macros { M_SCLN, M_GRV, M_NBSP, + // macros for characters that don't have a simple key combination in LR_CA_MULT_ALTGR + M_CRC, // other layer macros M_DBL0, M_FNLR, @@ -108,7 +110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_BSPC, CM_DCRC, KC_V, KC_D, KC_L, KC_J, KC_Z, KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, KC_ENT, CM_APOS, KC_Q, KC_G, KC_H, KC_F, M(M_CMSFT), - CM_ALGR, KC_PERC, KC_HOME, CM_CCED, CTL_T(KC_END), + MO(LR_CSA_AGR), KC_PERC, KC_HOME, CM_CCED, CTL_T(KC_END), KC_LEFT, KC_RGHT, KC_UP, @@ -158,6 +160,51 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, M(M_NBSP) ), +/* AltGr-ed BÉPO over Canadian Multilingual + * "////" indicates that the key is disabled (unsupported bépo character) + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ////// | //// | < | > | [ | ] | | | | ^ | //// | //// | //// | //// | ////// | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | |dead '| & | œ |dead `| | | | //// | //// | //// | //// | //// | ////// | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ////// | æ | ù |dead "| € | //// |------| |------| //// | //// | //// | //// | //// | ////// | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | \ | { | } | //// | ~ | | | | //// | //// | //// | //// | //// | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | //// | | //// | | + * `----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | _ | |------| |------| | _ | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[LR_CSA_AGR] = KEYMAP( + // left hand + KC_NO, KC_NO, CM_LESS, CM_GRTR, CM_LBRC, CM_RBRC, KC_TRNS, + KC_TRNS, CM_PIPE, CM_DACT, KC_AMPR, CM_OE, CM_DGRV, KC_TRNS, + KC_NO, CM_AE, CM_UGRV, CM_DTRM, CM_EURO, KC_NO, + KC_TRNS, CM_BSLS, CM_LCBR, CM_RCBR, KC_NO, CM_TILD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_UNDS, KC_TRNS, KC_TRNS, + + // right hand + KC_TRNS, M(M_CRC), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_UNDS + ), /* Numeric Layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -310,6 +357,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } } break; + case M_CRC: + if (record->event.pressed) { + return MACRO(TYPE(CM_DCRC), T(SPACE), END); + } + break; case M_DBL0: if (record->event.pressed) { return MACRO( I(25), T(P0), T(P0), END ); diff --git a/quantum/keymap_extras/keymap_canadian_multilingual.h b/quantum/keymap_extras/keymap_canadian_multilingual.h index ae60ffe37e..e30419b5be 100644 --- a/quantum/keymap_extras/keymap_canadian_multilingual.h +++ b/quantum/keymap_extras/keymap_canadian_multilingual.h @@ -102,4 +102,15 @@ #define CM_NON_BREAKING_SPACE ALTGR(KC_SPACE) #define CM_NBSP CM_NON_BREAKING_SPACE +// GR2A-ed characters (non-exhaustive list) +// second row +#define CM_OE_LIGATURE GR2A(KC_E) // œ +#define CM_OE CM_OE_LIGATURE + +// third row +#define CM_AE_LIGATURE GR2A(KC_A) // æ +#define CM_AE CM_AE_LIGATURE +#define CM_DEAD_ACUTE GR2A(KC_SCLN) // dead acute accent +#define CM_DACT CM_DEAD_ACUTE + #endif -- cgit v1.2.3 From fbf1333d87aa4487692f068881ab1ce46fa79be5 Mon Sep 17 00:00:00 2001 From: Didier Loiseau Date: Fri, 26 Feb 2016 00:53:30 +0100 Subject: =?UTF-8?q?B=C3=89PO=20over=20CSA:=20unicode=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - implement easy way to define and send unicode characters on Windows - define 3 characters not available in CSA: - en dash: – - em dash: — - ellipsis: … --- keyboard/ergodox_ez/keymaps/bepo/keymap.c | 59 ++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c index 64fac7f9ba..b08b47217c 100644 --- a/keyboard/ergodox_ez/keymaps/bepo/keymap.c +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -19,6 +19,13 @@ enum layers { #define IS_CA_MULT_ENABLED() (default_layer_state & (1 << LR_CSA)) enum macros { + // Characters that do not exist in CSA and must be implemented based on unicode support + // Note: these are intentionally declared first to be used as indexes in spec_chars below + UC_NDSH, // – + UC_MDSH, // — + UC_ELPS, // … + END_UC, // indicates the last unicode character macro + // other macros M_TGCM, // toggle CA-mult M_CMSFT, // toggle shift on CA-mult // macros for characters that need to be un-shifted in LR_CA_MULT_SHIFT @@ -43,6 +50,15 @@ enum macros { M_FNLR, }; +const uint16_t unicode_chars[] = { + [UC_NDSH] = L'–', + [UC_MDSH] = L'—', + [UC_ELPS] = L'…', +}; + +/* shortcut for unicod character macros */ +#define MUC(name) M(UC_##name) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Basic layer * @@ -164,13 +180,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * "////" indicates that the key is disabled (unsupported bépo character) * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ////// | //// | < | > | [ | ] | | | | ^ | //// | //// | //// | //// | ////// | + * | – | — | < | > | [ | ] | | | | ^ | //// | //// | //// | //// | ////// | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | |dead '| & | œ |dead `| | | | //// | //// | //// | //// | //// | ////// | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | ////// | æ | ù |dead "| € | //// |------| |------| //// | //// | //// | //// | //// | ////// | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | \ | { | } | //// | ~ | | | | //// | //// | //// | //// | //// | | + * | | \ | { | } | … | ~ | | | | //// | //// | //// | //// | //// | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | | //// | | //// | | * `----------------------------------' `-----------------------------------' @@ -184,10 +200,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [LR_CSA_AGR] = KEYMAP( // left hand - KC_NO, KC_NO, CM_LESS, CM_GRTR, CM_LBRC, CM_RBRC, KC_TRNS, + MUC(NDSH),MUC(MDSH),CM_LESS, CM_GRTR, CM_LBRC, CM_RBRC, KC_TRNS, KC_TRNS, CM_PIPE, CM_DACT, KC_AMPR, CM_OE, CM_DGRV, KC_TRNS, KC_NO, CM_AE, CM_UGRV, CM_DTRM, CM_EURO, KC_NO, - KC_TRNS, CM_BSLS, CM_LCBR, CM_RCBR, KC_NO, CM_TILD, KC_TRNS, + KC_TRNS, CM_BSLS, CM_LCBR, CM_RCBR, MUC(ELPS),CM_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -305,10 +321,43 @@ void release_shift(void) { unregister_code(KC_LSHIFT); } +uint16_t hextokeycode(int hex) { + if (hex == 0x0) { + return KC_P0; + } else if (hex < 0xA) { + return KC_P1 + (hex - 0x1); + } else { + return KC_A + (hex - 0xA); + } +} + +void send_unicode(uint16_t unicode) +{ + // For more info on how this works per OS, see here: https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input + // Implemented for Windows: + // Pressing ALT followed by + followed by the unicode code point in hex. + // Requires registry key HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad set to String 1 + register_code(KC_LALT); + register_code(KC_PPLS); + unregister_code(KC_PPLS); + + for (int i = 12; i >= 0; i -= 4) { + register_code(hextokeycode((unicode >> i) & 0xF)); + unregister_code(hextokeycode((unicode >> i) & 0xF)); + } + + unregister_code(KC_LALT); +} + 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 ... END_UC: + if (record->event.pressed) { + send_unicode(unicode_chars[id]); + } + break; case M_TGCM: if (record->event.pressed) { default_layer_xor(1 << LR_CSA); @@ -364,7 +413,7 @@