Make Bell and Click work on Sun Type 5c.
authorJohn Hickey <jjh-github@daedalian.us>
Sat, 14 May 2016 21:29:05 +0000 (14:29 -0700)
committerJohn Hickey <jjh-github@daedalian.us>
Sat, 14 May 2016 21:29:05 +0000 (14:29 -0700)
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.

converter/sun_usb/command_extra.c

index aba3fe6da38fb6f7ca2fce0a4f0db825db585998..08f3a710a728a300246550798e4f97e4ccf1770d 100644 (file)
@@ -5,41 +5,47 @@
 #include "print.h"
 #include "command.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("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");
+            print("Home:        Toggle Bell\n");
+            print("End:         Toggle Click\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);
+        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);
@@ -55,6 +61,7 @@ bool command_extra(uint8_t code)
             serial_send(0x0F);
             break;
         default:
+            xprintf("Unknown extra command: %02X\n", code);
             return false;
     }
     return true;
Imprint / Impressum