]>
Commit | Line | Data |
---|---|---|
f291c227 | 1 | #include "stdbool.h" |
2 | #include "stdint.h" | |
3 | #include "keycode.h" | |
4 | #include "serial.h" | |
5 | #include "print.h" | |
6 | #include "command.h" | |
7 | ||
d5d58f56 JH |
8 | bool sun_bell = false; |
9 | bool sun_click = false; | |
10 | ||
11 | ||
f291c227 | 12 | bool command_extra(uint8_t code) |
13 | { | |
14 | switch (code) { | |
15 | case KC_H: | |
16 | case KC_SLASH: /* ? */ | |
17 | print("\n\n----- Sun converter Help -----\n"); | |
d5d58f56 JH |
18 | print("Home: Toggle Bell\n"); |
19 | print("End: Toggle Click\n"); | |
20 | print("PgUp: LED all On\n"); | |
f88a0f7f | 21 | print("PgDown: LED all Off\n"); |
d5d58f56 JH |
22 | print("Insert: Layout\n"); |
23 | print("Delete: Reset\n"); | |
f291c227 | 24 | return false; |
523cc6aa | 25 | case KC_DEL: |
26 | print("Reset\n"); | |
27 | serial_send(0x01); | |
28 | break; | |
d5d58f56 JH |
29 | case KC_HOME: |
30 | sun_bell = !sun_bell; | |
31 | if (sun_bell) { | |
32 | print("Bell On\n"); | |
33 | serial_send(0x02); | |
34 | } else { | |
35 | print("Bell Off\n"); | |
36 | serial_send(0x03); | |
37 | } | |
f291c227 | 38 | break; |
d5d58f56 JH |
39 | case KC_END: |
40 | sun_click = !sun_click; | |
41 | if (sun_click) { | |
42 | print("Click On\n"); | |
43 | serial_send(0x0A); | |
44 | } else { | |
45 | print("Click Off\n"); | |
46 | serial_send(0x0B); | |
47 | } | |
48 | break; | |
523cc6aa | 49 | case KC_PGUP: |
50 | print("LED all on\n"); | |
51 | serial_send(0x0E); | |
52 | serial_send(0xFF); | |
53 | break; | |
54 | case KC_PGDOWN: | |
55 | print("LED all off\n"); | |
56 | serial_send(0x0E); | |
57 | serial_send(0x00); | |
58 | break; | |
59 | case KC_INSERT: | |
f291c227 | 60 | print("layout\n"); |
61 | serial_send(0x0F); | |
62 | break; | |
63 | default: | |
d5d58f56 | 64 | xprintf("Unknown extra command: %02X\n", code); |
f291c227 | 65 | return false; |
66 | } | |
67 | return true; | |
68 | } |