ergodox-firmware/firmware/keyboard/ergodox/layout/templates/kinesis-mod.c.h

187 lines
8.5 KiB
C

/* ----------------------------------------------------------------------------
* 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 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.
*
* TODO:
* - do i have the arrow keys in the wrong place? grr. need to check. the
* goal here is to emulate the kinesis, lol.
*/
#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"
// ----------------------------------------------------------------------------
// 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, 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, 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,
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, dmp_sram,
nop, nop, nop, nop, nop, nop, dmp_prog,
nop, nop, nop, nop, nop, dmp_eepr,
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 ),
// ............................................................................
};
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
#endif // ERGODOX_FIRMWARE__KEYBOARD__ERGODOX__LAYOUT__TEMPLATES__KINESIS_MOD__C__H