]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboard.c
FIX: layer switching bug when Fn has no keycode.
[qmk_firmware.git] / keyboard.c
index af170673500400975d013e8196fe014d053286c6..5c2643c951e53ee3a5869b50d792b8878091fc5f 100644 (file)
@@ -1,3 +1,19 @@
+/*
+Copyright 2011 Jun Wako <wakojun@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
 #include "keyboard.h"
 #include "host.h"
 #include "layer.h"
@@ -11,7 +27,7 @@
 #ifdef MOUSEKEY_ENABLE
 #include "mousekey.h"
 #endif
-#ifdef USB_EXTRA_ENABLE
+#ifdef EXTRAKEY_ENABLE
 #include <util/delay.h>
 #endif
 
@@ -31,7 +47,7 @@ void keyboard_init(void)
 void keyboard_proc(void)
 {
     uint8_t fn_bits = 0;
-#ifdef USB_EXTRA_ENABLE
+#ifdef EXTRAKEY_ENABLE
     uint16_t consumer_code = 0;
 #endif
 
@@ -66,7 +82,8 @@ void keyboard_proc(void)
             } else if (IS_FN(code)) {
                 fn_bits |= FN_BIT(code);
             }
-#ifdef USB_EXTRA_ENABLE
+// TODO: use table or something
+#ifdef EXTRAKEY_ENABLE
             // System Control
             else if (code == KB_SYSTEM_POWER) {
 #ifdef HOST_PJRC
@@ -154,7 +171,7 @@ void keyboard_proc(void)
     // TODO: should send only when changed from last report
     if (matrix_is_modified()) {
         host_send_keyboard_report();
-#ifdef USB_EXTRA_ENABLE
+#ifdef EXTRAKEY_ENABLE
         host_consumer_send(consumer_code);
 #endif
 #ifdef DEBUG_LED