reorganized the keyboard layouts; made a template

partial-rewrite
Ben Blazak 2013-07-24 13:47:47 -07:00
parent 2f628df002
commit a32a9b59d6
7 changed files with 178 additions and 382 deletions

View File

@ -0,0 +1,49 @@
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* A Colemak layout using the "kinesis-mod" template
*
* Implements the "layout" section of '.../firmware/keyboard.h'
*/
#define T_q q
#define T_w w
#define T_e f
#define T_r p
#define T_t g
#define T_a a
#define T_s r
#define T_d s
#define T_f t
#define T_g d
#define T_z z
#define T_x x
#define T_c c
#define T_v v
#define T_b b
#define T_y j
#define T_u l
#define T_i u
#define T_o y
#define T_p semicol
#define T_h h
#define T_j n
#define T_k e
#define T_l i
#define T_semicol o
#define T_quote quote
#define T_n k
#define T_m m
#define T_comma comma
#define T_period period
#define T_slash slash
#include "./templates/kinesis-mod.c.h"

View File

@ -1,197 +0,0 @@
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* A Colemak layout (modified from the Kinesis layout).
*
* Implements the "layout" section of '.../firmware/keyboard.h'
*
* History:
* - Originally submitted by Jason Trill [jjt] (https://github.com/jjt) (who
* declined to be added to the copyright above).
* - Various changes have been made since (see git history)
*/
#include "./common/definitions.h"
// ----------------------------------------------------------------------------
// matrix control
// ----------------------------------------------------------------------------
#include "./common/exec_key.c.h"
// ----------------------------------------------------------------------------
// LED control
// ----------------------------------------------------------------------------
void kb__led__logical_on(char led) {
switch(led) {
case 'N': kb__led__on(1); break; // numlock
case 'C': kb__led__on(2); break; // capslock
case 'S': kb__led__on(3); break; // scroll lock
case 'O': break; // compose
case 'K': break; // kana
};
}
void kb__led__logical_off(char led) {
switch(led) {
case 'N': kb__led__off(1); break; // numlock
case 'C': kb__led__off(2); break; // capslock
case 'S': kb__led__off(3); break; // scroll lock
case 'O': break; // compose
case 'K': break; // kana
};
}
// ----------------------------------------------------------------------------
// keys
// ----------------------------------------------------------------------------
#include "./common/keys.c.h"
KEYS__LAYER__NUM_PU_PO(10, 4);
KEYS__LAYER__NUM_PUSH(10, 4);
KEYS__LAYER__NUM_POP(10);
// ----------------------------------------------------------------------------
// layout
// ----------------------------------------------------------------------------
#include "./common/matrix.h"
static _layout_t _layout = {
// ............................................................................
MATRIX_LAYER( // layer 0 : default (colemak)
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
equal, 1, 2, 3, 4, 5, lpu2l2,
tab, q, w, f, p, g, esc,
ctrlL, a, r, s, t, d,
shL2kcap, z, x, c, v, b, lpupo2l2,
guiL, grave, bkslash, altL, lpupo1l1,
ctrlL, altL,
nop, nop, home,
space, enter, end,
// right hand ..... ......... ......... ......... ......... ......... .........
numPush, 6, 7, 8, 9, 0, dash,
esc, j, l, u, y, semicol, bkslash,
h, n, e, i, o, quote,
numPuPo, k, m, comma, period, slash, shR2kcap,
lpupo1l1, arrowL, arrowD, arrowU, arrowR,
altR, ctrlR,
pageU, nop, nop,
pageD, del, bs ),
// ............................................................................
MATRIX_LAYER( // layer 1 : function and symbol keys
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
transp, F1, F2, F3, F4, F5, F11,
transp, braceL, braceR, brktL, brktR, colon, transp,
transp, bkslash, slash, parenL, parenR, semicol,
transp, exclam, at, pound, dollar, percent, transp,
transp, transp, transp, transp, lpupo3l3,
transp, transp,
transp, transp, transp,
transp, transp, transp,
// right hand ..... ......... ......... ......... ......... ......... .........
F12, F6, F7, F8, F9, F10, power,
transp, nop, equal, plus, dash, undersc, nop,
arrowL, arrowD, arrowU, arrowR, nop, nop,
transp, caret, amp, asterisk, parenL, parenR, transp,
lpupo3l3, transp, transp, transp, transp,
transp, transp,
transp, transp, transp,
transp, transp, transp ),
// ............................................................................
MATRIX_LAYER( // layer 2 : QWERTY alphanum
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
transp, 1, 2, 3, 4, 5, lpo2l2,
transp, q, w, e, r, t, transp,
transp, a, s, d, f, g,
transp, z, x, c, v, b, transp,
transp, transp, transp, transp, transp, transp,
transp, transp,
transp, transp, transp,
transp, transp, transp,
// right hand ..... ......... ......... ......... ......... ......... .........
transp, 6, 7, 8, 9, 0, transp,
transp, y, u, i, o, p, transp,
h, j, k, l, semicol, transp,
transp, n, m, comma, period, slash, transp,
transp, transp, transp, transp, transp,
transp, transp,
transp, transp, transp,
transp, transp, transp ),
// ............................................................................
MATRIX_LAYER( // layer 3 : keyboard functions
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
btldr, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop,
nop, nop,
nop, nop, nop,
nop, nop, nop,
// right hand ..... ......... ......... ......... ......... ......... .........
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop,
nop, nop,
nop, nop, nop,
nop, nop, nop ),
// ............................................................................
MATRIX_LAYER( // layer 4 : numpad
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
transp, transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp, transp,
transp, ins, transp, transp, transp,
transp, transp,
transp, transp, transp,
transp, transp, transp,
// right hand ..... ......... ......... ......... ......... ......... .........
numPop, transp, numPop, equal, kpDiv, kpMul, transp,
transp, transp, kp7, kp8, kp9, kpSub, transp,
transp, kp4, kp5, kp6, kpAdd, transp,
transp, transp, kp1, kp2, kp3, kpEnter, transp,
transp, transp, period, kpEnter, transp,
transp, transp,
transp, transp, transp,
transp, transp, kp0 ),
// ............................................................................
};

