fc660c: Add unimap files
[tmk_keyboard.git] / keyboard / fc660c / unimap.c
1 #include "action.h"
2 #include "actionmap.h"
3 #include "hook.h"
4 #include "fc660c.h"
5
6
7 #define AC_L3 ACTION_LAYER_MOMENTARY(3)
8 #define AC_L4 ACTION_LAYER_MOMENTARY(4)
9 #define AC_LS_2 ACTION_LAYER_MODS(2, MOD_LSFT)
10 #define AC_RS_2 ACTION_LAYER_MODS(2, MOD_RSFT)
11 #define AC_TGL1 ACTION_LAYER_TOGGLE(1)
12
13 // emulates FC660C default keymap
14 #ifdef KEYMAP_SECTION_ENABLE
15 const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
16 #else
17 const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
18 #endif
19 [0] = KMAP(
20 ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS,
21 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL,
22 LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT,
23 LS_2,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RS_2,UP,
24 LCTL,LGUI,LALT, SPC, RALT,RCTL,L3, LEFT,DOWN,RGHT
25 ),
26 [1] = KMAP(
27 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS,
28 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL,
29 LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT,
30 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,UP,
31 LCTL,LGUI,LALT, SPC, RALT,RCTL,L4, LEFT,DOWN,RGHT
32 ),
33 [2] = KMAP(
34 GRV, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,
35 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,
36 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,
37 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
38 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS
39 ),
40 [3] = KMAP(
41 GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,
42 CAPS,TGL1,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,TRNS,TRNS, TRNS,
43 TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,TRNS,TRNS, TRNS,
44 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,TRNS, TRNS,PGUP,
45 TRNS,TRNS,TRNS, TRNS, TRNS,APP, L3, HOME,PGDN,END
46 ),
47 [4] = KMAP(
48 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS,
49 CAPS,TGL1,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,TRNS,TRNS, TRNS,
50 TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,TRNS,TRNS, TRNS,
51 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,TRNS, TRNS,PGUP,
52 TRNS,TRNS,TRNS, TRNS, TRNS,APP, L4, HOME,PGDN,END
53 ),
54 };
55
56
57 void hook_layer_change(uint32_t layer_state)
58 {
59 // lights LED on Insert when layer 1 is enabled
60 if (layer_state & (1L<<1)) {
61 PORTB &= ~(1<<5);
62 } else {
63 PORTB |= (1<<5);
64 }
65 }
Imprint / Impressum