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