View File

@ -0,0 +1,49 @@
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* A Dvorak layout using the "kinesis-mod" template
*
* Implements the "layout" section of '.../firmware/keyboard.h'
*/
#define T_q quote
#define T_w comma
#define T_e period
#define T_r p
#define T_t y
#define T_a a
#define T_s o
#define T_d e
#define T_f u
#define T_g i
#define T_z semicol
#define T_x q
#define T_c j
#define T_v k
#define T_b x
#define T_y f
#define T_u g
#define T_i c
#define T_o r
#define T_p l
#define T_h d
#define T_j h
#define T_k t
#define T_l n
#define T_semicol s
#define T_quote slash
#define T_n b
#define T_m m
#define T_comma w
#define T_period v
#define T_slash z
#include "./templates/kinesis-mod.c.h"

View File

@ -1,168 +0,0 @@
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* A Dvorak layout adapted from the default Kinesis layout. The position of
* the symbol keys on the function layer was (roughly) taken from the Arensito
* layout.
*
* Implements the "layout" section of '.../firmware/keyboard.h'
*/
#include "./common/definitions.h"
// ----------------------------------------------------------------------------
// matrix control
// ----------------------------------------------------------------------------
#include "./common/exec_key.c.h"
// ----------------------------------------------------------------------------
// LED control
// ----------------------------------------------------------------------------
void kb__led__logical_on(char led) {
switch(led) {
case 'N': kb__led__on(1); break; // numlock
case 'C': kb__led__on(2); break; // capslock
case 'S': kb__led__on(3); break; // scroll lock
case 'O': break; // compose
case 'K': break; // kana
};
}
void kb__led__logical_off(char led) {
switch(led) {
case 'N': kb__led__off(1); break; // numlock
case 'C': kb__led__off(2); break; // capslock
case 'S': kb__led__off(3); break; // scroll lock
case 'O': break; // compose
case 'K': break; // kana
};
}
// ----------------------------------------------------------------------------
// keys
// ----------------------------------------------------------------------------
#include "./common/keys.c.h"
KEYS__LAYER__NUM_PUSH(10, 3);
KEYS__LAYER__NUM_POP(10);
// ----------------------------------------------------------------------------
// layout
// ----------------------------------------------------------------------------
#include "./common/matrix.h"
static _layout_t _layout = {
// ............................................................................
MATRIX_LAYER( // layer 0 : default
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
equal, 1, 2, 3, 4, 5, esc,
tab, quote, comma, period, p, y, lpu1l1,
bkslash, a, o, e, u, i,
shL2kcap, semicol, q, j, k, x, lpupo1l1,
guiL, grave, bkslash, arrowL, arrowR,
ctrlL, altL,
nop, nop, home,
bs, del, end,
// right hand ..... ......... ......... ......... ......... ......... .........
numPush, 6, 7, 8, 9, 0, dash,
brktL, f, g, c, r, l, brktR,
d, h, t, n, s, slash,
lpupo1l1, b, m, w, v, z, shR2kcap,
arrowL, arrowD, arrowU, arrowR, guiR,
altR, ctrlR,
pageU, nop, nop,
pageD, enter, space ),
// ............................................................................
MATRIX_LAYER( // layer 1 : function and symbol keys
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
nop, F1, F2, F3, F4, F5, F11,
transp, braceL, braceR, brktL, brktR, nop, lpo1l1,
transp, semicol, slash, dash, kp0, colon,
transp, kp6, kp7, kp8, kp9, plus, lpupo2l2,
transp, transp, transp, transp, transp,
transp, transp,
transp, transp, transp,
transp, transp, transp,
// right hand ..... ......... ......... ......... ......... ......... .........
F12, F6, F7, F8, F9, F10, power,
transp, nop, undersc, lessThan, grtrThan, dollar, volumeU,
bkslash, kp1, parenL, parenR, equal, volumeD,
lpupo2l2, asterisk, kp2, kp3, kp4, kp5, mute,
transp, transp, transp, transp, transp,
transp, transp,
transp, transp, transp,
transp, transp, transp ),
// ............................................................................
MATRIX_LAYER( // layer 2 : keyboard functions
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
btldr, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop,
nop, nop,
nop, nop, nop,
nop, nop, nop,
// right hand ..... ......... ......... ......... ......... ......... .........
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop, nop, nop,
nop, nop, nop, nop, nop,
nop, nop,
nop, nop, nop,
nop, nop, nop ),
// ............................................................................
MATRIX_LAYER( // layer 3 : numpad
// macro, unused,
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
transp, transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp,
transp, transp, transp, transp, transp, transp, transp,
transp, ins, transp, transp, transp,
transp, transp,
transp, transp, transp,
transp, transp, transp,
// right hand ..... ......... ......... ......... ......... ......... .........
numPop, transp, numPop, equal, kpDiv, kpMul, transp,
transp, transp, kp7, kp8, kp9, kpSub, transp,
transp, kp4, kp5, kp6, kpAdd, transp,
transp, transp, kp1, kp2, kp3, kpEnter, transp,
transp, transp, period, kpEnter, transp,
transp, transp,
transp, transp, transp,
transp, transp, kp0 ),
// ............................................................................
};

