aboutsummaryrefslogtreecommitdiffstats
path: root/converter/sun_usb/command_extra.c
blob: aba3fe6da38fb6f7ca2fce0a4f0db825db585998 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "stdbool.h"
#include "stdint.h"
#include "keycode.h"
#include "serial.h"
#include "print.h"
#include "command.h"

bool command_extra(uint8_t code)
{
    switch (code) {
        case KC_H:
        case KC_SLASH: /* ? */
            print("\n\n----- Sun converter Help -----\n");
            print("Up:	Bell On\n");
            print("Down:	Bell Off\n");
            print("Left:	Click On\n");
            print("Right:	Click Off\n");
            print("PgUp:	LED all On\n");
            print("PgDown:	LED all On\n");
            print("Insert:	Layout\n");
            print("Delete:	Reset\n");
            return false;
        case KC_DEL:
            print("Reset\n");
            serial_send(0x01);
            break;
        case KC_UP:
            print("Bell On\n");
            serial_send(0x02);
            break;
        case KC_DOWN:
            print("Bell Off\n");
            serial_send(0x03);
            break;
        case KC_LEFT:
            print("Click On\n");
            serial_send(0x0A);
            break;
        case KC_RIGHT:
            print("Click Off\n");
            serial_send(0x0B);
            break;
        case KC_PGUP:
            print("LED all on\n");
            serial_send(0x0E);
            serial_send(0xFF);
            break;
        case KC_PGDOWN:
            print("LED all off\n");
            serial_send(0x0E);
            serial_send(0x00);
            break;
        case KC_INSERT:
            print("layout\n");
            serial_send(0x0F);
            break;
        default:
            return false;
    }
    return true;
}