From e0cb9cf30bd9d326bc379bcca6ec44e86ca7c283 Mon Sep 17 00:00:00 2001 From: yeeeargh Date: Wed, 3 Jul 2013 13:04:33 +0200 Subject: [PATCH] Added standard layouts for ANSI and ISO. Moved the initial layout from alaricljs to a seperate layout file. If no layout gets defined ANSI is used as a default. Added a README.md with links to the deskthority wikipages for this project and some build instructions. --- keyboard/hid_liber/Makefile.lufa | 11 ++- keyboard/hid_liber/Makefile.pjrc | 11 ++- keyboard/hid_liber/README.md | 17 +++++ keyboard/hid_liber/keymap.c | 102 ++++---------------------- keyboard/hid_liber/keymap_alaricljs.h | 61 +++++++++++++++ keyboard/hid_liber/keymap_ansi.h | 32 ++++++++ keyboard/hid_liber/keymap_custom.h | 18 +++-- keyboard/hid_liber/keymap_iso.h | 32 ++++++++ 8 files changed, 186 insertions(+), 98 deletions(-) create mode 100644 keyboard/hid_liber/README.md create mode 100644 keyboard/hid_liber/keymap_alaricljs.h create mode 100644 keyboard/hid_liber/keymap_ansi.h create mode 100644 keyboard/hid_liber/keymap_iso.h diff --git a/keyboard/hid_liber/Makefile.lufa b/keyboard/hid_liber/Makefile.lufa index 39a4d1e0f6..c99d1a32f6 100644 --- a/keyboard/hid_liber/Makefile.lufa +++ b/keyboard/hid_liber/Makefile.lufa @@ -125,5 +125,14 @@ include $(TOP_DIR)/protocol/lufa.mk include $(TOP_DIR)/common.mk include $(TOP_DIR)/rules.mk -custom: OPT_DEFS += -DKEYMAP_CUSTOM +ansi: OPT_DEFS += -DLAYOUT_ANSI +ansi: all + +iso: OPT_DEFS += -DLAYOUT_ISO +iso: all + +custom: OPT_DEFS += -DLAYOUT_CUSTOM custom: all + +alaricljs: OPT_DEFS += -DLAYOUT_ALARICLJS +alaricljs: all diff --git a/keyboard/hid_liber/Makefile.pjrc b/keyboard/hid_liber/Makefile.pjrc index 1ef8741bfd..42fb6895e1 100644 --- a/keyboard/hid_liber/Makefile.pjrc +++ b/keyboard/hid_liber/Makefile.pjrc @@ -98,5 +98,14 @@ include $(TOP_DIR)/protocol/pjrc.mk include $(TOP_DIR)/common.mk include $(TOP_DIR)/rules.mk -custom: OPT_DEFS += -DKEYMAP_CUSTOM +ansi: OPT_DEFS += -DLAYOUT_ANSI +ansi: all + +iso: OPT_DEFS += -DLAYOUT_ISO +iso: all + +custom: OPT_DEFS += -DLAYOUT_CUSTOM custom: all + +alaricljs: OPT_DEFS += -DLAYOUT_ALARICLJS +alaricljs: all diff --git a/keyboard/hid_liber/README.md b/keyboard/hid_liber/README.md new file mode 100644 index 0000000000..a5534ce711 --- /dev/null +++ b/keyboard/hid_liber/README.md @@ -0,0 +1,17 @@ +hid_liberation firmware +====================== +DIY daughterboard for Filco Majestouch TKL developed by Geekhack and Deskthority communities. +The PCB was engineered by bpiphany. + +## Wiki on Deskthority.net +- [Instructions](http://deskthority.net/wiki/HID_Liberation_Device_-_Instructions) +- [Assembly Instructions](http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions) + + +Build +----- +Move to this directory then just run `make` like: + + $ make -f Makefile.[pjrc|lufa] [ansi|iso|custom|alaricljs] + +Use `Makefile.pjrc` if you want to use PJRC stack or use `Makefile.lufa` for LUFA stack. diff --git a/keyboard/hid_liber/keymap.c b/keyboard/hid_liber/keymap.c index 28f59aab6b..f17d3762b9 100644 --- a/keyboard/hid_liber/keymap.c +++ b/keyboard/hid_liber/keymap.c @@ -62,12 +62,6 @@ along with this program. If not, see . /* R */ { KC_NO , KC_NO , KC_NO , KC_NO , KC_##KR4, KC_NO , KC_NO , KC_NO } \ } -/* - * Add custom layouts. If no custom layout is defined the default layout is used. -*/ -#if defined(KEYMAP_CUSTOM) - #include "keymap_custom.h" -#else /* * Tenkeyless keyboard default layout, ISO & ANSI (ISO is between Left Shift * and Z, and the ANSI \ key above Return/Enter is used for the additional ISO @@ -90,90 +84,20 @@ along with this program. If not, see . * `-----------------------------------------------------------' `-----------' */ - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Layer 0: Default Layer - * - * ANSI: - * - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| - * `---' `---------------' `---------------' `---------------' `-----------' - * ,-----------------------------------------------------------. ,-----------. - * |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| - * |-----------------------------------------------------------| |-----------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| - * |-----------------------------------------------------------| `-----------' - * |FN1 | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,---. - * |Shft|iso| Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | - * |-----------------------------------------------------------| ,-----------. - * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| - * `-----------------------------------------------------------' `-----------' - */ - - KEYMAP(\ - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, BRK, \ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, INS, HOME, PGUP, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, END, PGDN, \ - FN1, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \ - LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, \ - LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL, LEFT, DOWN, RGHT), - -/* EXAMPLE ISO keymap, see the NUBS and NUHS keycodes - * KEYMAP(\ - * ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, BRK, \ - * GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, INS, HOME, PGUP, \ - * TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, NUHS, DEL, END, PGDN, \ - * CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \ - * LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, \ - * LCTL, FN1, LALT, SPC, RALT, RGUI, APP, RCTL, LEFT, DOWN, RGHT), - */ - - -/* - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Slp| - * `---' `---------------' `---------------' `---------------' `-----------' - * ,-----------------------------------------------------------. ,-----------. - * |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9|Mut|V- |V+ |Backsp | |Ins|Hom|PgU| - * |-----------------------------------------------------------| |-----------| - * |Tab | Q| W| E| R| T| Y| U| I|MSt|Ply|Prv|Nxt|Media| |Del|End|PgD| - * |-----------------------------------------------------------| `-----------' - * |FN1 | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,---. - * |Shft|iso| Z| X|Clc| V| B| N| M| ,| .| /|Caps | |Up | - * |-----------------------------------------------------------| ,-----------. - * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| - * `-----------------------------------------------------------' `-----------' - */ - - KEYMAP(\ - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, SLEP, \ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9,MUTE, VOLD, VOLU, BSPC, INS, HOME, PGUP, \ - TAB, Q, W, E, R, T, Y, U, I,MSTP,MPLY, MPRV, MNXT, MSEL, DEL, END, PGDN, \ - FN1, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \ - LSFT, NUBS, Z, X,CALC, V, B, N, M, COMM, DOT, SLSH, CAPS, UP, \ - LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL, LEFT, DOWN, RGHT), - - -}; - /* - * Fn action definition - */ -static const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(0), - [1] = ACTION_LAYER_MOMENTARY(1), - [2] = ACTION_LAYER_MOMENTARY(2), - [3] = ACTION_LAYER_MOMENTARY(3), - [4] = ACTION_LAYER_MOMENTARY(4), - [5] = ACTION_LAYER_MOMENTARY(5), - [6] = ACTION_LAYER_MOMENTARY(6), - [7] = ACTION_LAYER_MOMENTARY(7), - [8] = ACTION_LAYER_MOMENTARY(8), -}; -#endif + * Add different layouts. If no layout is defined the default layout will be set to ANSI. +*/ +#if defined(LAYOUT_CUSTOM) + #include "keymap_custom.h" +#elif defined(LAYOUT_ALARICLJS) + #include "keymap_alaricljs.h" +#elif defined(LAYOUT_ISO) + #include "keymap_iso.h" +#elif defined(LAYOUT_ANSI) + #include "keymap_ansi.h" +#else + #include "keymap_ansi.h" +#endif #define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) #define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) diff --git a/keyboard/hid_liber/keymap_alaricljs.h b/keyboard/hid_liber/keymap_alaricljs.h new file mode 100644 index 0000000000..8903fc683b --- /dev/null +++ b/keyboard/hid_liber/keymap_alaricljs.h @@ -0,0 +1,61 @@ +// hid_liber alaricljs +// this was the standard layout when hid_liber was merged into tmk's firmware + +static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Layer 0: Default ANSI + * + * ,---. ,---------------. ,---------------. ,---------------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + * `---' `---------------' `---------------' `---------------' `-----------' + * ,-----------------------------------------------------------. ,-----------. + * |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + * |-----------------------------------------------------------| |-----------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + * |-----------------------------------------------------------| `-----------' + * |FN1 | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,---. + * |Shft|iso| Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + * |-----------------------------------------------------------| ,-----------. + * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| + * `-----------------------------------------------------------' `-----------' + */ + + KEYMAP(\ + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, BRK, \ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, INS, HOME, PGUP, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, END, PGDN, \ + FN1, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \ + LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL, LEFT, DOWN, RGHT), + +/* Layer 1: + * + * ,---. ,---------------. ,---------------. ,---------------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Slp| + * `---' `---------------' `---------------' `---------------' `-----------' + * ,-----------------------------------------------------------. ,-----------. + * |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9|Mut|V- |V+ |Backsp | |Ins|Hom|PgU| + * |-----------------------------------------------------------| |-----------| + * |Tab | Q| W| E| R| T| Y| U| I|MSt|Ply|Prv|Nxt|Media| |Del|End|PgD| + * |-----------------------------------------------------------| `-----------' + * |FN1 | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,---. + * |Shft|iso| Z| X|Clc| V| B| N| M| ,| .| /|Caps | |Up | + * |-----------------------------------------------------------| ,-----------. + * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| + * `-----------------------------------------------------------' `-----------' + */ + + KEYMAP(\ + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, SLEP, \ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9,MUTE, VOLD, VOLU, BSPC, INS, HOME, PGUP, \ + TAB, Q, W, E, R, T, Y, U, I,MSTP,MPLY, MPRV, MNXT, MSEL, DEL, END, PGDN, \ + FN1, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \ + LSFT, NUBS, Z, X,CALC, V, B, N, M, COMM, DOT, SLSH, CAPS, UP, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL, LEFT, DOWN, RGHT), + +}; + +static const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // activate layer 1 when FN1 pressed +}; diff --git a/keyboard/hid_liber/keymap_ansi.h b/keyboard/hid_liber/keymap_ansi.h new file mode 100644 index 0000000000..8ce85a4997 --- /dev/null +++ b/keyboard/hid_liber/keymap_ansi.h @@ -0,0 +1,32 @@ +// hid_liber ANSI + +static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Layer 0: Default ANSI + * + * ,---. ,---------------. ,---------------. ,---------------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + * `---' `---------------' `---------------' `---------------' `-----------' + * ,-----------------------------------------------------------. ,-----------. + * |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + * |-----------------------------------------------------------| |-----------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + * |-----------------------------------------------------------| `-----------' + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,---. + * |Shft|iso| Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + * |-----------------------------------------------------------| ,-----------. + * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| + * `-----------------------------------------------------------' `-----------' + */ + + KEYMAP(\ + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, BRK, \ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, INS, HOME, PGUP, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, END, PGDN, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \ + LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL, LEFT, DOWN, RGHT), + +}; + +static const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboard/hid_liber/keymap_custom.h b/keyboard/hid_liber/keymap_custom.h index 257106b51a..03e1a1bfaf 100644 --- a/keyboard/hid_liber/keymap_custom.h +++ b/keyboard/hid_liber/keymap_custom.h @@ -1,7 +1,9 @@ +// hid_liber custom +// ANSI layout with FN key instead of APP button +// Layer 1 has mediakeys on the nav cluster and keypad numbers for alt-codes + static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Default Keymap - * - * ANSI: +/* Layer 0: Default ANSI * * ,---. ,---------------. ,---------------. ,---------------. ,-----------. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| @@ -19,7 +21,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' `-----------' */ - KEYMAP( + KEYMAP(\ ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, BRK, \ GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, INS, HOME, PGUP, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, DEL, END, PGDN, \ @@ -28,7 +30,8 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LCTL, LGUI, LALT, SPC, RALT, RGUI, FN1, RCTL, LEFT, DOWN, RGHT), /* - * Keymap 1: Media Keys + * Layer 1: Media Keys + * Keypad numbers instead of normal numbers * * ,---. ,---------------. ,---------------. ,---------------. ,-----------. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| @@ -46,15 +49,16 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' `-----------' */ - KEYMAP( + KEYMAP(\ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, P1, P2, P3, P4, P5, P6, P7, P8, P9, P0, TRNS, TRNS, TRNS, TRNS, MSEL, VOLU, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MUTE, VOLD, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPLY, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN1, TRNS, MPRV, MSTP, MNXT), + }; static const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(1), // activate Keymap 1 when FN1 pressed + [1] = ACTION_LAYER_MOMENTARY(1), // activate layer 1 when FN1 pressed }; diff --git a/keyboard/hid_liber/keymap_iso.h b/keyboard/hid_liber/keymap_iso.h new file mode 100644 index 0000000000..c18453675b --- /dev/null +++ b/keyboard/hid_liber/keymap_iso.h @@ -0,0 +1,32 @@ +// hid_liber ISO + +static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Layer 0: Default ISO + * + * ,---. ,---------------. ,---------------. ,---------------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + * `---' `---------------' `---------------' `---------------' `-----------' + * ,-----------------------------------------------------------. ,-----------. + * |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + * |-----------------------------------------------------------| |-----------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + * |-----------------------------------------------------------| `-----------' + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,---. + * |Shft|iso| Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + * |-----------------------------------------------------------| ,-----------. + * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| + * `-----------------------------------------------------------' `-----------' + */ + + KEYMAP(\ + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR, SLCK, BRK, \ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, INS, HOME, PGUP, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, NUHS, DEL, END, PGDN, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, \ + LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL, LEFT, DOWN, RGHT), + +}; + +static const uint16_t PROGMEM fn_actions[] = {};