View File

@ -0,0 +1,49 @@
/* ----------------------------------------------------------------------------
* Copyright (c) 2013 Ben Blazak <benblazak.dev@gmail.com>
* Released under The MIT License (see "doc/licenses/MIT.md")
* Project located at <https://github.com/benblazak/ergodox-firmware>
* ------------------------------------------------------------------------- */
/** description
* A QWERTY layout using the "kinesis-mod" template
*
* Implements the "layout" section of '.../firmware/keyboard.h'
*/
#define T_q q
#define T_w w
#define T_e e
#define T_r r
#define T_t t
#define T_a a
#define T_s s
#define T_d d
#define T_f f
#define T_g g
#define T_z z
#define T_x x
#define T_c c
#define T_v v
#define T_b b
#define T_y y
#define T_u u
#define T_i i
#define T_o o
#define T_p p
#define T_h h
#define T_j j
#define T_k k
#define T_l l
#define T_semicol semicol
#define T_quote quote
#define T_n n
#define T_m m
#define T_comma comma
#define T_period period
#define T_slash slash
#include "./templates/kinesis-mod.c.h"

View File

@ -5,22 +5,31 @@
* ------------------------------------------------------------------------- */
/** description
* A QWERTY layout adapted from the default Kinesis layout. The position of
* the symbol keys on the function layer was (roughly) taken from the Arensito
* layout.
* A layout with the home layer adapted from the default Kinesis layout. The
* position of the symbol keys on the function layer was (roughly) taken from
* the Arensito layout.
*
* Implements the "layout" section of '.../firmware/keyboard.h'
*
* The template key prefix is `T_`, with the rest of the name indicating the
* key's position in the QWERTY layout.
*/
#include "./common/definitions.h"
#ifndef ERGODOX_FIRMWARE__KEYBOARD__ERGODOX__LAYOUT__TEMPLATES__KINESIS_MOD__C__H
#define ERGODOX_FIRMWARE__KEYBOARD__ERGODOX__LAYOUT__TEMPLATES__KINESIS_MOD__C__H
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#include "../common/definitions.h"
// ----------------------------------------------------------------------------
// matrix control
// ----------------------------------------------------------------------------
#include "./common/exec_key.c.h"
#include "../common/exec_key.c.h"
// ----------------------------------------------------------------------------
@ -52,7 +61,7 @@ void kb__led__logical_off(char led) {
// keys
// ----------------------------------------------------------------------------
#include "./common/keys.c.h"
#include "../common/keys.c.h"
KEYS__LAYER__NUM_PUSH(10, 3);
KEYS__LAYER__NUM_POP(10);
@ -62,7 +71,7 @@ KEYS__LAYER__NUM_POP(10);
// layout
// ----------------------------------------------------------------------------
#include "./common/matrix.h"
#include "../common/matrix.h"
static _layout_t _layout = {
@ -74,18 +83,18 @@ static _layout_t _layout = {
K, nop,
// left hand ...... ......... ......... ......... ......... ......... .........
equal, 1, 2, 3, 4, 5, esc,
tab, q, w, e, r, t, lpu1l1,
bkslash, a, s, d, f, g,
shL2kcap, z, x, c, v, b, lpupo1l1,
tab, T_q, T_w, T_e, T_r, T_t, lpu1l1,
bkslash, T_a, T_s, T_d, T_f, T_g,
shL2kcap, T_z, T_x, T_c, T_v, T_b, lpupo1l1,
guiL, grave, bkslash, arrowL, arrowR,
ctrlL, altL,
nop, nop, home,
bs, del, end,
// right hand ..... ......... ......... ......... ......... ......... .........
numPush, 6, 7, 8, 9, 0, dash,
brktL, y, u, i, o, p, brktR,
h, j, k, l, semicol, quote,
lpupo1l1, n, m, comma, period, slash, shR2kcap,
brktL, T_y, T_u, T_i, T_o, T_p, brktR,
T_h, T_j, T_k, T_l,T_semicol, T_quote,
lpupo1l1, T_n, T_m, T_comma, T_period, T_slash, shR2kcap,
arrowL, arrowD, arrowU, arrowR, guiR,
altR, ctrlR,
pageU, nop, nop,
@ -166,3 +175,8 @@ shL2kcap, z, x, c, v, b, lpupo1l1,
// ............................................................................
};
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#endif // ERGODOX_FIRMWARE__KEYBOARD__ERGODOX__LAYOUT__TEMPLATES__KINESIS_MOD__C__H

View File

@ -21,13 +21,13 @@ F_CPU := 16000000
# processor speed, in Hz; max value is 16000000 (16MHz); must match
# initialization in source
KEYBOARD_LAYOUT := qwerty-kinesis-mod
KEYBOARD_LAYOUT := qwerty--kinesis-mod
# default layout for this keyboard
KEYBOARD_LAYOUTS := \
colemak-symbol-mod \
dvorak-kinesis-mod \
qwerty-kinesis-mod
colemak--kinesis-mod \
dvorak--kinesis-mod \
qwerty--kinesis-mod
# a list of all available layouts for this keyboard
# -----------------------------------------------------------------------------