aboutsummaryrefslogtreecommitdiff
path: root/keyboards/converter/sun_usb/command_extra.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/converter/sun_usb/command_extra.c')
-rw-r--r--keyboards/converter/sun_usb/command_extra.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/keyboards/converter/sun_usb/command_extra.c b/keyboards/converter/sun_usb/command_extra.c
new file mode 100644
index 000000000..756a9160b
--- /dev/null
+++ b/keyboards/converter/sun_usb/command_extra.c
@@ -0,0 +1,64 @@
1#include QMK_KEYBOARD_H
2#include "protocol/serial.h"
3
4bool sun_bell = false;
5bool sun_click = false;
6
7
8bool command_extra(uint8_t code)
9{
10 switch (code) {
11 case KC_H:
12 case KC_SLASH: /* ? */
13 print("\n\n----- Sun converter Help -----\n");
14 print("Home: Toggle Bell\n");
15 print("End: Toggle Click\n");
16 print("PgUp: LED all On\n");
17 print("PgDown: LED all Off\n");
18 print("Insert: Layout\n");
19 print("Delete: Reset\n");
20 return false;
21 case KC_DEL:
22 print("Reset\n");
23 serial_send(0x01);
24 break;
25 case KC_HOME:
26 sun_bell = !sun_bell;
27 if (sun_bell) {
28 print("Bell On\n");
29 serial_send(0x02);
30 } else {
31 print("Bell Off\n");
32 serial_send(0x03);
33 }
34 break;
35 case KC_END:
36 sun_click = !sun_click;
37 if (sun_click) {
38 print("Click On\n");
39 serial_send(0x0A);
40 } else {
41 print("Click Off\n");
42 serial_send(0x0B);
43 }
44 break;
45 case KC_PGUP:
46 print("LED all on\n");
47 serial_send(0x0E);
48 serial_send(0xFF);
49 break;
50 case KC_PGDOWN:
51 print("LED all off\n");
52 serial_send(0x0E);
53 serial_send(0x00);
54 break;
55 case KC_INSERT:
56 print("layout\n");
57 serial_send(0x0F);
58 break;
59 default:
60 xprintf("Unknown extra command: %02X\n", code);
61 return false;
62 }
63 return true;
64}