Stephan Bösebeck 2016-03-20 22:07:53 +01:00
commit 64495d11ba
11 changed files with 3391 additions and 2963 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 KiB

After

Width:  |  Height:  |  Size: 379 KiB

View File

@ -3,8 +3,7 @@
#include "action_layer.h" #include "action_layer.h"
#define BASE 0 // default layer #define BASE 0 // default layer
#define QWERTY 1 // qwerty keys #define FKEYS 1 // F keys + macros
#define FKEYS 2 // F keys + macros
#define MACRO_PUBLIC 10 #define MACRO_PUBLIC 10
#define MACRO_PRIVATE 11 #define MACRO_PRIVATE 11
@ -43,12 +42,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Tab~CL| < | > | | | & | | = | + | - | * | L1 | * |Tab~CL| < | > | | | & | | = | + | - | * | L1 |
* `----------------------------------' `----------------------------------' * `----------------------------------' `----------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* |. ~L1 | , ~L2| |Home~L1| End~L2| * |. ~L1 | , | |Home |End~L1|
* ,------|------|------| |------+--------+------. * ,------|------|------| |------+------+------.
* | | | Copy | | UP | | | * | | | Copy | | UP | | |
* | Enter| Space|------| |------| Space |Enter | * | Enter| Space|------| |------| Space|Enter |
* | ~LSFT| ~WIN | Past | | DOWN | ~WIN | ~LSFT| * | ~WIN | ~LSFT| Past | | DOWN | ~LSFT| ~WIN |
* `--------------------' `----------------------' * `--------------------' `--------------------'
*/ */
// If it accepts an argument (i.e, is a function), it doesn't need KC_. // If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_* // Otherwise, it needs KC_*
@ -59,110 +58,68 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCBR, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LCBR, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_RCBR, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_SLASH, KC_RCBR, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_SLASH,
CTL_T(KC_TAB), LSFT(KC_COMMA),LSFT(KC_DOT),KC_PIPE,KC_AMPR, CTL_T(KC_TAB), LSFT(KC_COMMA),LSFT(KC_DOT),KC_PIPE,KC_AMPR,
LT(1,KC_DOT), LT(2,KC_COMM), LT(1,KC_DOT), KC_COMM,
LCTL(KC_C), LCTL(KC_C),
SFT_T(KC_ENTER),GUI_T(KC_SPACE),LCTL(KC_V), GUI_T(KC_ENTER),SFT_T(KC_SPACE),LCTL(KC_V),
// right hand // right hand
LCTL(KC_S) , KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRACKET, LCTL(KC_S) , KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRACKET,
KC_DELETE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET, KC_DELETE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET,
KC_H, KC_J, KC_K, KC_L, KC_UNDS,LCTL(KC_Y), KC_H, KC_J, KC_K, KC_L, KC_UNDS,LCTL(KC_Y),
KC_SCOLON,KC_N, KC_M, KC_QUOTE ,KC_EXLM , LSFT(KC_SLASH), LCTL(KC_Z), KC_SCOLON,KC_N, KC_M, KC_QUOTE ,KC_EXLM , LSFT(KC_SLASH), LCTL(KC_Z),
KC_EQUAL,KC_PLUS , KC_MINUS,KC_ASTR , TG(1), KC_EQUAL,KC_PLUS , KC_MINUS,KC_ASTR , TG(1),
LT(2,KC_HOME), LT(1,KC_END), KC_HOME, LT(1,KC_END),
KC_UP, KC_UP,
KC_DOWN,GUI_T(KC_SPACE), SFT_T(KC_ENTER) KC_DOWN,SFT_T(KC_SPACE), GUI_T(KC_ENTER)
), ),
/* Keymap 1: QWERTY layer
/* Keymap 1: F keys + macros
* *
* ,--------------------------------------------------. ,--------------------------------------------------. * ,--------------------------------------------------. ,--------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | | * | ESC | F1 | F2 | F3 | F4 | F5 | ` | | Calc | F6 | F7 | F8 | F9 | F10 | F11 |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | | * | Tab |Public|Static|string|int |return| | | |//TODO| | | | | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
* |--------+------+------+------+------+------| Tab | | Esc |------+------+------+------+------+--------|
* | LSHFT | Z | X | C | V | B | | | | N | M | , | . | / | \ |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | CTRL | WIN | ALT |ALT GR| Esc | | PgUp | PgDw | Ins | PtSc | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | Cut | | | |
* ,------|------|------| |------+--------+------.
* | | | | | | | |
* | | |------| |------| Left | Right|
* | | | | | | | |
* `--------------------' `----------------------'
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
[QWERTY] = KEYMAP( // layer 2 : QWERTY
// left hand
KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINUS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS,
KC_ESCAPE, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TAB,
KC_LCTRL, KC_LGUI,KC_LALT, KC_RALT, KC_ESCAPE,
KC_TRNS, LCTL(KC_X),
KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,
// right hand
KC_EQUAL , KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS,
KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE,
KC_ESCAPE,KC_N, KC_M, KC_TRNS,KC_DOT , KC_SLASH, KC_NONUS_BSLASH,
KC_PGUP , KC_PGDOWN,KC_INSERT ,KC_PSCREEN, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS,KC_LEFT, KC_RIGHT
),
/* Keymap 2: F keys + macros
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | | | Calc | F6 | F7 | F8 | F9 | F10 | F11 |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | |Public|Static|string|int |return| | | |//TODO| | | | | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | |Privat|Const |var |float |null |------| |------|new | | | | | | * | |Privat|Const |var |float |null |------| |------|new | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| \ | | ~ |------+------+------+------+------+--------|
* | | | |void |bool |break;| | | |(); | | | | | | * | | | |void |bool |break;| | | |(); | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | Alt | | | | | | | | | | * | | WIN | Alt | | | | PgUp | PgDw | Ins | PtSc | |
* `----------------------------------' `----------------------------------' * `----------------------------------' `----------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | | Cut | | | | * | | Cut | | | |
* ,------|------|------| |------+------+------. * ,------|------|------| |------+------+------.
* | | | | | | | | * | | | | | | | |
* | | |------| |------| | | * | | |------| |------| Left | Right|
* | | | | | | | | * | | | | | | | |
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
// FKEYS + MACROS // FKEYS + MACROS
[FKEYS] = KEYMAP( [FKEYS] = KEYMAP(
// left hand // left hand
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_GRAVE,
KC_TRNS,M(MACRO_PUBLIC),M(MACRO_STATIC), M(MACRO_STRING),M(MACRO_INT),M(MACRO_RETURN),KC_TRNS, KC_TAB,M(MACRO_PUBLIC),M(MACRO_STATIC), M(MACRO_STRING),M(MACRO_INT),M(MACRO_RETURN),KC_TRNS,
KC_TRNS,M(MACRO_PRIVATE),M(MACRO_CONST), M(MACRO_VAR),M(MACRO_FLOAT),M(MACRO_NULL), KC_TRNS,M(MACRO_PRIVATE),M(MACRO_CONST), M(MACRO_VAR),M(MACRO_FLOAT),M(MACRO_NULL),
KC_TRNS,KC_TRNS,KC_TRNS,M(MACRO_VOID),M(MACRO_BOOL),M(MACRO_BREAK),KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,M(MACRO_VOID),M(MACRO_BOOL),M(MACRO_BREAK),KC_BSLASH,
KC_TRNS,KC_LALT,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_LGUI,KC_LALT,KC_TRNS,KC_TRNS,
KC_TRNS,KC_TRNS, KC_TRNS,LCTL(KC_X),
KC_TRNS, KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,
// right hand // right hand
KC_CALCULATOR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_CALCULATOR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, M(MACRO_TODO), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, KC_TRNS, M(MACRO_TODO), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12,
M(MACRO_NEW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(MACRO_NEW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, M(MACRO_PARENTHESE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TILD, M(MACRO_PARENTHESE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP,KC_PGDOWN, KC_INSERT, KC_PSCREEN, 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_RIGHT
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(QWERTY) // FN1 - Momentary Layer 1 [1] = ACTION_LAYER_TAP_TOGGLE(FKEYS) // FN1 - Momentary Layer 1
}; };
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)

View File

@ -4,6 +4,8 @@
* Feb 12, 2016 (V1): * Feb 12, 2016 (V1):
* First version commit * First version commit
* Mar 20, 2016 (V2):
* Removed "Classic QWERTY" layer, inverted GUI and SHIFT on Hold for Space and Enter
## About ## About
This layout was conceived in an attempt to optimise keyboard layout for developers (C# more specifically, but it can work with most of other languages), and limit the keys required to perform the most frequent actions. This layout was conceived in an attempt to optimise keyboard layout for developers (C# more specifically, but it can work with most of other languages), and limit the keys required to perform the most frequent actions.
@ -38,7 +40,6 @@ Still there are many way to improve or iterate on this:
* Make it language agnostic * Make it language agnostic
* Check and compile language's keyboard's heatmaps to statistically define keys priority (e.g. https://dzone.com/articles/most-pressed-keys-various ) * Check and compile language's keyboard's heatmaps to statistically define keys priority (e.g. https://dzone.com/articles/most-pressed-keys-various )
* QWERTY is still not the most efficient typing layout, I would like to create a Dvorak based similar layout in a near futur * QWERTY is still not the most efficient typing layout, I would like to create a Dvorak based similar layout in a near futur
* Layout 1 is mainly here for safety, most of its unique keys could be transfered to Layout 2 and it could then be removed
## Issues ## Issues
One of the issues encountered while creating this layout was that I did not find a way to have a key to send a modifier on hold, and a key combination while pressed (e.g. I can't set a Key to do Save (Ctrl + S) when pressed and Shift modifier when hold ) One of the issues encountered while creating this layout was that I did not find a way to have a key to send a modifier on hold, and a key combination while pressed (e.g. I can't set a Key to do Save (Ctrl + S) when pressed and Shift modifier when hold )

View File

@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' |
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------|
* | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(SYMB), KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(SYMB),
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL,
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT,
KC_LALT, F(LWIN), KC_LALT, F(LWIN),
KC_HOME, KC_HOME,
@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
TG(SYMB), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, TG(SYMB), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
MEH_T(KC_NO),KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, KC_MINS, KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO),
KC_LALT, KC_RALT, KC_LALT, KC_RALT,
KC_PGUP, KC_PGUP,
@ -73,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' |
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------|
* | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
@ -94,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
KC_DELT, CM_Q, CM_W, CM_F, CM_P, CM_G, TG(SYMB), KC_DELT, CM_Q, CM_W, CM_F, CM_P, CM_G, TG(SYMB),
KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D, KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D,
KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, ALL_T(KC_NO), KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, KC_EQL,
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT,
KC_LALT, F(LWIN), KC_LALT, F(LWIN),
KC_HOME, KC_HOME,
@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
TG(SYMB), CM_J, CM_L, CM_U, CM_Y, KC_P, /*CM_SCLN*/ KC_BSLS, TG(SYMB), CM_J, CM_L, CM_U, CM_Y, KC_P, /*CM_SCLN*/ KC_BSLS,
CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT, CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT,
MEH_T(KC_NO),CM_K, CM_M, CM_COMM,CM_DOT, CTL_T(CM_SLSH), KC_RSFT, KC_MINS, CM_K, CM_M, CM_COMM,CM_DOT, CTL_T(CM_SLSH), KC_RSFT,
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO),
KC_LALT, KC_RALT, KC_LALT, KC_RALT,
KC_PGUP, KC_PGUP,
@ -222,22 +222,27 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
} else { } else {
unregister_code(KC_LGUI); unregister_code(KC_LGUI);
} }
break;
case PC1: case PC1:
if (!record->event.pressed) { if (!record->event.pressed) {
return MACRO(T(SLCK), T(SLCK), T(1), T(ENT), END); return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(1), W(50), T(ENT), END);
} }
break;
case PC2: case PC2:
if (!record->event.pressed) { if (!record->event.pressed) {
return MACRO(T(SLCK), T(SLCK), T(2), T(ENT), END); return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(2), W(50), T(ENT), END);
} }
break;
case PC3: case PC3:
if (!record->event.pressed) { if (!record->event.pressed) {
return MACRO(T(SLCK), T(SLCK), T(3), T(ENT), END); return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(3), W(50), T(ENT), END);
} }
break;
case PC4: case PC4:
if (!record->event.pressed) { if (!record->event.pressed) {
return MACRO(T(SLCK), T(SLCK), T(4), T(ENT), END); return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(4), W(50), T(ENT), END);
} }
break;
} }
return MACRO_NONE; return MACRO_NONE;
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,34 @@
#Planck Advanced (but not too advanced) `cygwin` Users Guide #Planck Advanced (but not too advanced) `cygwin` Users Guide
If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you. If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you.
This guide was written step by step as I went through the process on a `Windows 10` `x86_64` and a `Windows 7` `amd k10` based system. This should be generally applicable to to any `Windows` environment with `cygwin`.
This guide was written step by step as I went through the process on a `Windows 10` `x86_64` based system. This should be generally applicable to to any `Windows` environment with `cygwin`.
#####Do not skip steps. Do not move past a step until the previous step finishes successfully. #####Do not skip steps. Do not move past a step until the previous step finishes successfully.
Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html) Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html)
##Get the Required Packages ##Get the Required Packages
Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected: Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected:
- devel/git
- devel/gcc-core - devel/gcc-core
- devel/gcc-g++ - devel/gcc-g++
- devel/flex - devel/flex
- devel/git - devel/bison
- libs/libglib2.0_0 - devel/make
- devel/texinfo
- devel/gettext-devel
- devel/automake
- devel/autoconfig
- devel/libtool
- text/gettext
- libs/libgcc1 - libs/libgcc1
- interpreters/m4 - interpreters/m4
- web/wget - web/wget
- archive/unzip
The following sources will be required: The following sources will be required:
- [gmp](https://gmplib.org/) (6.1.0) - [gmp](https://gmplib.org/) (6.1.0)
- [mpfr](http://www.mpfr.org/) (3.1.3) - [mpfr](http://www.mpfr.org/) (3.1.4)
- [mpc](http://www.multiprecision.org/) (1.0.3) - [mpc](http://www.multiprecision.org/) (1.0.3)
- [binutils](https://www.sourceware.org/binutils/) (2.26) - [binutils](https://www.sourceware.org/binutils/) (2.26)
- [gcc](https://gcc.gnu.org/) (5.3.0) - [gcc](https://gcc.gnu.org/) (5.3.0)
@ -34,21 +37,20 @@ The following sources will be required:
The `dfu-programmer` will be required to flash the new firmware The `dfu-programmer` will be required to flash the new firmware
- [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2) - [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2)
The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive
``` ```
$ mkdir ~/local
$ mkdir ~/local/avr $ mkdir ~/local/avr
$ mkdir ~/src $ mkdir ~/src
$ cd ~/src $ cd ~/src
$ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2 $ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2
$ wget http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.bz2 $ wget http://www.mpfr.org/mpfr-3.1.4/mpfr-3.1.4.tar.bz2
$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz $ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz $ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz
$ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz $ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz
$ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2 $ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2
$ tar -xjf gmp-6.1.0.tar.bz2 $ tar -xjf gmp-6.1.0.tar.bz2
$ tar -xjf mpfr-3.1.3.tar.bz2 $ tar -xjf mpfr-3.1.4.tar.bz2
$ tar -zxf mpc-1.0.3.tar.gz $ tar -zxf mpc-1.0.3.tar.gz
$ tar -zxf binutils-2.26.tar.gz $ tar -zxf binutils-2.26.tar.gz
$ tar -zxf gcc-5.3.0.tar.gz $ tar -zxf gcc-5.3.0.tar.gz
@ -61,12 +63,12 @@ These commands will set up the install directory and the `PATH` variable, which
$ PREFIX=$HOME/local/avr $ PREFIX=$HOME/local/avr
$ export PREFIX $ export PREFIX
$ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS $ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS
$ PATH=$PATH:$PREFIX/bin $ PATH=$PATH:$PREFIX/bin:$PREFIX/lib
$ export PATH $ export PATH
``` ```
##The `gcc` Required Math Library Packages ##The `gcc` Required Math Library Packages
The following packages are required to be complied and installed in order to compile `gcc`. They are not available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. The following packages are required to be complied and installed in order to compile `gcc`. They are not sufficiently available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. Verfiy that for each package, `make check` returns all passing and no fails.
###Build and Install `gmp` ###Build and Install `gmp`
``` ```
@ -79,7 +81,7 @@ $ make install
###Build and Install `mpfr` ###Build and Install `mpfr`
``` ```
$ cd ~/src/mpfr-3.1.3 $ cd ~/src/mpfr-3.1.4
$ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared $ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared
$ make $ make
$ make check $ make check
@ -96,8 +98,9 @@ $ make install
``` ```
##OPTIONAL Part ##OPTIONAL Part
You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). I would skip it. You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while).
###Build and Install `gcc` on your Machine
###Build and Install `gcc` for Your Machine
``` ```
$ cd ~/src/gcc-5.3.0 $ cd ~/src/gcc-5.3.0
$ mkdir obj-local $ mkdir obj-local
@ -106,8 +109,9 @@ $ ../configure --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/l
$ make $ make
$ make install $ make install
``` ```
##End OPTIONAL Part
###Build and Install `binutils` on your Machine ###Build and Install `binutils` for Your Machine
``` ```
$ cd ~/src/binutils-2.26 $ cd ~/src/binutils-2.26
$ mkdir obj-local $ mkdir obj-local
@ -116,12 +120,12 @@ $ ../configure
$ make $ make
$ make install $ make install
``` ```
##End OPTIONAL Part
##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system ##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system
Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard. Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard.
###Build `binutils` for AVR ###Build `binutils` for AVR
If you plan to build and install `avr-gdb` also, use the `gdb` install at the end of this guide as it also builds the `binutils`
``` ```
$ cd ~/src/binutils-2.26 $ cd ~/src/binutils-2.26
$ mkdir obj-avr $ mkdir obj-avr
@ -141,9 +145,8 @@ $ make
$ make install $ make install
``` ```
For building the `avr-libc`, we have to specify the host build system. in my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`.
###Build `avr-libc` for AVR ###Build `avr-libc` for AVR
For building the `avr-libc`, we have to specify the host build system. In my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`.
``` ```
$ cd ~/src/avr-libc-2.0.0 $ cd ~/src/avr-libc-2.0.0
$ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr $ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr
@ -151,16 +154,36 @@ $ make
$ make install $ make install
``` ```
##Install `dfu-programmer` ##Building 'dfu-programmer' for flashing the firmware via USB and installing the drivers
To install the `dfu-programmer`, we must get if from [their website](https://dfu-programmer.github.io/) (no fancy command line tricks here, but [this](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip) might work). We can either build our own, or use the precomplied binaries. The precompiled binaries don't play well with `cygwin` so it is better to build them ourselves. The procedure for the precompiled binaries is included at the end of this guide.
Copy this file into your `cygwin` home directory. (For me, it is `C:\cygwin64\home\Kevin`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `dfu/dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. I achieved this by moving the files with Windows Explorer (you know, click and drag...) to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running:
### Build and Install the `libusb`
The `dfu-programmer` requires `libusb` so that it can interact with the USB system. These repos must be bootstrapped in order to create an appropriate `./configure` and `Makefile` for your system.
``` ```
C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin $ cd ~/src
$ git clone https://github.com/libusb/libusb.git
$ cd libusb
$ ./bootstrap.sh
$ ./configure
$ make
$ make install
``` ```
Adjust your path (for username) as needed. Also, `libusb0_x86.dll` needs to be renamed to `libusb0.dll`. Why must this be so hard? You can tell that you were successful this way:
### Build and Install the `dfu-programmer`
```
$ cd ~/src
$ git clone https://github.com/dfu-programmer/dfu-programmer.git
$ cd dfu-programmer
$ ./bootstrap.sh
$ ./configure
$ make
$ make install
```
Verify the installation with:
``` ```
$ which dfu-programmer $ which dfu-programmer
/home/Kevin/local/avr/bin/dfu-programmer /usr/local/bin/dfu-programmer
$ dfu-programmer $ dfu-programmer
dfu-programmer 0.7.2 dfu-programmer 0.7.2
@ -169,14 +192,26 @@ Type 'dfu-programmer --help' for a list of commands
'dfu-programmer --targets' to list supported target devices 'dfu-programmer --targets' to list supported target devices
``` ```
If you are not getting the above result, you will not be able to flash the firmware! If you are not getting the above result, you will not be able to flash the firmware!
- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`.
- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permissions correctly. If you did it anyway, do `chmod 755 dfu-programmer.exe`
####Install the USB drivers ###Install the USB drivers
These drivers are included in the `dfu-programmer` 0.7.2 (but you can get newer ones [here](http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip)) and allow the `dfu-programmer` to program the firmware. From an **administrator-privileged** `Windows` terminal, run the following command (adjust the path as necessary) and accept the prompt that pops up: The drivers are included in the windows binary version of [`dfu-programmer` 0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip).
``` ```
C:\> pnputil -i -a C:\cygwin64\home\Kevin\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf $ cd ~/src
$ wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip
$ unzip dfu-programmer-win-0.7.2.zip -d dfu-programmer-win-0.7.2
``` ```
or
The official drivers are found in [Atmel's `FLIP` installer](http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe). Download and then install `FLIP`. Upon installation, the drivers will be found in `C:\Program Files (x86)\Atmel\Flip 3.4.7\usb`.
Then, from an **administrator-privileged** `Windows` terminal, run the following command (adjust the path for username, etc. as necessary) and accept the prompt that pops up:
```
C:\> pnputil -i -a C:\cygwin64\home\Kevin\src\dfu-programmer-win-0.7.2\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf
or
C:\> pnputil -i -a "C:\Program Files (x86)\Atmel\Flip 3.4.7\usb\atmel_usb_dfu.inf"
```
This should be the result: This should be the result:
``` ```
Microsoft PnP Utility Microsoft PnP Utility
@ -191,8 +226,9 @@ Total attempted: 1
Number successfully imported: 1 Number successfully imported: 1
``` ```
##Building and Flashing the Planck firmware! Alternatively, the `Windows` driver can be installed when prompted by `Windows` when the keyboard is attached. Do not let `Windows` search for a driver; specify the path to search for a driver and point it to the `atmel_usb_dfu.inf` file.
##Building and Flashing the Planck firmware!
If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it. If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it.
###Build Planck and Load the Firmware ###Build Planck and Load the Firmware
@ -202,8 +238,8 @@ $ git clone https://github.com/jackhumbert/qmk_firmware.git
$ cd qmk_firmware/keyboard/planck $ cd qmk_firmware/keyboard/planck
$ make $ make
``` ```
Make sure there are no errors. You should end up with this or something similar:
Make sure there are no errors. You should end up with this or something similar:
``` ```
Creating load file for Flash: planck.hex Creating load file for Flash: planck.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex
@ -225,7 +261,7 @@ Size after:
-------- end -------- -------- end --------
``` ```
If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from github, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed. If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from `github`, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed.
But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then: But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then:
``` ```
@ -235,3 +271,82 @@ $ make dfu
. .
. .
profit!!! profit!!!
##extra bits...
###Installing Precompiled `dfu-programmer` Binaries (not recommended for `cygwin`)
To install the `dfu-programmer` from the binaries, we must get if from [the `dfu-programmer` website](https://dfu-programmer.github.io/) ([0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip)).
Copy this file into your `cygwin` home\src directory. (For me, it is `C:\cygwin64\home\Kevin\src`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `./dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. This is because the `dfu-programmer` binary is `mingw` based, not `cygwin` based, so the `dlls` do not cooperate. I achieved acceptable pathing by moving the files to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running (Adjusting your path for username, etc. as needed):
```
C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin
```
Then, rename `libusb0_x86.dll` to `libusb0.dll`.
You can tell that you were successful by trying to execute 'dfu-programmer' from the 'cygwin' prompt:
```
$ which dfu-programmer
/home/Kevin/local/avr/bin/dfu-programmer
$ dfu-programmer
dfu-programmer 0.7.2
https://github.com/dfu-programmer/dfu-programmer
Type 'dfu-programmer --help' for a list of commands
'dfu-programmer --targets' to list supported target devices
```
If you are not getting the above result, you will not be able to flash the firmware!
- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`.
- Make sure the `dll` is named correctly.
- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permission. If you did it anyway, do `chmod +x dfu-programmer.exe`.
- Still have problems? Try building it instead.
##Debugging Tools
These tools are for debugging your firmware, etc. before flashing. Theoretically, it can save your memory from wearing out. However, these tool do not work 100% for the Planck firmware.
### `gdb` for AVR
`gdb` has a simulator for AVR but it does not support all instructions (like WDT), so it immediately crashes when running the Planck firmware (because `lufa.c` disables the WDT in the first few lines of execution). But it can still be useful in debugging example code and test cases, if you know how to use it.
```
$ cd ~/src
$ git clone git://sourceware.org/git/binutils-gdb.git
$ cd binutils-gdb
$ mkdir obj-avr
$ cd obj-avr
$ ../configure --prefix=$PREFIX --target=avr --build=x86_64-unknown-cygwin --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-nls --enable-static
$ make
$ make install
```
### `simulavr`
`simulavr` is an AVR simulator. It runs the complied AVR elfs. `simulavr` does not support the `atmega32u4` device... it does `atmega32` but that is not good enough for the firmware (no PORTE and other things), so you cannot run the Planck firmware. I use it to simulate ideas I have for features in separate test projects.
This one is a major pain in the butt because it has a lot of dependencies and it is buggy. I will do my best to explain it but... it was hard to figure out. A few things need to be changed in the 'Makefile' to make it work in `cygwin`.
```
$ cd ~/src
$ git clone https://github.com/Traumflug/simulavr.git
$ cd simulavr
$ ./bootstrap
$ ./configure --prefix=$PREFIX --enable-static --disable-tcl --disable-doxygen-doc
```
Edit `src/Makefile.am` now so that `-no-undefined` is included (I did this by removing the SYS_MINGW conditional surrounding `libsim_la_LDFLAGS += -no-undefined` and `libsimulavr_la_LDFLAGS += -no-undefined \ libsimulavr_la_LIBADD += $(TCL_LIB)`. Also, `$(EXEEXT)` is added after `kbdgentables` in two places.
```
$ make
$ make install
```
TODO:
- git repos for all sources
- command line magic for cygwin setup
- better options for `dfu-drivers`

View File

@ -0,0 +1,49 @@
#include "keymap_common.h"
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP(
TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC,
LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN3,
ESC, DEL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT),
[1] = KEYMAP(
GRV, GRV, FN22, FN19, FN10, TRNS, TRNS, 7, 8, 9, 0, BSPC,
TRNS, LBRC, RBRC, FN23, FN24, TRNS, TRNS, 4, 5, 6, TRNS, BSLS,
TRNS, MINS, FN20, EQL, FN21, TRNS, TRNS, 1, 2, 3, TRNS, ENT,
TRNS, TRNS, TRNS, TRNS, TRNS, SPC, FN1, TRNS, PGDN, PGUP, TRNS),
[2] = KEYMAP(
FN26, FN10, FN11, FN12, FN13, FN14, FN15, FN17, FN18, FN19, FN10, DEL,
TRNS, TRNS, MUTE, VOLD, VOLU, TRNS, BSPC, FN14, FN15, FN16, TRNS, FN25,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN11, FN12, FN13, TRNS, ENT,
TRNS, TRNS, TRNS, TRNS, FN2, ENT, TRNS, TRNS, PGDN, PGUP, TRNS),
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_MOMENTARY(1), // Switch layer raise
[2] = ACTION_LAYER_MOMENTARY(2), // Switch layer lower
[3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), // Right shift serves as Enter on tap
// Numeric shift modifiers
[10] = ACTION_MODS_KEY(MOD_LSFT, KC_0),
[11] = ACTION_MODS_KEY(MOD_LSFT, KC_1),
[12] = ACTION_MODS_KEY(MOD_LSFT, KC_2),
[13] = ACTION_MODS_KEY(MOD_LSFT, KC_3),
[14] = ACTION_MODS_KEY(MOD_LSFT, KC_4),
[15] = ACTION_MODS_KEY(MOD_LSFT, KC_5),
[16] = ACTION_MODS_KEY(MOD_LSFT, KC_6),
[17] = ACTION_MODS_KEY(MOD_LSFT, KC_7),
[18] = ACTION_MODS_KEY(MOD_LSFT, KC_8),
[19] = ACTION_MODS_KEY(MOD_LSFT, KC_9),
// Other shift modifiers
[20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _
[21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // +
[22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~
[23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // {
[24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // }
[25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // |
// Switch windows in app
[26] = ACTION_MODS_KEY(MOD_LGUI, KC_GRV),
};

View File

@ -0,0 +1,311 @@
/* Keymap macros for the French BÉPO layout - http://bepo.fr */
#ifndef KEYMAP_BEPO_H
#define KEYMAP_BEPO_H
#include "keymap_common.h"
// Alt gr
#ifndef ALTGR
#define ALTGR(kc) RALT(kc)
#endif
#ifndef ALGR
#define ALGR(kc) ALTGR(kc)
#endif
#define BP_ALGR KC_RALT
// Normal characters
// First row (on usual keyboards)
#define BP_DOLLAR KC_GRAVE // $
#define BP_DLR BP_DOLLAR
#define BP_DOUBLE_QUOTE KC_1 // "
#define BP_DQOT BP_DOUBLE_QUOTE
#define BP_LEFT_GUILLEMET KC_2 // «
#define BP_LGIL BP_LEFT_GUILLEMET
#define BP_RIGHT_GUILLEMET KC_3 // »
#define BP_RGIL BP_RIGHT_GUILLEMET
#define BP_LEFT_PAREN KC_4 // (
#define BP_LPRN BP_LEFT_PAREN
#define BP_RIGHT_PAREN KC_5 // )
#define BP_RPRN BP_RIGHT_PAREN
#define BP_AT KC_6 // @
#define BP_PLUS KC_7 // +
#define BP_MINUS KC_8 // -
#define BP_MINS BP_MINUS
#define BP_SLASH KC_9 // /
#define BP_SLSH BP_SLASH
#define BP_ASTERISK KC_0 // *
#define BP_ASTR BP_ASTERISK
#define BP_EQUAL KC_MINUS // =
#define BP_EQL BP_EQUAL
#define BP_PERCENT KC_EQUAL // %
#define BP_PERC BP_PERCENT
// Second row
#define BP_B KC_Q
#define BP_E_ACUTE KC_W // é
#define BP_ECUT BP_E_ACUTE
#define BP_P KC_E
#define BP_O KC_R
#define BP_E_GRAVE KC_T // è
#define BP_EGRV BP_E_GRAVE
#define BP_DEAD_CIRCUMFLEX KC_Y // dead ^
#define BP_DCRC BP_DEAD_CIRCUMFLEX
#define BP_V KC_U
#define BP_D KC_I
#define BP_L KC_O
#define BP_J KC_P
#define BP_Z KC_LBRACKET
#define BP_W KC_RBRACKET
// Third row
#define BP_A KC_A
#define BP_U KC_S
#define BP_I KC_D
#define BP_E KC_F
#define BP_COMMA KC_G // ,
#define BP_COMM BP_COMMA
#define BP_C KC_H
#define BP_T KC_J
#define BP_S KC_K
#define BP_R KC_L
#define BP_N KC_SCOLON
#define BP_M KC_QUOTE
#define BP_C_CEDILLA KC_BSLASH // ç
#define BP_CCED BP_C_CEDILLA
// Fourth row
#define BP_E_CIRCUMFLEX KC_NONUS_BSLASH // ê
#define BP_ECRC BP_E_CIRCUMFLEX
#define BP_A_GRAVE KC_Z // à
#define BP_AGRV BP_A_GRAVE
#define BP_Y KC_X
#define BP_X KC_C
#define BP_DOT KC_V // .
#define BP_K KC_B
#define BP_APOSTROPHE KC_N
#define BP_APOS BP_APOSTROPHE // '
#define BP_Q KC_M
#define BP_G KC_COMMA
#define BP_H KC_DOT
#define BP_F KC_SLASH
// Shifted characters
// First row
#define BP_HASH LSFT(BP_DOLLAR) // #
#define BP_1 LSFT(KC_1)
#define BP_2 LSFT(KC_2)
#define BP_3 LSFT(KC_3)
#define BP_4 LSFT(KC_4)
#define BP_5 LSFT(KC_5)
#define BP_6 LSFT(KC_6)
#define BP_7 LSFT(KC_7)
#define BP_8 LSFT(KC_8)
#define BP_9 LSFT(KC_9)
#define BP_0 LSFT(KC_0)
#define BP_DEGREE LSFT(BP_EQUAL) // °
#define BP_DEGR BP_DEGREE
#define BP_GRAVE LSFT(BP_PERCENT) // `
#define BP_GRV BP_GRAVE
// Second row
#define BP_EXCLAIM LSFT(BP_DEAD_CIRCUMFLEX) // !
#define BP_EXLM BP_EXCLAIM
// Third row
#define BP_SCOLON LSFT(BP_COMMA) // ;
#define BP_SCLN BP_SCOLON
// Fourth row
#define BP_COLON LSFT(BP_DOT) // :
#define BP_COLN BP_COLON
#define BP_QUESTION LSFT(BP_QUOTE) // ?
#define BP_QEST BP_QUESTION
// Space bar
#define BP_NON_BREAKING_SPACE LSFT(KC_SPACE)
#define BP_NBSP BP_NON_BREAKING_SPACE
// AltGr-ed characters
// First row
#define BP_EN_DASH ALTGR(BP_DOLLAR) //
#define BP_NDSH BP_EN_DASH
#define BP_EM_DASH ALTGR(KC_1) // —
#define BP_MDSH BP_EM_DASH
#define BP_LESS ALTGR(KC_2) // <
#define BP_GREATER ALTGR(KC_3) // >
#define BP_GRTR BP_GREATER
#define BP_LBRACKET ALTGR(KC_4) // [
#define BP_LBRC BP_LBRACKET
#define BP_RBRACKET ALTGR(KC_5) // ]
#define BP_RBRC BP_RBRACKET
#define BP_CIRCUMFLEX ALTGR(KC_6) // ^
#define BP_CIRC BP_CIRCUMFLEX
#define BP_PLUS_MINUS ALTGR(KC_7) // ±
#define BP_PSMS BP_PLUS_MINUS
#define BP_MATH_MINUS ALTGR(KC_8) //
#define BP_MMNS BP_MATH_MINUS
#define BP_OBELUS ALTGR(KC_9) // ÷
#define BP_OBEL BP_OBELUS
// more conventional name of the symbol
#define BP_DIVISION_SIGN BP_OBELUS
#define BP_DVSN BP_DIVISION_SIGN
#define BP_TIMES ALTGR(KC_0) // ×
#define BP_TIMS BP_TIMES
#define BP_DIFFERENT ALTGR(BP_EQUAL) // ≠
#define BP_DIFF BP_DIFFERENT
#define BP_PERMILLE ALTGR(BP_PERCENT) // ‰
#define BP_PMIL BP_PERMILLE
// Second row
#define BP_PIPE ALTGR(BP_B) // |
#define BP_DEAD_ACUTE ALTGR(BP_E_ACUTE) // dead ´
#define BP_DACT BP_DEAD_ACUTE
#define BP_AMPERSAND ALTGR(BP_P) // &
#define BP_AMPR BP_AMPERSAND
#define BP_OE_LIGATURE ALTGR(BP_O) // œ
#define BP_OE BP_OE_LIGATURE
#define BP_DEAD_GRAVE ALTGR(BP_E_GRAVE) // `
#define BP_DGRV BP_DEAD_GRAVE
#define BP_INVERTED_EXCLAIM ALTGR(BP_DEAD_CIRCUMFLEX) // ¡
#define BP_IXLM BP_INVERTED_EXCLAIM
#define BP_DEAD_CARON ALTGR(BP_V) // dead ˇ
#define BP_DCAR BP_DEAD_CARON
#define BP_ETH ALTGR(BP_D) // ð
#define BP_DEAD_SLASH ALTGR(BP_L) // dead /
#define BP_DSLH BP_DEAD_SLASH
#define BP_IJ_LIGATURE ALTGR(BP_J) // ij
#define BP_IJ BP_IJ_LIGATURE
#define BP_SCHWA ALTGR(BP_Z) // ə
#define BP_SCWA BP_SCHWA
#define BP_DEAD_BREVE ALTGR(BP_W) // dead ˘
#define BP_DBRV BP_DEAD_BREVE
// Third row
#define BP_AE_LIGATURE ALTGR(BP_A) // æ
#define BP_AE BP_AE_LIGATURE
#define BP_U_GRAVE AGR(BP_U) // ù
#define BP_UGRV BP_U_GRAVE
#define BP_DEAD_TREMA ALTGR(BP_I) // dead ¨ (trema/umlaut/diaresis)
#define BP_DTRM BP_DEAD_TREMA
#define BP_EURO ALTGR(BP_E) // €
#define BP_TYPOGRAPHICAL_APOSTROPHE ALTGR(BP_COMMMA) //
#define BP_TAPO BP_TYPOGRAPHICAL_APOSTROPHE
#define BP_COPYRIGHT ALTGR(BP_C) // ©
#define BP_CPRT BP_COPYRIGHT
#define BP_THORN ALTGR(BP_T) // þ
#define BP_THRN BP_THORN
#define BP_SHARP_S ALTGR(BP_S) // ß
#define BP_SRPS BP_SHARP_S
#define BP_REGISTERED_TRADEMARK ALTGR(BP_R) // ®
#define BP_RTM BP_REGISTERED_TRADEMARK
#define BP_DEAD_TILDE ALTGR(BP_N) // dead ~
#define BP_DTLD BP_DEAD_TILDE
#define BP_DEAD_MACRON ALTGR(BP_M) // dead ¯
#define BP_DMCR BP_DEAD_MACRON
#define BP_DEAD_CEDILLA ALTGR(BP_C_CEDILLA) // dead ¸
#define BP_DCED BP_DEAD_CEDILLA
// Fourth row
#define BP_NONUS_SLASH ALTGR(BP_E_CIRCUMFLEX) // / on non-us backslash key (102nd key, ê in bépo)
#define BP_NUSL BP_NONUS_SLASH
#define BP_BACKSLASH ALTGR(BP_A_GRAVE) /* \ */
#define BP_BSLS BP_BACKSLASH
#define BP_LEFT_CURLY_BRACE ALTGR(BP_Y) // {
#define BP_LCBR BP_LEFT_CURLY_BRACE
#define BP_RIGHT_CURLY_BRACE ALTGR(BP_X) // }
#define BP_RCBR BP_RIGHT_CURLY_BRACE
#define BP_ELLIPSIS ALTGR(BP_DOT) // …
#define BP_ELPS BP_ELLIPSIS
#define BP_TILDE ALTGR(BP_K) // ~
#define BP_TILD BP_TILDE
#define BP_INVERTED_QUESTION ALTGR(BP_QUESTION) // ¿
#define BP_IQST BP_INVERTED_QUESTION
#define BP_DEAD_RING ALTGR(BP_Q) // dead °
#define BP_DRNG BP_DEAD_RING
#define BP_DEAD_GREEK ALTGR(BP_G) // dead Greek key (following key will make a Greek letter)
#define BP_DGRK BP_DEAD_GREEK
#define BP_DAGGER ALTGR(BP_H) // †
#define BP_DAGR BP_DAGGER
#define BP_DEAD_OGONEK ALTGR(BP_F) // dead ˛
#define BP_DOGO BP_DEAD_OGONEK
// Space bar
#define BP_UNDERSCORE ALTGR(KC_SPACE) // _
#define BP_UNDS BP_UNDERSCORE
// AltGr-Shifted characters (different from capitalised AltGr-ed characters)
// First row
#define BP_PARAGRAPH ALTGR(BP_HASH) // ¶
#define BP_PARG BP_PARAGRAPH
#define BP_LOW_DOUBLE_QUOTE ALTGR(BP_1) // „
#define BP_LWQT BP_LOW_DOUBLE_QUOTE
#define BP_LEFT_DOUBLE_QUOTE ALTGR(BP_2) // “
#define BP_LDQT BP_LEFT_DOUBLE_QUOTE
#define BP_RIGHT_DOUBLE_QUOTE ALTGR(BP_3) // ”
#define BP_RDQT BP_RIGHT_DOUBLE_QUOTE
#define BP_LESS_OR_EQUAL ALTGR(BP_4) // ≤
#define BP_LEQL BP_LESS_OR_EQUAL
#define BP_GREATER_OR_EQUAL ALTGR(BP_5) // ≥
#define BP_GEQL BP_GREATER_OR_EQUAL
// nothing on ALTGR(BP_6)
#define BP_NEGATION ALTGR(BP_7) // ¬
#define BP_NEGT BP_NEGATION
#define BP_ONE_QUARTER ALTGR(BP_8) // ¼
#define BP_1QRT BP_ONE_QUARTER
#define BP_ONE_HALF ALTGR(BP_9) // ½
#define BP_1HLF BP_ONE_HALF
#define BP_THREE_QUARTERS ALTGR(BP_0) // ¾
#define BP_3QRT BP_THREE_QUARTERS
#define BP_MINUTES ALTGR(BP_DEGREE) //
#define BP_MNUT BP_MINUTES
#define BP_SECONDS ALTGR(BP_GRAVE) // ″
#define BP_SCND BP_SECONDS
// Second row
#define BP_BROKEN_PIPE LSFT(BP_PIPE) // ¦
#define BP_BPIP BP_BROKEN_PIPE
#define BP_DEAD_DOUBLE_ACUTE LSFT(BP_DEAD_ACUTE) // ˝
#define BP_DDCT BP_DEAD_DOUBLE_ACUTE
#define BP_SECTION ALTGR(LSFT(BP_P)) // §
#define BP_SECT BP_SECTION
// LSFT(BP_DEAD_GRAVE) is actually the same character as LSFT(BP_PERCENT)
#define BP_GRAVE_BIS LSFT(BP_DEAD_GRAVE) // `
#define BP_GRVB BP_GRAVE_BIS
// Third row
#define BP_DEAD_DOT_ABOVE LSFT(BP_DEAD_TREMA) // dead ˙
#define BP_DDTA BP_DEAD_DOT_ABOVE
#define BP_DEAD_CURRENCY LSFT(BP_EURO) // dead ¤ (next key will generate a currency code like ¥ or £)
#define BP_DCUR BP_DEAD_CURRENCY
#define BP_DEAD_HORN LSFT(ALTGR(BP_COMMA)) // dead ̛
#define BP_DHRN BP_DEAD_HORN
#define BP_LONG_S LSFT(ALTGR(BP_C)) // ſ
#define BP_LNGS BP_LONG_S
#define BP_TRADEMARK LSFT(BP_REGISTERED_TRADEMARK) // ™
#define BP_TM BP_TRADEMARK
#define BP_ORDINAL_INDICATOR_O LSFT(ALTGR(BP_M)) // º
#define BP_ORDO BP_ORDINAL_INDICATOR_O
#define BP_DEAD_COMMA LSFT(BP_DEAD_CEDILLA) // dead ˛
#define BP_DCOM BP_DEAD_COMMA
// Fourth row
#define BP_LEFT_QUOTE LSFT(ALTGR(BP_Y)) //
#define BP_LQOT BP_LEFT_QUOTE
#define BP_RIGHT_QUOTE LSFT(ALTGR(BP_X)) //
#define BP_RQOT BP_RIGHT_QUOTE
#define BP_INTERPUNCT LSFT(ALTGR(BP_DOT)) // ·
#define BP_IPCT BP_INTERPUNCT
#define BP_DEAD_HOOK_ABOVE LSFT(ALTGR(BP_QUESTION)) // dead ̉
#define BP_DHKA BP_DEAD_HOOK_ABOVE
#define BP_DEAD_UNDERDOT LSFT(BP_DEAD_RING) // dead ̣
#define BP_DUDT BP_DEAD_UNDERDOT
#define BP_DOUBLE_DAGGER LSFT(BP_DAGGER) // ‡
#define BP_DDGR BP_DOUBLE_DAGGER
#define BP_ORDINAL_INDICATOR_A LSFT(ALTGR(BP_F)) // ª
#define BP_ORDA BP_ORDINAL_INDICATOR_A
// Space bar
#define BP_NARROW_NON_BREAKING_SPACE ALTGR(BP_NON_BREAKING_SPACE)
#define BP_NNBS BP_NARROW_NON_BREAKING_SPACE
#endif

View File

@ -87,7 +87,7 @@
// Alt-ed characters // Alt-ed characters
#define DE_SQ2 LALT(KC_2) // ² #define DE_SQ2 LALT(KC_2) // ²
#define DE_SQ3 LALT(KC_3) // ³ #define DE_SQ3 LALT(KC_3) // ³
#define DE_LCBR LALT(KC_7) // { #define DE_LCBR LALT(KC_8) // {
#define DE_LBRC LALT(KC_5) // [ #define DE_LBRC LALT(KC_5) // [
#define DE_RBRC LALT(KC_6) // ] #define DE_RBRC LALT(KC_6) // ]
#define DE_RCBR LALT(KC_9) // } #define DE_RCBR LALT(KC_9) // }