2012-10-21 13:36:44 +00:00
|
|
|
#include "stdbool.h"
|
|
|
|
#include "stdint.h"
|
|
|
|
#include "keycode.h"
|
|
|
|
#include "serial.h"
|
|
|
|
#include "print.h"
|
|
|
|
#include "command.h"
|
|
|
|
|
2016-05-14 21:29:05 +00:00
|
|
|
bool sun_bell = false;
|
|
|
|
bool sun_click = false;
|
|
|
|
|
|
|
|
|
2012-10-21 13:36:44 +00:00
|
|
|
bool command_extra(uint8_t code)
|
|
|
|
{
|
|
|
|
switch (code) {
|
|
|
|
case KC_H:
|
|
|
|
case KC_SLASH: /* ? */
|
|
|
|
print("\n\n----- Sun converter Help -----\n");
|
2016-05-14 21:29:05 +00:00
|
|
|
print("Home: Toggle Bell\n");
|
|
|
|
print("End: Toggle Click\n");
|
|
|
|
print("PgUp: LED all On\n");
|
2016-09-24 01:18:05 +00:00
|
|
|
print("PgDown: LED all Off\n");
|
2016-05-14 21:29:05 +00:00
|
|
|
print("Insert: Layout\n");
|
|
|
|
print("Delete: Reset\n");
|
2012-10-21 13:36:44 +00:00
|
|
|
return false;
|
2014-08-01 04:26:42 +00:00
|
|
|
case KC_DEL:
|
|
|
|
print("Reset\n");
|
|
|
|
serial_send(0x01);
|
|
|
|
break;
|
2016-05-14 21:29:05 +00:00
|
|
|
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);
|
|
|
|
}
|
2012-10-21 13:36:44 +00:00
|
|
|
break;
|
2016-05-14 21:29:05 +00:00
|
|
|
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;
|
2014-08-01 04:26:42 +00:00
|
|
|
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:
|
2012-10-21 13:36:44 +00:00
|
|
|
print("layout\n");
|
|
|
|
serial_send(0x0F);
|
|
|
|
break;
|
|
|
|
default:
|
2016-05-14 21:29:05 +00:00
|
|
|
xprintf("Unknown extra command: %02X\n", code);
|
2012-10-21 13:36:44 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|