]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Add extra commands Bell/Click to Sun converter
authortmk <nobody@nowhere>
Sun, 21 Oct 2012 13:36:44 +0000 (22:36 +0900)
committertmk <nobody@nowhere>
Sun, 21 Oct 2012 13:36:44 +0000 (22:36 +0900)
converter/sun_usb/Makefile
converter/sun_usb/command_extra.c [new file with mode: 0644]

index 4c79a8d27877b268556cae6f5ff8a6d27784f6bd..c6e8390cc99d5fd024c60f5c30dc7d23641d18c0 100644 (file)
@@ -11,6 +11,7 @@ TARGET_DIR = .
 SRC =  keymap.c \
        matrix.c \
        led.c \
+       command_extra.c \
        protocol/serial_soft.c
 
 CONFIG_H = config.h
diff --git a/converter/sun_usb/command_extra.c b/converter/sun_usb/command_extra.c
new file mode 100644 (file)
index 0000000..5038946
--- /dev/null
@@ -0,0 +1,43 @@
+#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");
+            return false;
+        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_NUMLOCK:
+            print("layout\n");
+            serial_send(0x0F);
+            break;
+        default:
+            return false;
+    }
+    return true;
+}