Make Bell and Click work on Sun Type 5c.
It seems that the Sun Type 5c keyboard will not send the arrow key codes if both shift keys are pressed. To get bell and keyclick working, I used Home/End as toggle keys instead.
This commit is contained in:
parent
d3332d32da
commit
d5d58f566d
@ -5,16 +5,18 @@
|
|||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
|
||||||
|
bool sun_bell = false;
|
||||||
|
bool sun_click = false;
|
||||||
|
|
||||||
|
|
||||||
bool command_extra(uint8_t code)
|
bool command_extra(uint8_t code)
|
||||||
{
|
{
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case KC_H:
|
case KC_H:
|
||||||
case KC_SLASH: /* ? */
|
case KC_SLASH: /* ? */
|
||||||
print("\n\n----- Sun converter Help -----\n");
|
print("\n\n----- Sun converter Help -----\n");
|
||||||
print("Up: Bell On\n");
|
print("Home: Toggle Bell\n");
|
||||||
print("Down: Bell Off\n");
|
print("End: Toggle Click\n");
|
||||||
print("Left: Click On\n");
|
|
||||||
print("Right: Click Off\n");
|
|
||||||
print("PgUp: LED all On\n");
|
print("PgUp: LED all On\n");
|
||||||
print("PgDown: LED all On\n");
|
print("PgDown: LED all On\n");
|
||||||
print("Insert: Layout\n");
|
print("Insert: Layout\n");
|
||||||
@ -24,21 +26,25 @@ bool command_extra(uint8_t code)
|
|||||||
print("Reset\n");
|
print("Reset\n");
|
||||||
serial_send(0x01);
|
serial_send(0x01);
|
||||||
break;
|
break;
|
||||||
case KC_UP:
|
case KC_HOME:
|
||||||
|
sun_bell = !sun_bell;
|
||||||
|
if (sun_bell) {
|
||||||
print("Bell On\n");
|
print("Bell On\n");
|
||||||
serial_send(0x02);
|
serial_send(0x02);
|
||||||
break;
|
} else {
|
||||||
case KC_DOWN:
|
|
||||||
print("Bell Off\n");
|
print("Bell Off\n");
|
||||||
serial_send(0x03);
|
serial_send(0x03);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case KC_LEFT:
|
case KC_END:
|
||||||
|
sun_click = !sun_click;
|
||||||
|
if (sun_click) {
|
||||||
print("Click On\n");
|
print("Click On\n");
|
||||||
serial_send(0x0A);
|
serial_send(0x0A);
|
||||||
break;
|
} else {
|
||||||
case KC_RIGHT:
|
|
||||||
print("Click Off\n");
|
print("Click Off\n");
|
||||||
serial_send(0x0B);
|
serial_send(0x0B);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case KC_PGUP:
|
case KC_PGUP:
|
||||||
print("LED all on\n");
|
print("LED all on\n");
|
||||||
@ -55,6 +61,7 @@ bool command_extra(uint8_t code)
|
|||||||
serial_send(0x0F);
|
serial_send(0x0F);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
xprintf("Unknown extra command: %02X\n", code);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user