diff options
author | Yann Hodique <yhodique@google.com> | 2018-10-11 15:26:56 -0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-10-12 10:26:58 -0700 |
commit | 52ecc76e28bbcde9e35d35eb48a4d5b78aa204e2 (patch) | |
tree | 73b86f23c621f581de5134db47bdea6c29a082be /keyboards/converter/sun_usb/command_extra.c | |
parent | 4bb0fb2ffc2d3fd136f5803b92f1a55792645a28 (diff) | |
download | firmware-52ecc76e28bbcde9e35d35eb48a4d5b78aa204e2.tar.gz firmware-52ecc76e28bbcde9e35d35eb48a4d5b78aa204e2.tar.bz2 firmware-52ecc76e28bbcde9e35d35eb48a4d5b78aa204e2.zip |
port sun_usb converter from tmk
initial import
Diffstat (limited to 'keyboards/converter/sun_usb/command_extra.c')
-rw-r--r-- | keyboards/converter/sun_usb/command_extra.c | 64 |
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 @@ +#include QMK_KEYBOARD_H +#include "protocol/serial.h" + +bool sun_bell = false; +bool sun_click = false; + + +bool command_extra(uint8_t code) +{ + switch (code) { + case KC_H: + case KC_SLASH: /* ? */ + print("\n\n----- Sun converter Help -----\n"); + print("Home: Toggle Bell\n"); + print("End: Toggle Click\n"); + print("PgUp: LED all On\n"); + print("PgDown: LED all Off\n"); + print("Insert: Layout\n"); + print("Delete: Reset\n"); + return false; + case KC_DEL: + print("Reset\n"); + serial_send(0x01); + break; + case KC_HOME: + sun_bell = !sun_bell; + if (sun_bell) { + print("Bell On\n"); + serial_send(0x02); + } else { + print("Bell Off\n"); + serial_send(0x03); + } + break; + case KC_END: + sun_click = !sun_click; + if (sun_click) { + print("Click On\n"); + serial_send(0x0A); + } else { + 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: + xprintf("Unknown extra command: %02X\n", code); + return false; + } + return true; +} |