From 41227856f4bfe24151009b20c0c412fe33756a4a Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Tue, 6 Sep 2016 22:09:40 +0100 Subject: added a toggle between Mac and Windows base layers (with swapped cmd and ctrl) --- keyboards/planck/keymaps/callum/keymap.c | 59 ++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 11 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 6c3431133..b47f8eb05 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -11,13 +11,15 @@ extern keymap_config_t keymap_config; // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _BASE 0 -#define _MOVE 1 -#define _SYMB 2 -#define _FUNC 3 +#define _MAC 0 +#define _WIN 1 +#define _MOVE 2 +#define _SYMB 3 +#define _FUNC 4 enum planck_keycodes { - BASE = SAFE_RANGE, + MAC = SAFE_RANGE, + WIN, MOVE, SYMB, FUNC, @@ -30,7 +32,7 @@ enum planck_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* BASE +/* BASE Mac * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | * |------+------+------+------+------+-------------+------+------+------+------+------| @@ -41,13 +43,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Func | Ctrl | Alt | GUI | Symb |Enter |Space | Move | GUI | Alt | Ctrl |Caps | * `-----------------------------------------------------------------------------------' */ -[_BASE] = { +[_MAC] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, {FUNC, KC_LCTL, KC_LALT, KC_LGUI, SYMB, KC_ENT, KC_SPC, MOVE, KC_RGUI, KC_RALT, KC_RCTL, KC_CAPS} }, +/* BASE Windows + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Bksp | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Func | GUI | Alt | Ctrl | Symb |Enter |Space | Move | Ctrl | Alt | GUI |Caps | + * `-----------------------------------------------------------------------------------' + */ +[_WIN] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {FUNC, KC_LGUI, KC_LALT, KC_LCTL, SYMB, KC_ENT, KC_SPC, MOVE, KC_RCTL, KC_RALT, KC_RGUI, KC_CAPS} +}, + /* MOVE * ,-----------------------------------------------------------------------------------. * | Esc | | Home | Up | End | | | Home | Up | End | | Esc | @@ -88,24 +108,41 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | * |-----------------------------------------------------------------------------------. - * | | Play | Prev | Next | BL+ | | | Lock | | | | | + * | | Play | Prev | Next | BL+ | | | Lock | | | Mac | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Mute | Vol- | Vol+ | BL- | | | | | | | | + * | | Mute | Vol- | Vol+ | BL- | | | | | | Win | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | |Reset | * `-----------------------------------------------------------------------------------' */ [_FUNC] = { {KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 }, - {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, LOCK, _______, _______, _______, _______}, - {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, _______, _______, _______, _______, _______}, + {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, LOCK, _______, _______, MAC, _______}, + {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, _______, _______, _______, WIN, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET } } }; +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + case MAC: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_MAC); + } + return false; + break; + case WIN: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_WIN); + } + return false; + break; case MOVE: if (record->event.pressed) { layer_on(_MOVE); -- cgit v1.2.3-24-g4f1b From b51f51c614e2bcd64202811510719f25345cb1ce Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Tue, 6 Sep 2016 22:19:11 +0100 Subject: added close key for alt-f4 macro --- keyboards/planck/keymaps/callum/keymap.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index b47f8eb05..56808aa8c 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -23,7 +23,8 @@ enum planck_keycodes { MOVE, SYMB, FUNC, - LOCK + LOCK, + CLOSE }; // Fillers to make layering more clear @@ -110,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------------------. * | | Play | Prev | Next | BL+ | | | Lock | | | Mac | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Mute | Vol- | Vol+ | BL- | | | | | | Win | | + * | | Mute | Vol- | Vol+ | BL- | | |Close | | | Win | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | |Reset | * `-----------------------------------------------------------------------------------' @@ -118,7 +119,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_FUNC] = { {KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 }, {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, LOCK, _______, _______, MAC, _______}, - {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, _______, _______, _______, WIN, _______}, + {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, CLOSE, _______, _______, WIN, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET } } @@ -183,6 +184,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case CLOSE: + if (record->event.pressed) { + register_code(KC_LALT); + register_code(KC_F4); + } else { + unregister_code(KC_F4); + unregister_code(KC_LALT); + } + return false; + break; } return true; } -- cgit v1.2.3-24-g4f1b From 6ad8a06c734caa378296d0cfe335feda7457ed61 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Tue, 6 Sep 2016 22:47:11 +0100 Subject: updated readme --- keyboards/planck/keymaps/callum/keymap.c | 30 ++++++------ keyboards/planck/keymaps/callum/readme.md | 81 ++++++++++++++++++++++++++----- 2 files changed, 83 insertions(+), 28 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 56808aa8c..f5a816f4e 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -39,9 +39,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Bksp | A | R | S | T | D | H | N | E | I | O | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Func | Ctrl | Alt | GUI | Symb |Enter |Space | Move | GUI | Alt | Ctrl |Caps | + * | Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Caps | * `-----------------------------------------------------------------------------------' */ [_MAC] = { @@ -57,9 +57,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Bksp | A | R | S | T | D | H | N | E | I | O | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Func | GUI | Alt | Ctrl | Symb |Enter |Space | Move | Ctrl | Alt | GUI |Caps | + * | Func | Win | Alt | Ctrl | Symb | Enter| Space| Move | Ctrl | Alt | Win | Caps | * `-----------------------------------------------------------------------------------' */ [_WIN] = { @@ -71,11 +71,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* MOVE * ,-----------------------------------------------------------------------------------. - * | Esc | | Home | Up | End | | | Home | Up | End | | Esc | + * | Esc | | Home | Up | End | | | Home | Up | End | | Esc | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | | Left | Down |Right | | | Left | Down |Right | | Del | + * | Del | | Left | Down | Right| | | Left | Down | Right| | Del | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | |Pg Up |Pg Dn | | |Pg Dn |Pg Up | | | | + * | | | | Pg Up| Pg Dn| | | Pg Dn| Pg Up| | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' @@ -89,9 +89,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* SYMB * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | - * |-----------------------------------------------------------------------------------. - * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | + * |-----------------------------------------------------------------------------------| + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -107,13 +107,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* FUNC * ,-----------------------------------------------------------------------------------. - * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | - * |-----------------------------------------------------------------------------------. - * | | Play | Prev | Next | BL+ | | | Lock | | | Mac | | + * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * |-----------------------------------------------------------------------------------| + * | | Play | Prev | Next | BL+ | | | Lock | | | Mac | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Mute | Vol- | Vol+ | BL- | | |Close | | | Win | | + * | | Mute | Vol- | Vol+ | BL- | | | Close| | | Win | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | |Reset | + * | | | | | | | | | | | | Reset| * `-----------------------------------------------------------------------------------' */ [_FUNC] = { diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md index b70de3f1e..812590765 100644 --- a/keyboards/planck/keymaps/callum/readme.md +++ b/keyboards/planck/keymaps/callum/readme.md @@ -6,38 +6,93 @@ This is a layout for the grid planck, built with a few ideals in mind: - The hands should never need to leave the home position. The usual culprit for this is the arrow cluster, so the arrow cluster should be as close to home as possible. - There should be two of every modifier (one on each side), otherwise certain long key combinations become hard to make. - Backspace should be in the “capslock position” in the colemak tradition. +- The keyboard should be usable on any operating system without software changes. For me this means being able to swap the `GUI` key and `Ctrl` key in firmware so that `Cmd-z,x,c,v,…` becomes `Ctrl-z,x,c,v,…` when swapping from macOS to Windows. -We have four layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow cluster etc, a `SYMB` layer, with numbers and symbols; and a `FUNC` layer, with function keys and media keys. +We have four layers. A `BASE` layer (which is either `BASE Mac` or `BASE Windows`), in colemak; a `MOVE` layer, with an arrow cluster etc, a `SYMB` layer, with numbers and symbols; and a `FUNC` layer, with function keys and media keys. ## The `BASE` layer -![](http://i.imgur.com/tVNI3SE.png) - -This is the default layer; in [colemak](https://colemak.com). `esc` and `del` are conspicuously absent but are especially easy to reach from either of the other main layers (see below). The `backspace` location is standard colemak. The `caps` key is still on the `BASE` layer but only because I don’t really use the bottom corners so there’s nothing else I would rather put there. Having `enter` on a thumb means I can still have `quote` immediately to the right of `O`, something that would have annoyed me endlessly otherwise. `minus` is in the upper right because I had an extra space and it’s probably my next most used key that didn’t yet have a home. - -The `MOVE` and `SYMB` layers are reached by holding down the `move` and `symb` keys respectively. The `FUNC` layer is reached by holding down both the `move` and `symb` keys simultaneously, *or* by holding down the `fn` key. The intended use is that whenever both hands are on the keyboard, the former method is used, and the latter is only used when, for example, reaching over to the keyboard with one hand to access the media controls. +For Mac +``` +,-----------------------------------------------------------------------------------. +| Tab | Q | W | F | P | G | J | L | U | Y | ; | - | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Bksp | A | R | S | T | D | H | N | E | I | O | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | K | M | , | . | / | Shift| +|------+------+------+------+------+------+------+------+------+------+------+------| +| Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Caps | +`-----------------------------------------------------------------------------------' +``` + +For Windows +``` + ,-----------------------------------------------------------------------------------. +| Tab | Q | W | F | P | G | J | L | U | Y | ; | - | +|------+------+------+------+-------+-------------+------+------+------+------+------| +| Bksp | A | R | S | T | D | H | N | E | I | O | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | K | M | , | . | / | Shift| +|------+------+------+------+------+------+------+------+------+------+------+------| +| Func | Win | Alt | Ctrl | Symb | Enter| Space| Move | Ctrl | Alt | Win | Caps | +`-----------------------------------------------------------------------------------' +``` + +One of the two above layers is set as the default layer at any one time; see `FUNC`. The basic layout is [colemak](https://colemak.com). `Esc` and `Del` are conspicuously absent but are especially easy to reach from either of the other main layers (see below). The `backspace` location is standard colemak. The `Caps` key is still on the `BASE` layer but only because I don’t really use the bottom corners so there’s nothing else I would rather put there. Having `Enter` on a thumb means I can still have `quote` immediately to the right of `O`, something that would have annoyed me endlessly otherwise. `minus` is in the upper right because I had an extra space and it’s probably my next most used key that didn’t yet have a home. + +The `MOVE` and `SYMB` layers are reached by holding down the `Move` and `Symb` keys respectively. The `FUNC` layer is reached by holding down both the `Move` and `Symb` keys simultaneously, *or* by holding down the `fn` key. The intended use is that whenever both hands are on the keyboard, the former method is used, and the latter is only used when, for example, reaching over to the keyboard with one hand to access the media controls. ## The `MOVE` layer -![](http://i.imgur.com/KXRSuHT.png) +``` +,-----------------------------------------------------------------------------------. +| Esc | | Home | Up | End | | | Home | Up | End | | Esc | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Del | | Left | Down | Right| | | Left | Down | Right| | Del | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | Pg Up| Pg Dn| | | Pg Dn| Pg Up| | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` This is fairly self explanatory. I almost exclusively use the right hand cluster so that movement is a one handed affair, but the left hand cluster is there if it’s needed. -On *macOS* I recommend using [Karabiner](https://pqrs.org/osx/karabiner/) and ticking *Use PC Style Home/End #2* and *Use PC Style PageUp/PageDown* so that `home` and `end` jump you to the beginning and end of the line respectively and so that `pg up` and `pg dn` move the cursor instead of just scrolling. +On *macOS* I recommend using [Karabiner](https://pqrs.org/osx/karabiner/) and ticking *Use PC Style Home/End #2* and *Use PC Style PageUp/PageDown* so that `Home` and `End` jump you to the beginning and end of the line respectively and so that `Pg Up` and `Pg Dn` move the cursor instead of just scrolling. None of the modifiers are overwritten so that `shift-alt-arrows` etc work as expected. ## The `SYMB` layer -![](http://i.imgur.com/thh1ne2.png) +``` +,-----------------------------------------------------------------------------------. +| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | +|-----------------------------------------------------------------------------------| +| Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | ~ | ` | + | = | | | \ | [ | ] | { | } | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------' +``` The symbol layer has all the numbers and their usual corresponding symbols in the first two rows, with the symbols on the home row since I use them more frequently than the numbers. The third row contains all the remaining symbols, arranged roughly so that the most used symbols are accessible with the strongest fingers. -`esc` and `del` are repeated here since I wanted to be able to reach either, one handed, with either hand. +`Esc` and `Del` are repeated here since I wanted to be able to reach either, one handed, with either hand. Again none of the modifiers are overwritten so that shortcuts involving numbers or symbols work as expected. ## The `FUNC` layer -![](http://i.imgur.com/1VKFBBU.png) - -The only things of note here are that `bl+` and `bl-` are short for *backlight up* and *backlight down*, and in firmware are actually `KC_PAUS` and `KC_SLCK` respectively, since *macOS* interprets these as the backlight keys. And that `lock` is currently a macro hard coded to turn off the screen on *macOS*. (By activating the shortcut `shift-ctrl-power`.) +``` +,-----------------------------------------------------------------------------------. +| F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | +|-----------------------------------------------------------------------------------| +| | Play | Prev | Next | BL+ | | | Lock | | | Mac | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | Mute | Vol- | Vol+ | BL- | | | Close| | | Win | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | Reset| +`-----------------------------------------------------------------------------------' +``` + +`BL+` and `BL-` are short for *backlight up* and *backlight down*, and in firmware are actually `KC_PAUS` and `KC_SLCK` respectively, since *macOS* interprets these as the backlight keys. `Lock` is currently a macro hard coded to turn off the screen on *macOS*. (By activating the shortcut `shift-ctrl-power`.) `Close` sends `alt-f4` to make that shortcut easier to reach. `Mac` and `Win` set the default layer to the Mac and Windows `BASE` layers respecitevly. ## Other changes from the default I have LEDs and sound disabled, simply because I have no need of them. -- cgit v1.2.3-24-g4f1b From ff09695897c4bdd705347e6427077e406413c26d Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Tue, 6 Sep 2016 22:52:55 +0100 Subject: Update readme.md --- keyboards/planck/keymaps/callum/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md index 812590765..2e59c00d6 100644 --- a/keyboards/planck/keymaps/callum/readme.md +++ b/keyboards/planck/keymaps/callum/readme.md @@ -26,9 +26,9 @@ For Mac For Windows ``` - ,-----------------------------------------------------------------------------------. +,-----------------------------------------------------------------------------------. | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | -|------+------+------+------+-------+-------------+------+------+------+------+------| +|------+------+------+------+------+------+------+------+------+------+------+------| | Bksp | A | R | S | T | D | H | N | E | I | O | " | |------+------+------+------+------+------|------+------+------+------+------+------| | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| -- cgit v1.2.3-24-g4f1b From c593564acab7a0b1cca2c90bd0b1ffd9def59f05 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Tue, 6 Sep 2016 22:55:27 +0100 Subject: Update readme.md --- keyboards/planck/keymaps/callum/readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md index 2e59c00d6..7a771130a 100644 --- a/keyboards/planck/keymaps/callum/readme.md +++ b/keyboards/planck/keymaps/callum/readme.md @@ -15,9 +15,9 @@ For Mac ``` ,-----------------------------------------------------------------------------------. | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | -|------+------+------+------+------+-------------+------+------+------+------+------| +|------+------+------+------+------+------+------+------+------+------+------+------| | Bksp | A | R | S | T | D | H | N | E | I | O | " | -|------+------+------+------+------+------|------+------+------+------+------+------| +|------+------+------+------+------+------+------+------+------+------+------+------| | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| |------+------+------+------+------+------+------+------+------+------+------+------| | Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Caps | @@ -30,7 +30,7 @@ For Windows | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | |------+------+------+------+------+------+------+------+------+------+------+------| | Bksp | A | R | S | T | D | H | N | E | I | O | " | -|------+------+------+------+------+------|------+------+------+------+------+------| +|------+------+------+------+------+------+------+------+------+------+------+------| | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| |------+------+------+------+------+------+------+------+------+------+------+------| | Func | Win | Alt | Ctrl | Symb | Enter| Space| Move | Ctrl | Alt | Win | Caps | @@ -45,9 +45,9 @@ The `MOVE` and `SYMB` layers are reached by holding down the `Move` and `Symb` k ``` ,-----------------------------------------------------------------------------------. | Esc | | Home | Up | End | | | Home | Up | End | | Esc | -|------+------+------+------+------+-------------+------+------+------+------+------| +|------+------+------+------+------+------+------+------+------+------+------+------| | Del | | Left | Down | Right| | | Left | Down | Right| | Del | -|------+------+------+------+------+------|------+------+------+------+------+------| +|------+------+------+------+------+------+------+------+------+------+------+------| | | | | Pg Up| Pg Dn| | | Pg Dn| Pg Up| | | | |------+------+------+------+------+------+------+------+------+------+------+------| | | | | | | | | | | | | | @@ -64,9 +64,9 @@ None of the modifiers are overwritten so that `shift-alt-arrows` etc work as exp ``` ,-----------------------------------------------------------------------------------. | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | -|-----------------------------------------------------------------------------------| +|------+------+------+------+------+------+------+------+------+------+------+------| | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | -|------+------+------+------+------+-------------+------+------+------+------+------| +|------+------+------+------+------+------+------+------+------+------+------+------| | | ~ | ` | + | = | | | \ | [ | ] | { | } | | |------+------+------+------+------+------+------+------+------+------+------+------| | | | | | | | | | | | | | @@ -83,9 +83,9 @@ Again none of the modifiers are overwritten so that shortcuts involving numbers ``` ,-----------------------------------------------------------------------------------. | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | -|-----------------------------------------------------------------------------------| +|------+------+------+------+------+------+------+------+------+------+------+------| | | Play | Prev | Next | BL+ | | | Lock | | | Mac | | -|------+------+------+------+------+------|------+------+------+------+------+------| +|------+------+------+------+------+------+------+------+------+------+------+------| | | Mute | Vol- | Vol+ | BL- | | | Close| | | Win | | |------+------+------+------+------+------+------+------+------+------+------+------| | | | | | | | | | | | | Reset| -- cgit v1.2.3-24-g4f1b From b2ecd296ae0dc366717fae8a6abb25c0639d6a43 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Tue, 6 Sep 2016 22:59:36 +0100 Subject: fixed comments --- keyboards/planck/keymaps/callum/keymap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index f5a816f4e..751af9eb9 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -36,9 +36,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE Mac * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Bksp | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| * | Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Caps | @@ -54,9 +54,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE Windows * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Bksp | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| * | Func | Win | Alt | Ctrl | Symb | Enter| Space| Move | Ctrl | Alt | Win | Caps | @@ -72,9 +72,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* MOVE * ,-----------------------------------------------------------------------------------. * | Esc | | Home | Up | End | | | Home | Up | End | | Esc | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Del | | Left | Down | Right| | | Left | Down | Right| | Del | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | Pg Up| Pg Dn| | | Pg Dn| Pg Up| | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | @@ -90,9 +90,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* SYMB * ,-----------------------------------------------------------------------------------. * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | - * |-----------------------------------------------------------------------------------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | @@ -108,9 +108,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* FUNC * ,-----------------------------------------------------------------------------------. * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | - * |-----------------------------------------------------------------------------------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | Play | Prev | Next | BL+ | | | Lock | | | Mac | | - * |------+------+------+------+------+------|------+------+------+------+------+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | Mute | Vol- | Vol+ | BL- | | | Close| | | Win | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | Reset| -- cgit v1.2.3-24-g4f1b From 02635e5924ea5f3b1e970e115407f62c916c4476 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Wed, 7 Sep 2016 20:45:23 +0100 Subject: changed RALT to LALT on Windows --- keyboards/planck/keymaps/callum/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 751af9eb9..5754b1772 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, - {FUNC, KC_LGUI, KC_LALT, KC_LCTL, SYMB, KC_ENT, KC_SPC, MOVE, KC_RCTL, KC_RALT, KC_RGUI, KC_CAPS} + {FUNC, KC_LGUI, KC_LALT, KC_LCTL, SYMB, KC_ENT, KC_SPC, MOVE, KC_RCTL, KC_LALT, KC_RGUI, KC_CAPS} }, /* MOVE -- cgit v1.2.3-24-g4f1b From fa2724360b831fffd3745bfe7b3ef50910b9132b Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Wed, 28 Sep 2016 08:04:38 +0100 Subject: removed windows layer and updated brightness keys for macOS Sierra --- keyboards/planck/keymaps/callum/keymap.c | 90 +++++--------------------------- 1 file changed, 14 insertions(+), 76 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 5754b1772..0ac1906ba 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -11,20 +11,15 @@ extern keymap_config_t keymap_config; // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _MAC 0 -#define _WIN 1 -#define _MOVE 2 -#define _SYMB 3 -#define _FUNC 4 +#define _BASE 0 +#define _MOVE 1 +#define _SYMB 2 +#define _FUNC 3 enum planck_keycodes { - MAC = SAFE_RANGE, - WIN, MOVE, SYMB, - FUNC, - LOCK, - CLOSE + FUNC }; // Fillers to make layering more clear @@ -33,7 +28,7 @@ enum planck_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* BASE Mac +/* BASE * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -44,31 +39,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Caps | * `-----------------------------------------------------------------------------------' */ -[_MAC] = { +[_BASE] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, {FUNC, KC_LCTL, KC_LALT, KC_LGUI, SYMB, KC_ENT, KC_SPC, MOVE, KC_RGUI, KC_RALT, KC_RCTL, KC_CAPS} }, -/* BASE Windows - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Bksp | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Func | Win | Alt | Ctrl | Symb | Enter| Space| Move | Ctrl | Alt | Win | Caps | - * `-----------------------------------------------------------------------------------' - */ -[_WIN] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, - {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, - {FUNC, KC_LGUI, KC_LALT, KC_LCTL, SYMB, KC_ENT, KC_SPC, MOVE, KC_RCTL, KC_LALT, KC_RGUI, KC_CAPS} -}, - /* MOVE * ,-----------------------------------------------------------------------------------. * | Esc | | Home | Up | End | | | Home | Up | End | | Esc | @@ -81,9 +58,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_MOVE] = { - {KC_ESC, _______, KC_HOME, KC_UP, KC_END, _______, _______, KC_HOME, KC_UP, KC_END, _______, KC_ESC}, - {KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL}, - {_______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, KC_PGDN, KC_PGUP, _______, _______, _______}, + {KC_ESC, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_ESC}, + {KC_DEL, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, KC_DEL}, + {_______, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, XXXXXXX, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, @@ -109,41 +86,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Play | Prev | Next | BL+ | | | Lock | | | Mac | | + * | | Play | Prev | Next | BL+ | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Mute | Vol- | Vol+ | BL- | | | Close| | | Win | | + * | | Mute | Vol- | Vol+ | BL- | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | Reset| * `-----------------------------------------------------------------------------------' */ [_FUNC] = { {KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 }, - {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, LOCK, _______, _______, MAC, _______}, - {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, CLOSE, _______, _______, WIN, _______}, + {XXXXXXX, KC_MPLY, KC_MPRV, KC_MNXT, KC_F15, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_F14, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET } } }; -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case MAC: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_MAC); - } - return false; - break; - case WIN: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_WIN); - } - return false; - break; case MOVE: if (record->event.pressed) { layer_on(_MOVE); @@ -172,28 +132,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case LOCK: - if (record->event.pressed) { - register_code(KC_RSFT); - register_code(KC_RCTL); - register_code(KC_POWER); - } else { - unregister_code(KC_POWER); - unregister_code(KC_RCTL); - unregister_code(KC_RSFT); - } - return false; - break; - case CLOSE: - if (record->event.pressed) { - register_code(KC_LALT); - register_code(KC_F4); - } else { - unregister_code(KC_F4); - unregister_code(KC_LALT); - } - return false; - break; } return true; } -- cgit v1.2.3-24-g4f1b From c762ea975a4c66da484b4cd4879e41c1457d854a Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Wed, 28 Sep 2016 23:15:35 +0100 Subject: big restructure now I only have to consider macOS, also added mouse, more function keys, and some neat macros --- keyboards/planck/keymaps/callum/keymap.c | 139 ++++++++++++++++++++++++++----- 1 file changed, 116 insertions(+), 23 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 0ac1906ba..38c362fcb 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -14,12 +14,19 @@ extern keymap_config_t keymap_config; #define _BASE 0 #define _MOVE 1 #define _SYMB 2 -#define _FUNC 3 +#define _MOUSE 3 +#define _FUNC 4 enum planck_keycodes { - MOVE, + MOVE = SAFE_RANGE, SYMB, - FUNC + FUNC, + CMDLEFT, + CMDRGHT, + BELOW, + ABOVE, + VOLUP, + VOLDN }; // Fillers to make layering more clear @@ -36,14 +43,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Caps | + * | Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Func | * `-----------------------------------------------------------------------------------' */ [_BASE] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, - {FUNC, KC_LCTL, KC_LALT, KC_LGUI, SYMB, KC_ENT, KC_SPC, MOVE, KC_RGUI, KC_RALT, KC_RCTL, KC_CAPS} + {FUNC, KC_LCTL, KC_LALT, KC_LGUI, SYMB, KC_ENT, KC_SPC, MOVE, KC_RGUI, KC_RALT, KC_RCTL, FUNC } }, /* MOVE @@ -52,16 +59,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | Del | | Left | Down | Right| | | Left | Down | Right| | Del | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | Pg Up| Pg Dn| | | Pg Dn| Pg Up| | | | + * | | | | Pg Up| Pg Dn| Above| | Pg Dn| Pg Up| | Caps | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | | | | | | Below| | | | | | | * `-----------------------------------------------------------------------------------' */ [_MOVE] = { - {KC_ESC, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_ESC}, - {KC_DEL, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, KC_DEL}, - {_______, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, XXXXXXX, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + {KC_ESC, XXXXXXX, CMDLEFT, KC_UP, CMDRGHT, XXXXXXX, XXXXXXX, CMDLEFT, KC_UP, CMDRGHT, XXXXXXX, KC_ESC }, + {KC_DEL, KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_CAPS, KC_DEL }, + {_______, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, ABOVE, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______}, + {_______, _______, _______, _______, _______, BELOW, _______, _______, _______, _______, _______, _______} }, /* SYMB @@ -82,22 +89,40 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, +/* MOUSE + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_MOUSE] = { + {XXXXXXX, XXXXXXX, KC_ACL2, KC_ACL1, KC_ACL0, XXXXXXX, XXXXXXX, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN2, KC_BTN1, XXXXXXX, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX}, + {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_D, KC_WH_U, XXXXXXX, XXXXXXX, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + /* FUNC * ,-----------------------------------------------------------------------------------. - * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * | Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Vol+ | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Play | Prev | Next | BL+ | | | | | | | | + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | Vol- | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Mute | Vol- | Vol+ | BL- | | | | | | | | + * | | F21 | F22 | F23 | F24 | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | Reset| + * | | | | | Prev | Mute | Play | Next | | | | | * `-----------------------------------------------------------------------------------' */ [_FUNC] = { - {KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 }, - {XXXXXXX, KC_MPLY, KC_MPRV, KC_MNXT, KC_F15, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_F14, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET } + {RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, VOLUP }, + {XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, VOLDN }, + {_______, KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______}, + {_______, _______, _______, _______, KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, _______, _______, _______, _______} } }; @@ -107,20 +132,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case MOVE: if (record->event.pressed) { layer_on(_MOVE); - update_tri_layer(_MOVE, _SYMB, _FUNC); + update_tri_layer(_MOVE, _SYMB, _MOUSE); } else { layer_off(_MOVE); - update_tri_layer(_MOVE, _SYMB, _FUNC); + update_tri_layer(_MOVE, _SYMB, _MOUSE); } return false; break; case SYMB: if (record->event.pressed) { layer_on(_SYMB); - update_tri_layer(_MOVE, _SYMB, _FUNC); + update_tri_layer(_MOVE, _SYMB, _MOUSE); } else { layer_off(_SYMB); - update_tri_layer(_MOVE, _SYMB, _FUNC); + update_tri_layer(_MOVE, _SYMB, _MOUSE); } return false; break; @@ -132,6 +157,74 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case CMDLEFT: + if (record->event.pressed) { + register_code(KC_LGUI); + register_code(KC_LEFT); + } else { + unregister_code(KC_LEFT); + unregister_code(KC_LGUI); + } + return false; + break; + case CMDRGHT: + if (record->event.pressed) { + register_code(KC_LGUI); + register_code(KC_RGHT); + } else { + unregister_code(KC_RGHT); + unregister_code(KC_LGUI); + } + return false; + break; + case BELOW: + if (record->event.pressed) { + register_code(KC_LGUI); + register_code(KC_RGHT); + unregister_code(KC_RGHT); + unregister_code(KC_LGUI); + register_code(KC_ENT); + unregister_code(KC_ENT); + } + return false; + break; + case ABOVE: + if (record->event.pressed) { + register_code(KC_LGUI); + register_code(KC_LEFT); + unregister_code(KC_LEFT); + unregister_code(KC_LGUI); + register_code(KC_ENT); + unregister_code(KC_ENT); + register_code(KC_UP); + unregister_code(KC_UP); + } + return false; + break; + case VOLUP: + if (record->event.pressed) { + register_code(KC_LALT); + register_code(KC_LSFT); + register_code(KC_VOLU); + } else { + unregister_code(KC_VOLU); + unregister_code(KC_LSFT); + unregister_code(KC_LALT); + } + return false; + break; + case VOLDN: + if (record->event.pressed) { + register_code(KC_LALT); + register_code(KC_LSFT); + register_code(KC_VOLD); + } else { + unregister_code(KC_VOLD); + unregister_code(KC_LSFT); + unregister_code(KC_LALT); + } + return false; + break; } return true; } -- cgit v1.2.3-24-g4f1b From 2f07ad8e8a3e69eb90488bcac0540fd81448e3d0 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Thu, 29 Sep 2016 07:47:30 +0100 Subject: added en-dash and gbp keys and updated readme --- keyboards/planck/keymaps/callum/keymap.c | 38 ++++++-- keyboards/planck/keymaps/callum/readme.md | 149 ++++++++++++------------------ 2 files changed, 91 insertions(+), 96 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 38c362fcb..82ba83f4e 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -25,6 +25,8 @@ enum planck_keycodes { CMDRGHT, BELOW, ABOVE, + DASH, + GBP, VOLUP, VOLDN }; @@ -55,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* MOVE * ,-----------------------------------------------------------------------------------. - * | Esc | | Home | Up | End | | | Home | Up | End | | Esc | + * | Esc | | Cmd-L| Up | Cmd-R| | | Cmd-L| Up | Cmd-R| | Esc | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Del | | Left | Down | Right| | | Left | Down | Right| | Del | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -73,9 +75,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* SYMB * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | – | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | £ | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -83,19 +85,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_SYMB] = { - {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC }, - {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DASH }, + {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, GBP }, {_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, /* MOUSE * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | + * | | | ACC-2| ACC-1| ACC-0| | | SW-L | M-U | SW-R | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | | | MB-3 | MB-2 | MB-1 | | | M-L | M-D | M-R | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | | | | | | | | SW-D | SW-U | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' @@ -201,6 +203,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case DASH: + if (record->event.pressed) { + register_code(KC_LALT); + register_code(KC_MINS); + } else { + unregister_code(KC_MINS); + unregister_code(KC_LALT); + } + return false; + break; + case GBP: + if (record->event.pressed) { + register_code(KC_LALT); + register_code(KC_3); + } else { + unregister_code(KC_3); + unregister_code(KC_LALT); + } + return false; + break; case VOLUP: if (record->event.pressed) { register_code(KC_LALT); diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md index 7a771130a..b5997cd5a 100644 --- a/keyboards/planck/keymaps/callum/readme.md +++ b/keyboards/planck/keymaps/callum/readme.md @@ -2,97 +2,70 @@ This is a layout for the grid planck, built with a few ideals in mind: -- Minimal response times should be maintained. i.e. keys that react differently depending on whether they are tapped or held, keys that react differently if they are double tapped, etc. should be avoided — they inevitably send their keycode later than a normal key, interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording. +- Minimal response times should be maintained. Keys that react differently depending on whether they are tapped or held, keys that react differently if they are double tapped, etc. should be avoided – they inevitably send their keycode later than a normal key – interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording as our only means of getting more than one symbol out of a single physical key. - The hands should never need to leave the home position. The usual culprit for this is the arrow cluster, so the arrow cluster should be as close to home as possible. - There should be two of every modifier (one on each side), otherwise certain long key combinations become hard to make. -- Backspace should be in the “capslock position” in the colemak tradition. -- The keyboard should be usable on any operating system without software changes. For me this means being able to swap the `GUI` key and `Ctrl` key in firmware so that `Cmd-z,x,c,v,…` becomes `Ctrl-z,x,c,v,…` when swapping from macOS to Windows. -We have four layers. A `BASE` layer (which is either `BASE Mac` or `BASE Windows`), in colemak; a `MOVE` layer, with an arrow cluster etc, a `SYMB` layer, with numbers and symbols; and a `FUNC` layer, with function keys and media keys. +We have five layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow cluster and other movement keys; a `SYMB` layer, with numbers and symbols; a `FUNC` layer, with function keys and media keys; and a `MOUSE` layer, with mouse emulation. -## The `BASE` layer -For Mac ``` -,-----------------------------------------------------------------------------------. -| Tab | Q | W | F | P | G | J | L | U | Y | ; | - | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Bksp | A | R | S | T | D | H | N | E | I | O | " | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | K | M | , | . | / | Shift| -|------+------+------+------+------+------+------+------+------+------+------+------| -| Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Caps | -`-----------------------------------------------------------------------------------' +/* BASE + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Bksp | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Func | Ctrl | Alt | Cmd | Symb | Enter| Space| Move | Cmd | Alt | Ctrl | Func | + * `-----------------------------------------------------------------------------------' + */ + +/* MOVE + * ,-----------------------------------------------------------------------------------. + * | Esc | | Cmd-L| Up | Cmd-R| | | Cmd-L| Up | Cmd-R| | Esc | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | | Left | Down | Right| | | Left | Down | Right| | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Pg Up| Pg Dn| Above| | Pg Dn| Pg Up| | Caps | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Below| | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +/* SYMB + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | – | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | £ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +/* MOUSE + * ,-----------------------------------------------------------------------------------. + * | | | ACC-2| ACC-1| ACC-0| | | SW-L | M-U | SW-R | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | MB-3 | MB-2 | MB-1 | | | M-L | M-D | M-R | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | SW-D | SW-U | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +/* FUNC + * ,-----------------------------------------------------------------------------------. + * | Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Vol+ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | Vol- | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F21 | F22 | F23 | F24 | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | Prev | Mute | Play | Next | | | | | + * `-----------------------------------------------------------------------------------' + */ ``` - -For Windows -``` -,-----------------------------------------------------------------------------------. -| Tab | Q | W | F | P | G | J | L | U | Y | ; | - | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Bksp | A | R | S | T | D | H | N | E | I | O | " | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Shift| Z | X | C | V | B | K | M | , | . | / | Shift| -|------+------+------+------+------+------+------+------+------+------+------+------| -| Func | Win | Alt | Ctrl | Symb | Enter| Space| Move | Ctrl | Alt | Win | Caps | -`-----------------------------------------------------------------------------------' -``` - -One of the two above layers is set as the default layer at any one time; see `FUNC`. The basic layout is [colemak](https://colemak.com). `Esc` and `Del` are conspicuously absent but are especially easy to reach from either of the other main layers (see below). The `backspace` location is standard colemak. The `Caps` key is still on the `BASE` layer but only because I don’t really use the bottom corners so there’s nothing else I would rather put there. Having `Enter` on a thumb means I can still have `quote` immediately to the right of `O`, something that would have annoyed me endlessly otherwise. `minus` is in the upper right because I had an extra space and it’s probably my next most used key that didn’t yet have a home. - -The `MOVE` and `SYMB` layers are reached by holding down the `Move` and `Symb` keys respectively. The `FUNC` layer is reached by holding down both the `Move` and `Symb` keys simultaneously, *or* by holding down the `fn` key. The intended use is that whenever both hands are on the keyboard, the former method is used, and the latter is only used when, for example, reaching over to the keyboard with one hand to access the media controls. - -## The `MOVE` layer -``` -,-----------------------------------------------------------------------------------. -| Esc | | Home | Up | End | | | Home | Up | End | | Esc | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Del | | Left | Down | Right| | | Left | Down | Right| | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | Pg Up| Pg Dn| | | Pg Dn| Pg Up| | | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -`-----------------------------------------------------------------------------------' -``` - -This is fairly self explanatory. I almost exclusively use the right hand cluster so that movement is a one handed affair, but the left hand cluster is there if it’s needed. - -On *macOS* I recommend using [Karabiner](https://pqrs.org/osx/karabiner/) and ticking *Use PC Style Home/End #2* and *Use PC Style PageUp/PageDown* so that `Home` and `End` jump you to the beginning and end of the line respectively and so that `Pg Up` and `Pg Dn` move the cursor instead of just scrolling. - -None of the modifiers are overwritten so that `shift-alt-arrows` etc work as expected. - -## The `SYMB` layer -``` -,-----------------------------------------------------------------------------------. -| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | -|------+------+------+------+------+------+------+------+------+------+------+------| -| Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | ~ | ` | + | = | | | \ | [ | ] | { | } | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | | -`-----------------------------------------------------------------------------------' -``` - -The symbol layer has all the numbers and their usual corresponding symbols in the first two rows, with the symbols on the home row since I use them more frequently than the numbers. The third row contains all the remaining symbols, arranged roughly so that the most used symbols are accessible with the strongest fingers. - -`Esc` and `Del` are repeated here since I wanted to be able to reach either, one handed, with either hand. - -Again none of the modifiers are overwritten so that shortcuts involving numbers or symbols work as expected. - -## The `FUNC` layer -``` -,-----------------------------------------------------------------------------------. -| F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | Play | Prev | Next | BL+ | | | Lock | | | Mac | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | Mute | Vol- | Vol+ | BL- | | | Close| | | Win | | -|------+------+------+------+------+------+------+------+------+------+------+------| -| | | | | | | | | | | | Reset| -`-----------------------------------------------------------------------------------' -``` - -`BL+` and `BL-` are short for *backlight up* and *backlight down*, and in firmware are actually `KC_PAUS` and `KC_SLCK` respectively, since *macOS* interprets these as the backlight keys. `Lock` is currently a macro hard coded to turn off the screen on *macOS*. (By activating the shortcut `shift-ctrl-power`.) `Close` sends `alt-f4` to make that shortcut easier to reach. `Mac` and `Win` set the default layer to the Mac and Windows `BASE` layers respecitevly. - -## Other changes from the default -I have LEDs and sound disabled, simply because I have no need of them. -- cgit v1.2.3-24-g4f1b From 633da3bdb661a6da43ffd4e936736927e6d1ebda Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Sat, 1 Oct 2016 13:03:46 +0100 Subject: Made some simplifications leveraging the LALT(), LGUI(), and S() functions. --- keyboards/planck/keymaps/callum/keymap.c | 82 +++----------------------------- 1 file changed, 6 insertions(+), 76 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 82ba83f4e..411523125 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -21,14 +21,8 @@ enum planck_keycodes { MOVE = SAFE_RANGE, SYMB, FUNC, - CMDLEFT, - CMDRGHT, BELOW, - ABOVE, - DASH, - GBP, - VOLUP, - VOLDN + ABOVE }; // Fillers to make layering more clear @@ -67,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_MOVE] = { - {KC_ESC, XXXXXXX, CMDLEFT, KC_UP, CMDRGHT, XXXXXXX, XXXXXXX, CMDLEFT, KC_UP, CMDRGHT, XXXXXXX, KC_ESC }, + {KC_ESC, XXXXXXX, LGUI(KC_LEFT), KC_UP, LGUI(KC_RGHT), XXXXXXX, XXXXXXX, LGUI(KC_LEFT), KC_UP, LGUI(KC_RGHT), XXXXXXX, KC_ESC }, {KC_DEL, KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_CAPS, KC_DEL }, {_______, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, ABOVE, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______}, {_______, _______, _______, _______, _______, BELOW, _______, _______, _______, _______, _______, _______} @@ -85,8 +79,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_SYMB] = { - {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DASH }, - {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, GBP }, + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LALT(KC_MINS)}, + {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, LALT(KC_3)}, {_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, @@ -121,8 +115,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_FUNC] = { - {RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, VOLUP }, - {XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, VOLDN }, + {RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(LALT(KC_VOLU))}, + {XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, S(LALT(KC_VOLD))}, {_______, KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______}, {_______, _______, _______, _______, KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, _______, _______, _______, _______} } @@ -159,26 +153,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case CMDLEFT: - if (record->event.pressed) { - register_code(KC_LGUI); - register_code(KC_LEFT); - } else { - unregister_code(KC_LEFT); - unregister_code(KC_LGUI); - } - return false; - break; - case CMDRGHT: - if (record->event.pressed) { - register_code(KC_LGUI); - register_code(KC_RGHT); - } else { - unregister_code(KC_RGHT); - unregister_code(KC_LGUI); - } - return false; - break; case BELOW: if (record->event.pressed) { register_code(KC_LGUI); @@ -203,50 +177,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case DASH: - if (record->event.pressed) { - register_code(KC_LALT); - register_code(KC_MINS); - } else { - unregister_code(KC_MINS); - unregister_code(KC_LALT); - } - return false; - break; - case GBP: - if (record->event.pressed) { - register_code(KC_LALT); - register_code(KC_3); - } else { - unregister_code(KC_3); - unregister_code(KC_LALT); - } - return false; - break; - case VOLUP: - if (record->event.pressed) { - register_code(KC_LALT); - register_code(KC_LSFT); - register_code(KC_VOLU); - } else { - unregister_code(KC_VOLU); - unregister_code(KC_LSFT); - unregister_code(KC_LALT); - } - return false; - break; - case VOLDN: - if (record->event.pressed) { - register_code(KC_LALT); - register_code(KC_LSFT); - register_code(KC_VOLD); - } else { - unregister_code(KC_VOLD); - unregister_code(KC_LSFT); - unregister_code(KC_LALT); - } - return false; - break; } return true; } -- cgit v1.2.3-24-g4f1b From 059990e05a0eea21da0bbeba5b9ad78ff3b2bdd5 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Thu, 6 Oct 2016 07:23:12 +0100 Subject: added lock screen button and fixed error in diagram --- keyboards/planck/keymaps/callum/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 411523125..c89b485a4 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -53,9 +53,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | Esc | | Cmd-L| Up | Cmd-R| | | Cmd-L| Up | Cmd-R| | Esc | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | | Left | Down | Right| | | Left | Down | Right| | Del | + * | Del | Caps | Left | Down | Right| | | Left | Down | Right| Caps | Del | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | Pg Up| Pg Dn| Above| | Pg Dn| Pg Up| | Caps | | + * | | | | Pg Up| Pg Dn| Above| | Pg Dn| Pg Up| | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | Below| | | | | | | * `-----------------------------------------------------------------------------------' @@ -109,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | Vol- | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F21 | F22 | F23 | F24 | | | | | | | | + * | | F21 | F22 | F23 | F24 | | | Lock | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | Prev | Mute | Play | Next | | | | | * `-----------------------------------------------------------------------------------' @@ -117,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_FUNC] = { {RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(LALT(KC_VOLU))}, {XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, S(LALT(KC_VOLD))}, - {_______, KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______}, + {_______, KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, S(LCTL(KC_POWER)), XXXXXXX, XXXXXXX, XXXXXXX, _______}, {_______, _______, _______, _______, KC_MPRV, KC_MUTE, KC_MPLY, KC_MNXT, _______, _______, _______, _______} } -- cgit v1.2.3-24-g4f1b From 387b94a6cf0f32dd0ff72e7ff09495e69cccd1fc Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Thu, 6 Oct 2016 07:24:26 +0100 Subject: updated readme --- keyboards/planck/keymaps/callum/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md index b5997cd5a..0baeba46d 100644 --- a/keyboards/planck/keymaps/callum/readme.md +++ b/keyboards/planck/keymaps/callum/readme.md @@ -25,9 +25,9 @@ We have five layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow c * ,-----------------------------------------------------------------------------------. * | Esc | | Cmd-L| Up | Cmd-R| | | Cmd-L| Up | Cmd-R| | Esc | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | | Left | Down | Right| | | Left | Down | Right| | Del | + * | Del | Caps | Left | Down | Right| | | Left | Down | Right| Caps | Del | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | Pg Up| Pg Dn| Above| | Pg Dn| Pg Up| | Caps | | + * | | | | Pg Up| Pg Dn| Above| | Pg Dn| Pg Up| | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | Below| | | | | | | * `-----------------------------------------------------------------------------------' @@ -63,7 +63,7 @@ We have five layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow c * |------+------+------+------+------+------+------+------+------+------+------+------| * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | Vol- | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F21 | F22 | F23 | F24 | | | | | | | | + * | | F21 | F22 | F23 | F24 | | | Lock | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | Prev | Mute | Play | Next | | | | | * `-----------------------------------------------------------------------------------' -- cgit v1.2.3-24-g4f1b From 26759e126eec922cd642052baa3e43a3c62c4a7c Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sun, 9 Oct 2016 13:34:17 +0200 Subject: New Planck keymap: vifon --- keyboards/planck/keymaps/vifon/Makefile | 25 +++++ keyboards/planck/keymaps/vifon/config.h | 91 ++++++++++++++++ keyboards/planck/keymaps/vifon/keymap.c | 187 ++++++++++++++++++++++++++++++++ 3 files changed, 303 insertions(+) create mode 100644 keyboards/planck/keymaps/vifon/Makefile create mode 100644 keyboards/planck/keymaps/vifon/config.h create mode 100644 keyboards/planck/keymaps/vifon/keymap.c (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/vifon/Makefile b/keyboards/planck/keymaps/vifon/Makefile new file mode 100644 index 000000000..838cb4e88 --- /dev/null +++ b/keyboards/planck/keymaps/vifon/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/vifon/config.h b/keyboards/planck/keymaps/vifon/config.h new file mode 100644 index 000000000..9cb0634fb --- /dev/null +++ b/keyboards/planck/keymaps/vifon/config.h @@ -0,0 +1,91 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define MANUFACTURER Ortholinear Keyboards +#define PRODUCT The Planck Keyboard +#define DESCRIPTION A compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { D0, D5, B5, B6 } +#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* prevent the modifiers from being stuck, sacrificing some memory */ +#define PREVENT_STUCK_MODIFIERS + +#ifdef SUBPROJECT_rev3 + #include "rev3/config.h" +#endif +#ifdef SUBPROJECT_rev4 + #include "rev4/config.h" +#endif + +#endif diff --git a/keyboards/planck/keymaps/vifon/keymap.c b/keyboards/planck/keymaps/vifon/keymap.c new file mode 100644 index 000000000..80c4a516c --- /dev/null +++ b/keyboards/planck/keymaps/vifon/keymap.c @@ -0,0 +1,187 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif +#include "timer.h" +#include + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum userlayer { + _QW = 0, + _CM, + _PP, + _PPG, + _NM, + _LW, + _RS, + _DL, + _DYN, +}; + +enum planck_keycodes { + KM_LW = SAFE_RANGE, + KM_RS, + KM_SHLK, /* ShiftLock */ + KM_RST, /* Reset */ + KM_NUM, /* Numeric layer */ + KM_SLP, /* Sleep 250 ms */ + KM_PPLR, /* Pure Pro layer */ + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = { /* Qwerty */ + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN0 }, + {KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL} +}, +[_CM] = { /* Colemak */ + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN0 }, + {KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL} +}, +[_PP] = { /* Pure Pro */ + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_RSFT, KC_UP, KC_RCTL}, + {KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT} +}, +[_PPG] = { /* Pure Pro: Gaming */ + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, DF(_RS), _______, _______}, + {_______, _______, XXXXXXX, _______, KM_RS , _______, _______, KM_LW , _______, _______, _______, _______}, +}, +[_NM] = { /* Numeric */ + {KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, KC_FN0 }, + {_______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, _______, _______, _______} +}, +[_LW]= { /* LOWER */ + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_ESC, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), KM_NUM, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), KM_SLP, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_ENT }, + {_______, BL_TOGG, _______, _______, _______, KC_BTN1, KC_BTN1, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_RS]= { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, + {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), KM_PPLR, KM_RST, KC_ENT }, + {_______, BL_STEP, _______, _______, _______, KC_BTN2, KC_BTN2, _______, KC_MPLY, KC_VOLD, KC_VOLU, _______} +}, +[_DL]= { /* DUAL */ + {_______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, _______}, + {_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ACL0, KC_ACL2}, + {_______, _______, KC_BTN2, KC_BTN3, KC_BTN1, KC_WWW_BACK, KC_WWW_FORWARD, KC_MUTE, _______, _______, _______, _______}, + {_______, _______, KC_LGUI, KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______} +}, +[_DYN]= { /* special */ + {_______, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, _______, KC_INS, _______, KC_PSCR, KC_PAUS}, + {_______, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_SLCK, KC_NLCK}, + {KM_SHLK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, +}; + +#undef _______ + +const uint16_t PROGMEM fn_actions[] = { + ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t key_timer; + + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + switch (keycode) { + case KM_LW: + if (record->event.pressed) { + layer_on(_LW); + } else { + layer_off(_LW); + } + update_tri_layer(_LW, _RS, _DL); + return false; + break; + case KM_RS: + if (record->event.pressed) { + layer_on(_RS); + } else { + layer_off(_RS); + } + update_tri_layer(_LW, _RS, _DL); + return false; + break; + case KM_SHLK: + register_code(KC_LSFT); + break; + case KM_RST: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) >= 500) { + clear_keyboard(); + backlight_toggle(); + _delay_ms(250); + backlight_toggle(); + bootloader_jump(); + } + } + break; + case KM_PPLR: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) >= 250) { + default_layer_set((1UL << _PP) | (1UL << _PPG)); + backlight_toggle(); + _delay_ms(100); + backlight_toggle(); + } else { + default_layer_set(1UL << _PP); + } + } + break; + case KM_NUM: + layer_on(_NM); + break; + case KM_SLP: + if (record->event.pressed) { + _delay_ms(250); + } + break; + } + + + if (record->event.pressed + && IS_LAYER_ON(_NM) + && keymap_key_to_keycode(_NM, record->event.key) == KC_TRNS) { + + layer_off(_NM); + } + + return true; +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +} -- cgit v1.2.3-24-g4f1b From 932705706edc22774d89fb94ebad9ffe690a270c Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Mon, 10 Oct 2016 01:34:34 +0700 Subject: Add example keymap --- keyboards/planck/keymaps/priyadi/Makefile | 26 ++ keyboards/planck/keymaps/priyadi/keymap.c | 417 +++++++++++++++++++++++++++++ keyboards/planck/keymaps/priyadi/readme.md | 1 + 3 files changed, 444 insertions(+) create mode 100644 keyboards/planck/keymaps/priyadi/Makefile create mode 100644 keyboards/planck/keymaps/priyadi/keymap.c create mode 100644 keyboards/planck/keymaps/priyadi/readme.md (limited to 'keyboards/planck') diff --git a/keyboards/planck/keymaps/priyadi/Makefile b/keyboards/planck/keymaps/priyadi/Makefile new file mode 100644 index 000000000..aa211d2f0 --- /dev/null +++ b/keyboards/planck/keymaps/priyadi/Makefile @@ -0,0 +1,26 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = yes # Unicode map +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/priyadi/keymap.c b/keyboards/planck/keymaps/priyadi/keymap.c new file mode 100644 index 000000000..dd8652d34 --- /dev/null +++ b/keyboards/planck/keymaps/priyadi/keymap.c @@ -0,0 +1,417 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" +#include "process_unicode.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _WORKMAN 2 +#define _PUNC 9 +#define _NUM 10 +#define _FUNC 11 +#define _EMOJI 12 +#define _ADJUST 16 + +enum planck_keycodes { + // layouts + QWERTY = SAFE_RANGE, + COLEMAK, + WORKMAN, + + // layer switchers + PUNC, + NUM, + FUNC, + EMOJI, + + // os switchers + LINUX, + WIN, + OSX, +}; + +// Fillers to make layering clearer +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// unicode map +enum unicode_name { + GRIN, // grinning face 😊 + TJOY, // tears of joy 😂 + SMILE, // grining face with smiling eyes 😁 + HEART, // heart ❤ + EYERT, // smiling face with heart shaped eyes 😍 + CRY, // crying face 😭 + SMEYE, // smiling face with smiling eyes 😊 + UNAMU, // unamused 😒 + KISS, // kiss 😘 + HART2, // two hearts 💕 + WEARY, // weary 😩 + OKHND, // ok hand sign 👌 + PENSV, // pensive 😔 + SMIRK, // smirk 😏 + RECYC, // recycle ♻ + WINK, // wink 😉 + THMUP, // thumb up 👍 + THMDN, // thumb down 👎 + PRAY, // pray 🙏 + PHEW, // relieved 😌 + MUSIC, // musical notes + FLUSH, // flushed 😳 + CELEB, // celebration 🙌 + CRY2, // crying face 😢 + COOL, // smile with sunglasses 😎 + NOEVS, // see no evil + NOEVH, // hear no evil + NOEVK, // speak no evil + POO, // pile of poo + EYES, // eyes + VIC, // victory hand + BHART, // broken heart + SLEEP, // sleeping face + SMIL2, // smiling face with open mouth & sweat + HUNRD, // 100 + CONFU, // confused + TONGU, // face with tongue & winking eye + DISAP, // disappointed + YUMMY, // face savoring delicious food + CLAP, // hand clapping + FEAR, // face screaming in fear + HORNS, // smiling face with horns + HALO, // smiling face with halo + BYE, // waving hand + SUN, // sun + MOON, // moon + SKULL, // skull +}; + +const uint32_t PROGMEM unicode_map[] = { + [GRIN] = 0x1F600, + [TJOY] = 0x1F602, + [SMILE] = 0x1F601, + [HEART] = 0x2764, + [EYERT] = 0x1f60d, + [CRY] = 0x1f62d, + [SMEYE] = 0x1F60A, + [UNAMU] = 0x1F612, + [KISS] = 0x1F618, + [HART2] = 0x1F495, + [WEARY] = 0x1F629, + [OKHND] = 0x1F44C, + [PENSV] = 0x1F614, + [SMIRK] = 0x1F60F, + [RECYC] = 0x267B, + [WINK] = 0x1F609, + [THMUP] = 0x1F44D, + [THMDN] = 0x1F44E, + [PRAY] = 0x1F64F, + [PHEW] = 0x1F60C, + [MUSIC] = 0x1F3B6, + [FLUSH] = 0x1F633, + [CELEB] = 0x1F64C, + [CRY2] = 0x1F622, + [COOL] = 0x1F60E, + [NOEVS] = 0x1F648, + [NOEVH] = 0x1F649, + [NOEVK] = 0x1F64A, + [POO] = 0x1F4A9, + [EYES] = 0x1F440, + [VIC] = 0x270C, + [BHART] = 0x1F494, + [SLEEP] = 0x1F634, + [SMIL2] = 0x1F605, + [HUNRD] = 0x1F4AF, + [CONFU] = 0x1F615, + [TONGU] = 0x1F61C, + [DISAP] = 0x1F61E, + [YUMMY] = 0x1F60B, + [CLAP] = 0x1F44F, + [FEAR] = 0x1F631, + [HORNS] = 0x1F608, + [HALO] = 0x1F607, + [BYE] = 0x1F44B, + [SUN] = 0x2600, + [MOON] = 0x1F314, + [SKULL] = 0x1F480, +}; + +// keymaps + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL} +}, + +/* Workman + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl | + * `-----------------------------------------------------------------------------------' + */ +[_WORKMAN] = { + {KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL} +}, + +/* Punc + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | | | | | | | | _ | + | { | } | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | \ | - | = | [ | ] | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | < | > | | + * `-----------------------------------------------------------------------------------' + */ +[_PUNC] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_GRV, _______, _______, _______, _______, _______, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_DQUO}, + {_______, _______, _______, _______, _______, _______, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT}, + {_______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, KC_LABK, KC_RABK, _______} +}, + +/* Num + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | @ | A | B | C | [ | ] | 4 | 5 | 6 | : |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | D | E | F | & | # | 1 | 2 | 3 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | x | | | | 0 | , | . | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUM] = { + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + { KC_ESC, KC_AT, S(KC_A), S(KC_B), S(KC_C), KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_COLN, KC_BSLS}, + {_______, _______, S(KC_D), S(KC_E), S(KC_F), KC_AMPR, KC_HASH, KC_1, KC_2, KC_3, _______, _______}, + {_______, _______, KC_X, _______, _______, KC_SPC, KC_SPC, KC_0, KC_COMM,KC_KP_DOT,_______, _______} +}, + +/* Func + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | | | PgUp | Up | PgDn | PgUp | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | | Left | Down | Right| PgDn | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | | | | Home | End | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | |Print | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = { + {_______, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_BSPC}, + {_______, KC_F5, KC_F6, KC_F7, KC_F8, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______}, + {_______, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_HOME, KC_END, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,_______,KC_PSCREEN} +}, + +/* Emoji + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_EMOJI] = { + {X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW)}, + {X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS)}, + {X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH)}, + { X(POO), X(EYES),X(HUNRD),X(TONGU),X(SKULL),X(HORNS), X(HALO), X(FEAR), _______,X(YUMMY),X(DISAP),X(NOEVK)} +}, + +/* Adjust + * ,-----------------------------------------------------------------------------------. + * | | |Linux | Win | OSX | | |Qwerty|Colemk|Workmm| | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, _______, LINUX, WIN, OSX, _______, _______, QWERTY, COLEMAK, WORKMAN, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_workman[][2] = SONG(DVORAK_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case WORKMAN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_workman, false, 0); + #endif + persistant_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case PUNC: + if (record->event.pressed) { + layer_on(_PUNC); + update_tri_layer(_PUNC, _EMOJI, _ADJUST); + } else { + layer_off(_PUNC); + update_tri_layer(_PUNC, _EMOJI, _ADJUST); + } + return false; + break; + case EMOJI: + if (record->event.pressed) { + layer_on(_EMOJI); + update_tri_layer(_PUNC, _EMOJI, _ADJUST); + } else { + layer_off(_EMOJI); + update_tri_layer(_PUNC, _EMOJI, _ADJUST); + } + return false; + break; + case NUM: + if (record->event.pressed) { + layer_on(_NUM); + } else { + layer_off(_NUM); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + case LINUX: + set_unicode_input_mode(UC_LNX); + return false; + break; + case WIN: + set_unicode_input_mode(UC_WIN); + return false; + break; + case OSX: + set_unicode_input_mode(UC_OSX); + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + set_unicode_input_mode(UC_LNX); +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/priyadi/readme.md b/keyboards/planck/keymaps/priyadi/readme.md new file mode 100644 index 000000000..de2f25e53 --- /dev/null +++ b/keyboards/planck/keymaps/priyadi/readme.md @@ -0,0 +1 @@ +# Priyadi's Planck Layout \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 18b5c3dccfbf0b717869376f12d38d7e4bf05298 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 18 Oct 2016 13:57:56 -0400 Subject: removes planck/rev3 temporarily --- keyboards/planck/rev3/Makefile | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 keyboards/planck/rev3/Makefile (limited to 'keyboards/planck') diff --git a/keyboards/planck/rev3/Makefile b/keyboards/planck/rev3/Makefile deleted file mode 100644 index 191c6bb66..000000000 --- a/keyboards/planck/rev3/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifndef MAKEFILE_INCLUDED - include ../../../Makefile -endif \ No newline at end of file -- cgit v1.2.3-24-g4f1b