180 lines
8.0 KiB
C
180 lines
8.0 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 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.
|
|
*
|
|
* 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);
|
|
|
|
// notes:
|
|
// - sizeof(wchar_t) == 2
|
|
#include <stddef.h>
|
|
#include <avr/pgmspace.h>
|
|
void P(u_yinyng)(void) {
|
|
static const uint8_t wrapper[] PROGMEM = { KEYBOARD__LeftAlt };
|
|
static const wchar_t string[] PROGMEM = L"☯ hello world :)";
|
|
key_functions__send_unicode_sequence(1, wrapper, string);
|
|
}
|
|
void R(u_yinyng)(void) {}
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// 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, q, w, e, r, t, u_yinyng,
|
|
bkslash, a, s, d, f, g,
|
|
shL2kcap, z, x, c, v, 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,
|
|
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 ),
|
|
|
|
// ............................................................................
|
|
};
|
|
|