]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - keyboard/ergodox/keymap_common.h
39c4d6b686fc542ac7fc6e55d4a63e8a62976438
[max/tmk_keyboard.git] / keyboard / ergodox / keymap_common.h
1 /*
2 Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
3 Copyright 2016 Mark Sikora <marknsikora@gmail.com>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef KEYMAP_COMMON_H
19 #define KEYMAP_COMMON_H
20
21 #include <stdint.h>
22 #include <stdbool.h>
23 #include <avr/pgmspace.h>
24 #include "keycode.h"
25 #include "action.h"
26 #include "action_macro.h"
27 #include "report.h"
28 #include "host.h"
29 #include "print.h"
30 #include "debug.h"
31 #include "keymap.h"
32
33
34 extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
35 extern const action_t fn_actions[];
36
37
38 /* ErgoDox keymap definition macro */
39 #define KEYMAP(                                                 \
40                                                                 \
41     /* left hand, spatial positions */                          \
42     k00,k01,k02,k03,k04,k05,k06,                                \
43     k10,k11,k12,k13,k14,k15,k16,                                \
44     k20,k21,k22,k23,k24,k25,                                    \
45     k30,k31,k32,k33,k34,k35,k36,                                \
46     k40,k41,k42,k43,k44,                                        \
47                             k55,k56,                            \
48                                 k54,                            \
49                         k53,k52,k51,                            \
50                                                                 \
51     /* right hand, spatial positions */                         \
52         k07,k08,k09,k0A,k0B,k0C,k0D,                            \
53         k17,k18,k19,k1A,k1B,k1C,k1D,                            \
54             k28,k29,k2A,k2B,k2C,k2D,                            \
55         k37,k38,k39,k3A,k3B,k3C,k3D,                            \
56                 k49,k4A,k4B,k4C,k4D,                            \
57     k57,k58,                                                    \
58     k59,                                                        \
59     k5C,k5B,k5A )                                               \
60                                                                 \
61    /* matrix positions */                                       \
62    {                                                            \
63     { KC_##k00,KC_##k10,KC_##k20,KC_##k30,KC_##k40,KC_NO   },   \
64     { KC_##k01,KC_##k11,KC_##k21,KC_##k31,KC_##k41,KC_##k51},   \
65     { KC_##k02,KC_##k12,KC_##k22,KC_##k32,KC_##k42,KC_##k52},   \
66     { KC_##k03,KC_##k13,KC_##k23,KC_##k33,KC_##k43,KC_##k53},   \
67     { KC_##k04,KC_##k14,KC_##k24,KC_##k34,KC_##k44,KC_##k54},   \
68     { KC_##k05,KC_##k15,KC_##k25,KC_##k35,KC_NO,   KC_##k55},   \
69     { KC_##k06,KC_##k16,KC_NO,   KC_##k36,KC_NO,   KC_##k56},   \
70                                                                 \
71     { KC_##k07,KC_##k17,KC_NO,   KC_##k37,KC_NO,   KC_##k57},   \
72     { KC_##k08,KC_##k18,KC_##k28,KC_##k38,KC_NO,   KC_##k58},   \
73     { KC_##k09,KC_##k19,KC_##k29,KC_##k39,KC_##k49,KC_##k59},   \
74     { KC_##k0A,KC_##k1A,KC_##k2A,KC_##k3A,KC_##k4A,KC_##k5A},   \
75     { KC_##k0B,KC_##k1B,KC_##k2B,KC_##k3B,KC_##k4B,KC_##k5B},   \
76     { KC_##k0C,KC_##k1C,KC_##k2C,KC_##k3C,KC_##k4C,KC_##k5C},   \
77     { KC_##k0D,KC_##k1D,KC_##k2D,KC_##k3D,KC_##k4D,KC_NO   }    \
78    }
79
80 #endif