]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - keyboard/alps64/actionmap_hasu.c
adb_usb: Fix start up delay for AEK/AEKII
[max/tmk_keyboard.git] / keyboard / alps64 / actionmap_hasu.c
1 #include "actionmap.h"
2 #include "action_code.h"
3 #include "actionmap_common.h"
4
5
6 /*
7  * Actions
8  */
9 #define AC_LM1      ACTION_LAYER_MOMENTARY(1)                   // HHKB layer
10 #define AC_LT1      ACTION_LAYER_TAP_KEY(1, KC_ENTER)           // HHKB layer
11 #define AC_LT2      ACTION_LAYER_TAP_KEY(2, KC_SLASH)           // Cursor layer with Slash*
12 #define AC_LT3      ACTION_LAYER_TAP_KEY(3, KC_SCLN)            // Mousekey layer with Semicolon*
13 #define AC_LT4      ACTION_LAYER_TAP_KEY(4, KC_SPC)             // Space Fn
14 #define AC_LM3      ACTION_LAYER_MOMENTARY(3)                   // Mousekey layer(IJKL)
15 #define AC_APSW     ACTION_MACRO(ALT_TAB)                       // Application switching
16 #define AC_BACK     ACTION_MODS_KEY(MOD_LALT, KC_LEFT)
17 #define AC_FRWD     ACTION_MODS_KEY(MOD_LALT, KC_RIGHT)
18 #define AC_LM5      ACTION_LAYER_MOMENTARY(5)
19
20
21 /*
22  * Macro definition
23  */
24 enum macro_id {
25     ALT_TAB,
26 };
27 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
28 {
29     switch (id) {
30         case ALT_TAB:
31             return (record->event.pressed ?
32                     MACRO( D(LALT), D(TAB), END ) :
33                     MACRO( U(TAB), END ));
34     }
35     return MACRO_NONE;
36 }
37
38
39 const action_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = {
40     /* Default Layer
41      * ,-----------------------------------------------------------.
42      * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|   \   |
43      * |-----------------------------------------------------------|
44      * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|Bspc |
45      * |-----------------------------------------------------------|
46      * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|Fn3|  '|FN1     |
47      * |-----------------------------------------------------------|
48      * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|Fn2|Shift     |
49      * |-----------------------------------------------------------|
50      * |Ctrl |Gui |Alt  |       Space            |Alt   |Fn5 |Ctrl |
51      * `-----------------------------------------------------------'
52      */
53     [0] = ACTIONMAP_AEK( \
54         ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS, \
55         TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSPC, \
56         LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   LT3, QUOT,LT1, \
57         LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, LT2, RSFT, \
58         LCTL,LGUI,LALT,          LT4,                          LM5, LM3, LM1),
59     /* HHKB mode[HHKB Fn]
60      * ,-----------------------------------------------------------.
61      * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|   `   |
62      * |-----------------------------------------------------------|
63      * |Caps |   |   |   |   |   |   |   |Psc|Slk|Pus|Up |   |Del  |
64      * |-----------------------------------------------------------|
65      * |Contro|VoD|VoU|Mut|   |   |  *|  /|Hom|PgU|Lef|Rig|Enter   |
66      * |-----------------------------------------------------------|
67      * |Shift   |   |   |   |   |   |  +|  -|End|PgD|Dow|Shift     |
68      * |-----------------------------------------------------------|
69      * |Ctrl |Gui |Alt  |       Space            |Alt   |Fn5 |Ctrl |
70      * `-----------------------------------------------------------'
71      */
72     [1] = ACTIONMAP_AEK( \
73         PWR, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, GRV, \
74         CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP,  TRNS,DEL, \
75         TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,TRNS, \
76         TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS, \
77         TRNS,TRNS,TRNS,          TRNS,                         TRNS,TRNS,TRNS),
78
79     /* Vi mode[Slash]
80      * ,-----------------------------------------------------------.
81      * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Del    |
82      * |-----------------------------------------------------------|
83      * |Tab  |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd|   |   |   |Backs|
84      * |-----------------------------------------------------------|
85      * |Contro|   |Lef|Dow|Rig|   |Lef|Dow|Up |Rig|   |   |Return  |
86      * |-----------------------------------------------------------|
87      * |Shift   |   |   |   |   |   |Hom|PgD|PgUlEnd|Fn0|Shift     |
88      * |-----------------------------------------------------------|
89      * |Ctrl |Gui |Alt  |       Space            |Alt   |Fn5 |Ctrl |
90      * `-----------------------------------------------------------'
91      */
92     [2] = ACTIONMAP_AEK( \
93         GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, GRV, \
94         TAB, HOME,PGDN,UP,  PGUP,END, HOME,PGDN,PGUP,END, TRNS,TRNS,TRNS,DEL, \
95         TRNS,TRNS,LEFT,DOWN,RGHT,TRNS,LEFT,DOWN,UP,  RGHT,TRNS,TRNS,ENT, \
96         TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGDN,PGUP,END, TRNS,TRNS, \
97         TRNS,TRNS,TRNS,          TRNS,                         TRNS,TRNS,TRNS),
98
99     /* Mouse mode(IJKL)[Semicolon]
100      * ,-----------------------------------------------------------.
101      * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
102      * |-----------------------------------------------------------|
103      * |Tab  |   |   |   |   |   |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T|
104      * |-----------------------------------------------------------|
105      * |Contro|   |   |   |   |   |Mb2|McL|McD|McR|Fn |   |Return  |
106      * |-----------------------------------------------------------|
107      * |Shift   |   |   |   |   |Mb3|Mb2|Mb1|Mb4|Mb5|   |Shift |   |
108      * |-----------------------------------------------------------|
109      * |Ctrl |Gui |Alt  |       Space            |Alt   |Fn5 |Ctrl |
110      * `-----------------------------------------------------------'
111      * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel
112      */
113     [3] = ACTIONMAP_AEK( \
114         GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, GRV, \
115         TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,WH_D,MS_U,WH_U,RGHT,BACK,FRWD,APSW, \
116         TRNS,ACL0,ACL1,ACL2,ACL2,NO,  NO,  MS_L,MS_D,MS_R,TRNS,TRNS,TRNS,\
117         TRNS,TRNS,TRNS,TRNS,TRNS,BTN3,BTN2,BTN1,BACK,FRWD,TRNS,TRNS, \
118         TRNS,TRNS,TRNS,          BTN1,                         TRNS,TRNS,TRNS),
119
120     /* Layer 4: Mouse mode(IJKL)[Space]
121      * ,-----------------------------------------------------------.
122      * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
123      * |-----------------------------------------------------------|
124      * |Tab  |   |   |   |   |   |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T|
125      * |-----------------------------------------------------------|
126      * |Contro|   |   |   |   |   |Mb2|McL|McD|McR|Mb1|   |Return  |
127      * |-----------------------------------------------------------|
128      * |Shift   |   |   |   |   |Mb3|Mb2|Mb1|Mb4|Mb5|   |Shift |   |
129      * |-----------------------------------------------------------|
130      * |Ctrl |Gui |Alt  |       Space            |Alt   |Fn5 |Ctrl |
131      * `-----------------------------------------------------------'
132      * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel
133      */
134     [4] = ACTIONMAP_AEK( \
135         GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, GRV, \
136         APSW,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,WH_D,MS_U,WH_U,RGHT,BACK,FRWD,APSW, \
137         TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,MS_L,MS_D,MS_R,BTN1,TRNS,ENT, \
138         TRNS,TRNS,TRNS,TRNS,TRNS,BTN3,BTN2,BTN1,BACK,TRNS,TRNS,TRNS, \
139         TRNS,TRNS,TRNS,          TRNS,                         TRNS,TRNS,TRNS),
140
141     /* 40% */
142     [5] = ACTIONMAP_AEK( \
143         TRNS,1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   TRNS,TRNS,TRNS, \
144         TRNS,s(1),s(2),s(3),s(4),s(5),s(6),s(7),s(8),s(9),s(0),TRNS,TRNS,TRNS, \
145         TRNS,1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   TRNS,TRNS, \
146         TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
147         TRNS,TRNS,TRNS,          TRNS,                         TRNS,TRNS,TRNS),
148 };