]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
M0110: added keymaps, mousekeys
authortmk <nobody@nowhere>
Mon, 19 Dec 2011 05:06:53 +0000 (14:06 +0900)
committertmk <nobody@nowhere>
Mon, 19 Dec 2011 05:06:53 +0000 (14:06 +0900)
m0110.c
m0110.h
m0110_usb/Makefile
m0110_usb/README
m0110_usb/keymap.c

diff --git a/m0110.c b/m0110.c
index 725675ed8f6339ebbd158b530af2e865b7cf4cdb..f4f5223dd050f817631f18f940059b6af8e78aa3 100644 (file)
--- a/m0110.c
+++ b/m0110.c
@@ -103,7 +103,7 @@ KEY EVENT:
     To get scan code,  use ((bits&(1<<7)) | ((bits&7F))>>1).
 
 SCAN CODE:
-    M0110A
+    M0110
     ,---------------------------------------------------------.
     |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs|
     |---------------------------------------------------------|
@@ -211,7 +211,9 @@ uint8_t m0110_recv(void)
         }
     }
     idle();
-    print("m0110_send recv data: "); phex(data); print("\n");
+    if (data != M0110_NULL) {
+        print("m0110_recv data: "); phex(data); print("\n");
+    }
     return data;
 ERROR:
     if (m0110_error) {
@@ -229,7 +231,7 @@ uint8_t m0110_recv_key(void)
     if (key == 0xFF || key == M0110_NULL)
         return M0110_NULL;
     else 
-        return (key&(1<<7) | (key&0x7F)>>1);
+        return ((key&(1<<7)) | ((key&0x7F)>>1));
 }
 
 
diff --git a/m0110.h b/m0110.h
index fe2e91227bce76586fbc2b500311085c11500ffc..f5c1e21bd8294a6288f62f15b240c96d9c527ff8 100644 (file)
--- a/m0110.h
+++ b/m0110.h
@@ -65,7 +65,7 @@ POSSIBILITY OF SUCH DAMAGE.
 extern uint8_t m0110_error;
 
 /* host role */
-void m0110_host_init(void);
+void m0110_init(void);
 uint8_t m0110_send(uint8_t data);
 uint8_t m0110_recv(void);
 uint8_t m0110_recv_key(void);
index 8c8460c80621d2220a6051d4dafd4f72534de062..819d7fff3e64f36cae49b69970a682654f387948 100644 (file)
@@ -36,9 +36,9 @@ F_CPU = 16000000
 # Build Options
 #   *Comment out* to disable the options.
 #
-#MOUSEKEY_ENABLE = yes # Mouse keys
+MOUSEKEY_ENABLE = yes  # Mouse keys
 #PS2_MOUSE_ENABLE = yes        # PS/2 mouse(TrackPoint) support
-#EXTRAKEY_ENABLE = yes # Audio control and System control
+EXTRAKEY_ENABLE = yes  # Audio control and System control
 #NKRO_ENABLE = yes     # USB Nkey Rollover
 
 
index 4122edb287b23f63a80c159686b4dd86300f18a9..6ef98757a3978f5e215a46d295945ab3bdc1ead8 100644 (file)
@@ -1,6 +1,6 @@
 M0110 to USB keyboard converter
 ===============================
-This firmware converts protocol for Apple Machintosh Keybard M0110.
+This firmware converts the protocol of Apple Macintosh keyboard M0110 into USB.
 
 
 Connection
index 24fe6cd472435c55970d1dc0645b4882317ab381..bbb699a9ace9e22ccbfa7232865b7dbe5b167f49 100644 (file)
@@ -55,9 +55,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
 static const uint8_t PROGMEM fn_layer[] = {
-    0,              // Fn0
-    0,              // Fn1
-    0,              // Fn2
+    1,              // Fn0
+    2,              // Fn1
+    3,              // Fn2
     0,              // Fn3
     0,              // Fn4
     0,              // Fn5
@@ -68,8 +68,8 @@ static const uint8_t PROGMEM fn_layer[] = {
 // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
 // See layer.c for details.
 static const uint8_t PROGMEM fn_keycode[] = {
-    KB_NO,          // Fn0
-    KB_NO,          // Fn1
+    KB_SCOLON,      // Fn0
+    KB_SLASH,       // Fn1
     KB_NO,          // Fn2
     KB_NO,          // Fn3
     KB_NO,          // Fn4
@@ -79,25 +79,51 @@ static const uint8_t PROGMEM fn_keycode[] = {
 };
 
 static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    // LShift and RShift are logically same one button.
+    // LOption and ROption are logically same one button.
     /* Default Layer: plain keymap
      * ,---------------------------------------------------------.
      * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Bacpa|
      * |---------------------------------------------------------|
      * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \|
      * |---------------------------------------------------------|
-     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return|
+     * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|Fn0|  '|Return|
      * |---------------------------------------------------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift   |
+     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|Fn1|   Shift|
      * `---------------------------------------------------------'
-     *      |Opt|Alt |         Space               |Alt |Opt|
+     *      |Fn2|Alt |         Space               |Gui |Fn2|
      *      `-----------------------------------------------'
      */
     KEYMAP(
     GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,
-    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,
-         LGUI,LALT,          SPC,                     RALT
+    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   FN0, QUOT,     ENT,
+    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, FN1, 
+         FN2, LALT,          SPC,                     LGUI
+    ),
+    // vi mousekeys
+    KEYMAP(
+    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,
+    CAPS,NO,  NO,  NO,  NO,  NO,  WH_L,WH_D,WH_U,WH_R,NO,  NO,  NO,  NO,
+    LCTL,VOLD,VOLU,MUTE,NO,  NO,  MS_L,MS_D,MS_U,MS_R,FN0, NO,       ENT,
+    LSFT,NO,  NO,  NO,  NO,  BTN3,BTN2,BTN1,NO,  NO,  NO,  
+         NO,  LALT,          BTN1,                    LGUI
+    ),
+    // vi cusorkeys
+    KEYMAP(
+    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,
+    CAPS,NO,  NO,  NO,  NO,  NO,  HOME,PGDN,PGUP,END, NO,  NO,  NO,  NO,
+    LCTL,NO,  NO,  NO,  NO,  NO,  LEFT,DOWN,UP,  RGHT,NO,  NO,       ENT,
+    LSFT,NO,  NO,  NO,  NO,  NO,  HOME,PGDN,PGUP,END, FN1, 
+         NO,  LALT,          SPC,                     LGUI
+    ),
+    // HHKB & WASD
+    KEYMAP(
+    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,
+    CAPS,HOME,UP,  PGUP,NO,  NO,  NO,  NO,  PSCR,SLCK,BRK, UP,  NO,  NO,
+    LCTL,LEFT,DOWN,RGHT,NO,  NO,  NO,  NO,  HOME,PGUP,LEFT,RGHT,     ENT,
+    LSFT,END, NO,  PGDN,NO,  VOLD,VOLU,MUTE,END, PGDN,DOWN,
+         FN2, LALT,          SPC,                     LGUI
     ),
 };