X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=keyboard%2Fhid_liber%2Fkeymap.c;h=f17d3762b9422a524592838e6ce83047a8a43592;hb=04949711f4abc89c921e48e35e8f818ebb5d3058;hp=f3d6bfa2efb435bba9224778dea2b7952f108069;hpb=1f19176867b1b1f760c0ec41cd78fbb6832d29ad;p=max%2Ftmk_keyboard.git
diff --git a/keyboard/hid_liber/keymap.c b/keyboard/hid_liber/keymap.c
index f3d6bfa2..f17d3762 100644
--- a/keyboard/hid_liber/keymap.c
+++ b/keyboard/hid_liber/keymap.c
@@ -24,7 +24,6 @@ along with this program. If not, see .
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
-#include "layer_switch.h"
#include "report.h"
#include "host.h"
#include "print.h"
@@ -63,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
@@ -91,121 +84,31 @@ 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),
-
-
-};
-
-static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {};
-
/*
- * Fn action definition
- */
-static const uint16_t PROGMEM fn_actions[] = {
- [0] = ACTION_DEFAULT_LAYER_SET(0),
- [1] = ACTION_DEFAULT_LAYER_SET(1),
- [2] = ACTION_DEFAULT_LAYER_SET(2),
- [3] = ACTION_DEFAULT_LAYER_SET(3),
- [4] = ACTION_DEFAULT_LAYER_SET(4),
- [5] = ACTION_DEFAULT_LAYER_SET(5),
- [6] = ACTION_DEFAULT_LAYER_SET(6),
- [7] = ACTION_DEFAULT_LAYER_SET(7),
- [8] = ACTION_DEFAULT_LAYER_SET(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 OVERLAYS_SIZE (sizeof(overlays) / sizeof(overlays[0]))
#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
{
- /* Overlay: 16-31(OVERLAY_BIT(0x10) | overlay_layer) */
- if (layer & OVERLAY_BIT) {
- layer &= OVERLAY_MASK;
- if (layer < OVERLAYS_SIZE) {
- return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]);
- } else {
- // XXX: this may cuaes bootlaoder_jump incositent fail.
- //debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n");
- return KC_TRANSPARENT;
- }
- }
- /* Keymap: 0-15 */
- else {
- if (layer < KEYMAPS_SIZE) {
- return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
- } else {
- // XXX: this may cuaes bootlaoder_jump incositent fail.
- //debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n");
- // fall back to layer 0
- return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
- }
+ if (layer < KEYMAPS_SIZE) {
+ return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
+ } else {
+ return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
}