diff options
| author | tmk <nobody@nowhere> | 2014-06-22 14:15:38 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2014-06-22 14:15:38 +0900 |
| commit | 9c8d0f6c0d8b145c627d073faff9c8ca6f9148fe (patch) | |
| tree | e8c0d44a5908f30b255dc2f4636b3a6dcecd04a8 | |
| parent | 382eaebd3db595d8c4943f293d765e6b66a7e695 (diff) | |
| download | qmk_firmware-9c8d0f6c0d8b145c627d073faff9c8ca6f9148fe.tar.gz qmk_firmware-9c8d0f6c0d8b145c627d073faff9c8ca6f9148fe.zip | |
Change keymaps of M0110
| -rw-r--r-- | converter/m0110_usb/Makefile | 11 | ||||
| -rw-r--r-- | converter/m0110_usb/README.md | 77 | ||||
| -rw-r--r-- | converter/m0110_usb/keymap_common.c | 37 | ||||
| -rw-r--r-- | converter/m0110_usb/keymap_common.h | 107 | ||||
| -rw-r--r-- | converter/m0110_usb/keymap_for_editor.c | 118 | ||||
| -rw-r--r-- | converter/m0110_usb/keymap_hasu.c | 222 | ||||
| -rw-r--r-- | converter/m0110_usb/keymap_plain.c | 64 | ||||
| -rw-r--r-- | converter/m0110_usb/keymap_spacefn.c | 71 |
8 files changed, 470 insertions, 237 deletions
diff --git a/converter/m0110_usb/Makefile b/converter/m0110_usb/Makefile index 7791527e4..ac54945e7 100644 --- a/converter/m0110_usb/Makefile +++ b/converter/m0110_usb/Makefile | |||
| @@ -10,13 +10,14 @@ TARGET_DIR = . | |||
| 10 | # keyboard dependent files | 10 | # keyboard dependent files |
| 11 | SRC = matrix.c \ | 11 | SRC = matrix.c \ |
| 12 | led.c \ | 12 | led.c \ |
| 13 | keymap_common.c \ | ||
| 13 | m0110.c | 14 | m0110.c |
| 14 | 15 | ||
| 15 | # To use own keymap file run make like: make keymap=hasu | 16 | # To use own keymap file run make like: make keymap=hasu |
| 16 | ifdef keymap | 17 | ifdef KEYMAP |
| 17 | SRC += keymap_$(keymap).c | 18 | SRC += keymap_$(KEYMAP).c |
| 18 | else | 19 | else |
| 19 | SRC += keymap.c | 20 | SRC += keymap_plain.c |
| 20 | endif | 21 | endif |
| 21 | 22 | ||
| 22 | CONFIG_H = config.h | 23 | CONFIG_H = config.h |
| @@ -71,14 +72,14 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 | |||
| 71 | # Build Options | 72 | # Build Options |
| 72 | # *Comment out* to disable the options. | 73 | # *Comment out* to disable the options. |
| 73 | # | 74 | # |
| 74 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | 75 | #BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) |
| 75 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | 76 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) |
| 76 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 77 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 77 | CONSOLE_ENABLE = yes # Console for debug(+400) | 78 | CONSOLE_ENABLE = yes # Console for debug(+400) |
| 78 | COMMAND_ENABLE = yes # Commands for debug and configuration | 79 | COMMAND_ENABLE = yes # Commands for debug and configuration |
| 79 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 80 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 80 | #NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA | 81 | #NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA |
| 81 | KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor | 82 | #KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor |
| 82 | 83 | ||
| 83 | 84 | ||
| 84 | 85 | ||
diff --git a/converter/m0110_usb/README.md b/converter/m0110_usb/README.md index 1c344f1ac..7de36d5de 100644 --- a/converter/m0110_usb/README.md +++ b/converter/m0110_usb/README.md | |||
| @@ -2,6 +2,8 @@ M0110/M0110A to USB keyboard converter | |||
| 2 | ====================================== | 2 | ====================================== |
| 3 | This firmware converts the protocol of Apple Macintosh keyboard **M0110**, **M0110A** and **M0120** into USB. Target of this project is USB AVR controller **ATmega32U4**. Using this converter you can revive these retro keyboards with modern computer. | 3 | This firmware converts the protocol of Apple Macintosh keyboard **M0110**, **M0110A** and **M0120** into USB. Target of this project is USB AVR controller **ATmega32U4**. Using this converter you can revive these retro keyboards with modern computer. |
| 4 | 4 | ||
| 5 | Read README of top directory too. | ||
| 6 | |||
| 5 | Pictures of **M0110 + M0120** and **M0110A**. | 7 | Pictures of **M0110 + M0120** and **M0110A**. |
| 6 | 8 | ||
| 7 |  | 9 |  |
| @@ -17,6 +19,7 @@ Update | |||
| 17 | ------ | 19 | ------ |
| 18 | - 2013/08: Change port for signals `PF` to `PD` | 20 | - 2013/08: Change port for signals `PF` to `PD` |
| 19 | - 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now. | 21 | - 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now. |
| 22 | - 2014/06: Change keymaps | ||
| 20 | 23 | ||
| 21 | 24 | ||
| 22 | 25 | ||
| @@ -54,76 +57,22 @@ To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to | |||
| 54 | 57 | ||
| 55 | $ git clone git://github.com/tmk/tmk_keyboard.git (or download source) | 58 | $ git clone git://github.com/tmk/tmk_keyboard.git (or download source) |
| 56 | $ cd m0110_usb | 59 | $ cd m0110_usb |
| 57 | $ make -f Makefile clean | 60 | $ make clean |
| 58 | $ make -f Makefile | 61 | $ make |
| 62 | |||
| 63 | To select keymap use `KEYMAP` option. | ||
| 59 | 64 | ||
| 60 | and program your Teensy with [PJRC Teensy loader](http://www.pjrc.com/teensy/loader.html). | 65 | $ make clean |
| 66 | $ make KEYMAP={plain|spacefn|hasu} | ||
| 61 | 67 | ||
| 62 | 68 | ||
| 63 | 69 | ||
| 64 | Keymap | 70 | Keymap |
| 65 | ------ | 71 | ------ |
| 66 | You can change keymaps by editing *keymap.c*. | 72 | To create your own keymap copy existent keymap file to `keymap_name.c` and edit it. You can build it like this. |
| 67 | 73 | ||
| 68 | ### M0110 & M0120 | 74 | $ make clean |
| 69 | #### *Default Layer* | 75 | $ make KEYMAP=name |
| 70 | ,---------------------------------------------------------. ,---------------. | ||
| 71 | | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| -|Lft|Rgt| | ||
| 72 | |---------------------------------------------------------| |---------------| | ||
| 73 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| Up| | ||
| 74 | |---------------------------------------------------------| |---------------| | ||
| 75 | |Caps | A| S| D| F| G| H| J| K| L| ;| '|Enter | | 4| 5| 6| Dn| | ||
| 76 | |---------------------------------------------------------| |---------------| | ||
| 77 | |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | | ||
| 78 | `---------------------------------------------------------' |-----------|Ent| | ||
| 79 | |Ctl|Gui | Space |Alt |Ctl| | 0| .| | | ||
| 80 | `-----------------------------------------------' `---------------' | ||
| 81 | |||
| 82 | - `Space` and `Enter` also work as `Fn` layer switch key when holding down. | ||
| 83 | |||
| 84 | #### *Function Layer(WASD/HHKB)* | ||
| 85 | ,---------------------------------------------------------. ,---------------. | ||
| 86 | |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| -|Lft|Rgt| | ||
| 87 | |---------------------------------------------------------| |---------------| | ||
| 88 | |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |Ins| \| | 7| 8| 9| Up| | ||
| 89 | |---------------------------------------------------------| |---------------| | ||
| 90 | |Caps |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Enter | | 4| 5| 6| Dn| | ||
| 91 | |---------------------------------------------------------| |---------------| | ||
| 92 | |Shift |End| |PgD| | | | |End|PgD|Dow|Shift | | 1| 2| 3| | | ||
| 93 | `---------------------------------------------------------' |-----------|Ent| | ||
| 94 | |Ctl|Gui | Space |Alt |Ctl| | 0| .| | | ||
| 95 | `-----------------------------------------------' `---------------' | ||
| 96 | |||
| 97 | |||
| 98 | ### M0110A | ||
| 99 | #### *Default Layer* | ||
| 100 | ,---------------------------------------------------------. ,---------------. | ||
| 101 | | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| | ||
| 102 | |---------------------------------------------------------| |---------------| | ||
| 103 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | ||
| 104 | |-----------------------------------------------------' | |---------------| | ||
| 105 | |Caps | A| S| D| F| G| H| J| K| L| ;| '|Enter | | 4| 5| 6| +| | ||
| 106 | |---------------------------------------------------------| |---------------| | ||
| 107 | |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft| Up| | 1| 2| 3| | | ||
| 108 | |---------------------------------------------------------| |-----------|Ent| | ||
| 109 | |Ctrl |Gui | Space | \|Lft|Rgt|Dwn| | 0| .| | | ||
| 110 | `---------------------------------------------------------' `---------------' | ||
| 111 | |||
| 112 | - `Space` and `Enter` also work as `Fn` layer switch key when holding down. | ||
| 113 | - `Backslash(\)` also works as `Alt` when holding down. | ||
| 114 | |||
| 115 | #### *Function Layer(WASD/HHKB)* | ||
| 116 | ,---------------------------------------------------------. ,---------------. | ||
| 117 | |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| | ||
| 118 | |---------------------------------------------------------| |---------------| | ||
| 119 | |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |Ins| | | 7| 8| 9| -| | ||
| 120 | |-----------------------------------------------------' | |---------------| | ||
| 121 | |Caps |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Enter | | 4| 5| 6| +| | ||
| 122 | |---------------------------------------------------------| |---------------| | ||
| 123 | |Shift |End| |PgD| | | | |End|PgD|Dow|Shif|PgU| | 1| 2| 3| | | ||
| 124 | |---------------------------------------------------------| |-----------|Ent| | ||
| 125 | |Ctrl |Gui | Space | \|Hom|End|PgD| | 0| .| | | ||
| 126 | `---------------------------------------------------------' `---------------' | ||
| 127 | 76 | ||
| 128 | 77 | ||
| 129 | 78 | ||
diff --git a/converter/m0110_usb/keymap_common.c b/converter/m0110_usb/keymap_common.c new file mode 100644 index 000000000..bad18c91a --- /dev/null +++ b/converter/m0110_usb/keymap_common.c | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2011,2012,2014 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include <stdint.h> | ||
| 18 | #include <avr/pgmspace.h> | ||
| 19 | #include "action.h" | ||
| 20 | #include "keycode.h" | ||
| 21 | #include "keymap.h" | ||
| 22 | #include "keymap_common.h" | ||
| 23 | |||
| 24 | |||
| 25 | /* translates key to keycode */ | ||
| 26 | uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) | ||
| 27 | { | ||
| 28 | return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); | ||
| 29 | } | ||
| 30 | |||
| 31 | /* translates Fn index to action */ | ||
| 32 | action_t keymap_fn_to_action(uint8_t keycode) | ||
| 33 | { | ||
| 34 | action_t action; | ||
| 35 | action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); | ||
| 36 | return action; | ||
| 37 | } | ||
diff --git a/converter/m0110_usb/keymap_common.h b/converter/m0110_usb/keymap_common.h new file mode 100644 index 000000000..e1d47342e --- /dev/null +++ b/converter/m0110_usb/keymap_common.h | |||
| @@ -0,0 +1,107 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2011,2012,2014 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include <stdint.h> | ||
| 18 | #include <avr/pgmspace.h> | ||
| 19 | #include "keycode.h" | ||
| 20 | #include "keymap.h" | ||
| 21 | |||
| 22 | |||
| 23 | extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; | ||
| 24 | extern const uint16_t fn_actions[]; | ||
| 25 | |||
| 26 | |||
| 27 | /* | ||
| 28 | * The keymap works with both M0110 and M0110A keyboards. As you can see, the M0110A is a superset | ||
| 29 | * of the M0110 keyboard, with only one exception: 'Enter' in M0110 does not exist | ||
| 30 | * on the M0110A, but since it generates a unique scan code which is not used for some other key in | ||
| 31 | * the M0110A, they are totally interchangeable. In fact, the M0110A is functionally (almost) | ||
| 32 | * identical to the combination of the M0110 along with the M0120 keypad. The only difference | ||
| 33 | * (which is causing some problems as you will read below) is that the M0110+M0120 don't have | ||
| 34 | * dedicated arrow keys, while the M0110A does. However, the M0120 did have arrow keys, which | ||
| 35 | * doubled as the [comma], [/], [*] and [+] keys, when used with the [Shift] key. The M0110A has | ||
| 36 | * substituted the [comma] key with the [=] key, however its scancode is the same. | ||
| 37 | * | ||
| 38 | * Physical layout: | ||
| 39 | * M0110A | ||
| 40 | * ,---------------------------------------------------------. ,---------------. | ||
| 41 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Clr| =| /| *| | ||
| 42 | * |---------------------------------------------------------| |---------------| | ||
| 43 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | ||
| 44 | * |-----------------------------------------------------' | |---------------| | ||
| 45 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| | ||
| 46 | * |---------------------------------------------------------| |---------------| | ||
| 47 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | | ||
| 48 | * |---------------------------------------------------------' |-----------|Ent| | ||
| 49 | * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | | ||
| 50 | * `---------------------------------------------------------' `---------------' | ||
| 51 | * | ||
| 52 | * M0110 M0120 | ||
| 53 | * ,---------------------------------------------------------. ,---------------. | ||
| 54 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| -| +| *| | ||
| 55 | * |---------------------------------------------------------| |---------------| | ||
| 56 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| | ||
| 57 | * |---------------------------------------------------------| |---------------| | ||
| 58 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,| | ||
| 59 | * |---------------------------------------------------------| |---------------| | ||
| 60 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | | ||
| 61 | * `---------------------------------------------------------' |-----------|Ent| | ||
| 62 | * |Opt|Mac | Space |Ent |Opt| | 0| .| | | ||
| 63 | * `-----------------------------------------------' `---------------' | ||
| 64 | * With Shift keys on M0120 work as curosor.(-:Left *:Right /:Up ,:Down) | ||
| 65 | * | ||
| 66 | * NOTE: \ is located differently. | ||
| 67 | * NOTE: Enter on M0110 is different from Enter on keypad(M0120 and M0110A). | ||
| 68 | * NOTE: Left Shift and right Shift are logically same key. | ||
| 69 | * NOTE: Left Option and right Option are logically same key. | ||
| 70 | */ | ||
| 71 | |||
| 72 | /* Keymap definition Macro | ||
| 73 | * ,---------------------------------------------------------. ,---------------. | ||
| 74 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| | ||
| 75 | * |---------------------------------------------------------| |---------------| | ||
| 76 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | ||
| 77 | * |-----------------------------------------------------' | |---------------| | ||
| 78 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| | ||
| 79 | * |---------------------------------------------------------| |---------------| | ||
| 80 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | | ||
| 81 | * |---------------------------------------------------------| |-----------|Ent| | ||
| 82 | * |Opt |Mac | Space |Ent| \|Lft|Rgt|Dn | | 0| .| | | ||
| 83 | * `---------------------------------------------------------' `---------------' | ||
| 84 | * NOTE: Ent between Space and \ means Enter on M0110. | ||
| 85 | */ | ||
| 86 | #define KEYMAP( \ | ||
| 87 | K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ | ||
| 88 | K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K4E, \ | ||
| 89 | K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K66, \ | ||
| 90 | K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K4D, K53,K54,K55,K4C, \ | ||
| 91 | K3A,K37, K31, K34,K2A,K46,K42,K48, K52, K41 \ | ||
| 92 | ) { \ | ||
| 93 | { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ | ||
| 94 | { KC_##K08, KC_##K09, KC_NO, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ | ||
| 95 | { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ | ||
| 96 | { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ | ||
| 97 | { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ | ||
| 98 | { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ | ||
| 99 | { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_NO, KC_NO, KC_##K37 }, \ | ||
| 100 | { KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ | ||
| 101 | { KC_NO, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_##K47 }, \ | ||
| 102 | { KC_##K48, KC_NO, KC_NO, KC_NO, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ | ||
| 103 | { KC_NO, KC_NO, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ | ||
| 104 | { KC_##K58, KC_##K59, KC_NO, KC_##K5B, KC_##K5C, KC_NO, KC_NO, KC_NO }, \ | ||
| 105 | { KC_NO, KC_NO, KC_##K62, KC_NO, KC_NO, KC_NO, KC_##K66, KC_NO }, \ | ||
| 106 | { KC_##K68, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K6D, KC_NO, KC_NO }, \ | ||
| 107 | } | ||
diff --git a/converter/m0110_usb/keymap_for_editor.c b/converter/m0110_usb/keymap_for_editor.c new file mode 100644 index 000000000..d20f298f8 --- /dev/null +++ b/converter/m0110_usb/keymap_for_editor.c | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2014 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include <stdint.h> | ||
| 18 | #include "keycode.h" | ||
| 19 | #include "keymap_common.h" | ||
| 20 | |||
| 21 | |||
| 22 | #ifdef KEYMAP_SECTION_ENABLE | ||
| 23 | const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { | ||
| 24 | #else | ||
| 25 | const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { | ||
| 26 | #endif | ||
| 27 | /* Default: | ||
| 28 | * ,---------------------------------------------------------. ,---------------. | ||
| 29 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| | ||
| 30 | * |---------------------------------------------------------| |---------------| | ||
| 31 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | ||
| 32 | * |-----------------------------------------------------' | |---------------| | ||
| 33 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Enter | | 4| 5| 6| +| | ||
| 34 | * |---------------------------------------------------------| |---------------| | ||
| 35 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | | ||
| 36 | * |---------------------------------------------------------| |-----------|Ent| | ||
| 37 | * |Ctl |Gui | Space |Alt| \|Lft|Rgt|Dn | | 0| .| | | ||
| 38 | * `---------------------------------------------------------' `---------------' | ||
| 39 | */ | ||
| 40 | [0] = KEYMAP( | ||
| 41 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, CLR, EQL, PSLS,PAST, | ||
| 42 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, | ||
| 43 | LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, FN15, P4, P5, P6, PPLS, | ||
| 44 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, | ||
| 45 | LCTL,LGUI, FN16, LALT,FN31,LEFT,RGHT,DOWN, P0, PDOT | ||
| 46 | ), | ||
| 47 | /* Cursor Layer(WASD, IJKL) | ||
| 48 | * ,---------------------------------------------------------. ,---------------. | ||
| 49 | * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| | ||
| 50 | * |---------------------------------------------------------| |---------------| | ||
| 51 | * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |Ins| | | 7| 8| 9| -| | ||
| 52 | * |-----------------------------------------------------' | |---------------| | ||
| 53 | * |Caps |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Enter | | 4| 5| 6| +| | ||
| 54 | * |---------------------------------------------------------| |---------------| | ||
| 55 | * |Shift |End| |PgD| | | | |End|PgD|Dow|Shif|PgU| | 1| 2| 3| | | ||
| 56 | * |---------------------------------------------------------| |-----------|Ent| | ||
| 57 | * |Ctl |Gui | Space |Alt | \|Hom|End|PgD| | 0| .| | | ||
| 58 | * `---------------------------------------------------------' `---------------' | ||
| 59 | */ | ||
| 60 | [3] = KEYMAP( | ||
| 61 | ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, | ||
| 62 | CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, INS, P7, P8, P9, PMNS, | ||
| 63 | LCAP,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, FN15, P4, P5, P6, PPLS, | ||
| 64 | LSFT,END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, PGUP, P1, P2, P3, PENT, | ||
| 65 | LCTL,LGUI, FN16, LALT,FN31,HOME,END, PGDN, P0, PDOT | ||
| 66 | ), | ||
| 67 | [4] = KEYMAP( | ||
| 68 | ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, | ||
| 69 | CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, INS, P7, P8, P9, PMNS, | ||
| 70 | LCAP,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, FN15, P4, P5, P6, PPLS, | ||
| 71 | LSFT,END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, PGUP, P1, P2, P3, PENT, | ||
| 72 | LCTL,LGUI, FN16, LALT,FN31,HOME,END, PGDN, P0, PDOT | ||
| 73 | ), | ||
| 74 | [7] = {}, | ||
| 75 | }; | ||
| 76 | |||
| 77 | |||
| 78 | /* | ||
| 79 | * Fn action definition | ||
| 80 | */ | ||
| 81 | #ifdef KEYMAP_SECTION_ENABLE | ||
| 82 | const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { | ||
| 83 | #else | ||
| 84 | const uint16_t fn_actions[] PROGMEM = { | ||
| 85 | #endif | ||
| 86 | [0] = ACTION_LAYER_MOMENTARY(1), | ||
| 87 | [1] = ACTION_LAYER_MOMENTARY(2), | ||
| 88 | [2] = ACTION_LAYER_MOMENTARY(3), | ||
| 89 | [3] = ACTION_LAYER_MOMENTARY(4), | ||
| 90 | [4] = ACTION_LAYER_MOMENTARY(5), | ||
| 91 | [5] = ACTION_LAYER_MOMENTARY(6), | ||
| 92 | [6] = ACTION_LAYER_MOMENTARY(7), | ||
| 93 | [7] = ACTION_LAYER_TOGGLE(1), | ||
| 94 | [8] = ACTION_LAYER_TOGGLE(2), | ||
| 95 | [9] = ACTION_LAYER_TOGGLE(3), | ||
| 96 | [10] = ACTION_LAYER_TAP_TOGGLE(1), | ||
| 97 | [11] = ACTION_LAYER_TAP_TOGGLE(2), | ||
| 98 | [12] = ACTION_LAYER_TAP_TOGGLE(3), | ||
| 99 | [13] = ACTION_LAYER_TAP_KEY(1, KC_F), | ||
| 100 | [14] = ACTION_LAYER_TAP_KEY(2, KC_J), | ||
| 101 | [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER), | ||
| 102 | [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE), | ||
| 103 | [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON), | ||
| 104 | [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE), | ||
| 105 | [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH), | ||
| 106 | [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE), | ||
| 107 | [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE), | ||
| 108 | [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE), | ||
| 109 | [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER), | ||
| 110 | [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC), | ||
| 111 | [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE), | ||
| 112 | [26] = ACTION_MODS_ONESHOT(MOD_LCTL), | ||
| 113 | [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC), | ||
| 114 | [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE), | ||
| 115 | [29] = ACTION_MODS_ONESHOT(MOD_LSFT), | ||
| 116 | [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE), | ||
| 117 | [31] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_BSLASH), | ||
| 118 | }; | ||
diff --git a/converter/m0110_usb/keymap_hasu.c b/converter/m0110_usb/keymap_hasu.c index 3608dac9e..11f1a4f39 100644 --- a/converter/m0110_usb/keymap_hasu.c +++ b/converter/m0110_usb/keymap_hasu.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright 2011,2012 Jun Wako <wakojun@gmail.com> | 2 | Copyright 2014 Jun Wako <wakojun@gmail.com> |
| 3 | 3 | ||
| 4 | This program is free software: you can redistribute it and/or modify | 4 | This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
| @@ -14,188 +14,74 @@ GNU General Public License for more details. | |||
| 14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | /* M0110A Support was contributed by skagon@github */ | ||
| 18 | |||
| 19 | #include <stdint.h> | 17 | #include <stdint.h> |
| 20 | #include <stdbool.h> | ||
| 21 | #include <avr/pgmspace.h> | ||
| 22 | #include "keycode.h" | 18 | #include "keycode.h" |
| 23 | #include "print.h" | 19 | #include "keymap_common.h" |
| 24 | #include "debug.h" | ||
| 25 | #include "util.h" | ||
| 26 | #include "keymap.h" | ||
| 27 | |||
| 28 | |||
| 29 | /* | ||
| 30 | * The keymap works with both M0110 and M0110A keyboards. As you can see, the M0110A is a superset | ||
| 31 | * of the M0110 keyboard, with only one exception: 'Enter' in M0110 does not exist | ||
| 32 | * on the M0110A, but since it generates a unique scan code which is not used for some other key in | ||
| 33 | * the M0110A, they are totally interchangeable. In fact, the M0110A is functionally (almost) | ||
| 34 | * identical to the combination of the M0110 along with the M0120 keypad. The only difference | ||
| 35 | * (which is causing some problems as you will read below) is that the M0110+M0120 don't have | ||
| 36 | * dedicated arrow keys, while the M0110A does. However, the M0120 did have arrow keys, which | ||
| 37 | * doubled as the [comma], [/], [*] and [+] keys, when used with the [Shift] key. The M0110A has | ||
| 38 | * substituted the [comma] key with the [=] key, however its scancode is the same. | ||
| 39 | * | ||
| 40 | * Physical layout: | ||
| 41 | * M0110A | ||
| 42 | * ,---------------------------------------------------------. ,---------------. | ||
| 43 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Clr| =| /| *| | ||
| 44 | * |---------------------------------------------------------| |---------------| | ||
| 45 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | ||
| 46 | * |-----------------------------------------------------' | |---------------| | ||
| 47 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| | ||
| 48 | * |---------------------------------------------------------| |---------------| | ||
| 49 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | | ||
| 50 | * |---------------------------------------------------------' |-----------|Ent| | ||
| 51 | * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | | ||
| 52 | * `---------------------------------------------------------' `---------------' | ||
| 53 | * | ||
| 54 | * M0110 M0120 | ||
| 55 | * ,---------------------------------------------------------. ,---------------. | ||
| 56 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| -| +| *| | ||
| 57 | * |---------------------------------------------------------| |---------------| | ||
| 58 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| | ||
| 59 | * |---------------------------------------------------------| |---------------| | ||
| 60 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,| | ||
| 61 | * |---------------------------------------------------------| |---------------| | ||
| 62 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | | ||
| 63 | * `---------------------------------------------------------' |-----------|Ent| | ||
| 64 | * |Opt|Mac | Space |Ent |Opt| | 0| .| | | ||
| 65 | * `-----------------------------------------------' `---------------' | ||
| 66 | * With Shift keys on M0120 work as curosor.(-:Left *:Right /:Up ,:Down) | ||
| 67 | * | ||
| 68 | * NOTE: \ is located differently. | ||
| 69 | * NOTE: Enter on M0110 is different from Enter on keypad(M0120 and M0110A). | ||
| 70 | * NOTE: Left Shift and right Shift are logically same key. | ||
| 71 | * NOTE: Left Option and right Option are logically same key. | ||
| 72 | */ | ||
| 73 | |||
| 74 | /* Keymap definition Macro | ||
| 75 | * ,---------------------------------------------------------. ,---------------. | ||
| 76 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| | ||
| 77 | * |---------------------------------------------------------| |---------------| | ||
| 78 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | ||
| 79 | * |-----------------------------------------------------' | |---------------| | ||
| 80 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| | ||
| 81 | * |---------------------------------------------------------| |---------------| | ||
| 82 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | | ||
| 83 | * |---------------------------------------------------------| |-----------|Ent| | ||
| 84 | * |Opt |Mac | Space |Ent| \|Lft|Rgt|Dn | | 0| .| | | ||
| 85 | * `---------------------------------------------------------' `---------------' | ||
| 86 | * NOTE: Ent between Space and \ means Enter on M0110. | ||
| 87 | */ | ||
| 88 | #define KEYMAP( \ | ||
| 89 | K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ | ||
| 90 | K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K4E, \ | ||
| 91 | K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K66, \ | ||
| 92 | K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K4D, K53,K54,K55,K4C, \ | ||
| 93 | K3A,K37, K31, K34,K2A,K46,K42,K48, K52, K41 \ | ||
| 94 | ) { \ | ||
| 95 | { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ | ||
| 96 | { KC_##K08, KC_##K09, KC_NO, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ | ||
| 97 | { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ | ||
| 98 | { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ | ||
| 99 | { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ | ||
| 100 | { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ | ||
| 101 | { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_NO, KC_NO, KC_##K37 }, \ | ||
| 102 | { KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ | ||
| 103 | { KC_NO, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_##K47 }, \ | ||
| 104 | { KC_##K48, KC_NO, KC_NO, KC_NO, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ | ||
| 105 | { KC_NO, KC_NO, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ | ||
| 106 | { KC_##K58, KC_##K59, KC_NO, KC_##K5B, KC_##K5C, KC_NO, KC_NO, KC_NO }, \ | ||
| 107 | { KC_NO, KC_NO, KC_##K62, KC_NO, KC_NO, KC_NO, KC_##K66, KC_NO }, \ | ||
| 108 | { KC_##K68, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K6D, KC_NO, KC_NO }, \ | ||
| 109 | } | ||
| 110 | |||
| 111 | #define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)])) | ||
| 112 | |||
| 113 | |||
| 114 | // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. | ||
| 115 | static const uint8_t PROGMEM fn_layer[] = { | ||
| 116 | 1, // Fn0 | ||
| 117 | 2, // Fn1 | ||
| 118 | 3, // Fn2 | ||
| 119 | 1, // Fn3 | ||
| 120 | 2, // Fn4 | ||
| 121 | 0, // Fn5 | ||
| 122 | 0, // Fn6 | ||
| 123 | 0 // Fn7 | ||
| 124 | }; | ||
| 125 | 20 | ||
| 126 | // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. | ||
| 127 | // See layer.c for details. | ||
| 128 | static const uint8_t PROGMEM fn_keycode[] = { | ||
| 129 | KC_ENTER, // Fn0 | ||
| 130 | KC_SCOLON, // Fn1 | ||
| 131 | KC_SLASH, // Fn2 | ||
| 132 | KC_UP, // Fn3 | ||
| 133 | KC_NO, // Fn4 | ||
| 134 | KC_NO, // Fn5 | ||
| 135 | KC_NO, // Fn6 | ||
| 136 | KC_NO // Fn7 | ||
| 137 | }; | ||
| 138 | 21 | ||
| 139 | static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 22 | const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 140 | /* Default: | 23 | /* Default: |
| 141 | * M0110 M0120 | 24 | * M0110 |
| 142 | * ,---------------------------------------------------------. ,---------------. | 25 | * ,---------------------------------------------------------. |
| 143 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Gui| -| +| *| | 26 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |
| 144 | * |---------------------------------------------------------| |---------------| | 27 | * |---------------------------------------------------------| |
| 145 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| | 28 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |
| 146 | * |---------------------------------------------------------| |---------------| | 29 | * |---------------------------------------------------------| |
| 147 | * |Ctrl | A| S| D| F| G| H| J| K| L| Fn| '|Return| | 4| 5| 6| ,| | 30 | * |Ctrl | A| S| D| F| G| H| J| K| L| Fn| '|Return| |
| 148 | * |---------------------------------------------------------| |---------------| | 31 | * |---------------------------------------------------------| |
| 149 | * |Shift | Z| X| C| V| B| N| M| ,| ,| Fn|Shift | | 1| 2| 3| | | 32 | * |Shift | Z| X| C| V| B| N| M| ,| ,| Fn|Shift | |
| 150 | * `---------------------------------------------------------' |-----------|Ent| | 33 | * `---------------------------------------------------------' |
| 151 | * |Fn |alt | Space |Gui |Fn | | 0| .| | | 34 | * |Fn |alt | Fn |Gui |Fn | |
| 152 | * `-----------------------------------------------' `---------------' | 35 | * `-----------------------------------------------' |
| 153 | */ | 36 | */ |
| 154 | KEYMAP( | 37 | [0] = KEYMAP( |
| 155 | ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,EQL, PSLS,PAST, | 38 | ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,EQL, PSLS,PAST, |
| 156 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, | 39 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, |
| 157 | LCTL,A, S, D, F, G, H, J, K, L, FN1, QUOT, FN0, P4, P5, P6, PPLS, | 40 | LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT, ENT, P4, P5, P6, PPLS, |
| 158 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN2, FN3, P1, P2, P3, PENT, | 41 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, UP, P1, P2, P3, PENT, |
| 159 | FN4, LALT, SPC, LGUI,BSLS,LGUI,RCTL,RCTL, LGUI, PDOT | 42 | FN0, LALT, FN2, LGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT |
| 160 | ), | 43 | ), |
| 161 | // HHKB & WASD | 44 | // IJKL cursor |
| 162 | KEYMAP( | 45 | [1] = KEYMAP( |
| 163 | GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, | 46 | GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, |
| 164 | CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, P7, P8, P9, PMNS, | 47 | CAPS,NO, NO, NO, NO, NO, HOME,PGDN,UP, PGUP,END, NO, NO, P7, P8, P9, PMNS, |
| 165 | LCTL,VOLD,VOLU,MUTE,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, FN0, P4, P5, P6, PPLS, | 48 | LCTL,VOLD,VOLU,MUTE,NO, NO, HOME,LEFT,DOWN,RGHT,END, NO, ENT, P4, P5, P6, PPLS, |
| 166 | LSFT,NO, NO, NO, NO, NO, NO, NO, END, PGDN,DOWN, FN3, P1, P2, P3, PENT, | 49 | LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, NO, PGUP, P1, P2, P3, PENT, |
| 167 | LCTL,LALT, SPC, LGUI,INS, LGUI,RCTL,RCTL, P0, PDOT | 50 | TRNS,LALT, SPC, LGUI,BSLS,HOME,END, PGDN, P0, PDOT |
| 168 | ), | 51 | ), |
| 169 | // vi mousekeys | 52 | // HJKL cursor |
| 170 | KEYMAP( | 53 | [2] = KEYMAP( |
| 171 | GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, | 54 | GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, |
| 172 | CAPS,NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,PSCR,SLCK,PAUS, P7, P8, P9, PMNS, | 55 | CAPS,NO, NO, NO, NO, NO, HOME,PGDN,UP, PGUP,END, NO, NO, P7, P8, P9, PMNS, |
| 173 | LCTL,VOLD,VOLU,MUTE,NO, NO, MS_L,MS_D,MS_U,MS_R,FN1, NO, ENT, P4, P5, P6, PPLS, | 56 | LCTL,VOLD,VOLU,MUTE,NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, P4, P5, P6, PPLS, |
| 174 | LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,NO, NO, NO, NO, P1, P2, P3, PENT, | 57 | LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS, PGUP, P1, P2, P3, PENT, |
| 175 | FN4, LALT, BTN1, LGUI,NO, LGUI,RCTL,RCTL, P0, PDOT | 58 | TRNS,LALT, SPC, LGUI,BSLS,HOME,END, PGDN, P0, PDOT |
| 176 | ), | 59 | ), |
| 177 | // vi cusorkeys | 60 | // Mousekey |
| 178 | KEYMAP( | 61 | [3] = KEYMAP( |
| 179 | GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, | 62 | GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, |
| 180 | CAPS,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, PSCR,SLCK,PAUS, P7, P8, P9, PMNS, | 63 | CAPS,Q, W, E, R, T, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD, P7, P8, P9, PMNS, |
| 181 | LCTL,NO, NO, NO, NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, P4, P5, P6, PPLS, | 64 | LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,BTN1,NO, ENT, P4, P5, P6, PPLS, |
| 182 | LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, NO, P1, P2, P3, PENT, | 65 | LSFT,Z, X, C, V, B, BTN2,BTN1,BTN4,BTN5,NO, PGUP, P1, P2, P3, PENT, |
| 183 | LCTL,LALT, SPC, LGUI,INS, LGUI,RCTL,RCTL, P0, PDOT | 66 | NO, LALT, TRNS, LGUI,BSLS,HOME,END, PGDN, P0, PDOT |
| 67 | ), | ||
| 68 | // Mousekey | ||
| 69 | [4] = KEYMAP( | ||
| 70 | GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, | ||
| 71 | CAPS,Q, W, E, R, T, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD, P7, P8, P9, PMNS, | ||
| 72 | LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,TRNS,NO, ENT, P4, P5, P6, PPLS, | ||
| 73 | LSFT,Z, X, C, V, B, BTN2,BTN1,BTN4,BTN5,NO, PGUP, P1, P2, P3, PENT, | ||
| 74 | NO, LALT, BTN1, LGUI,BSLS,HOME,END, PGDN, P0, PDOT | ||
| 184 | ), | 75 | ), |
| 185 | }; | 76 | }; |
| 186 | 77 | ||
| 187 | 78 | ||
| 188 | uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) | 79 | /* |
| 189 | { | 80 | * Fn action definition |
| 190 | return KEYCODE(layer, row, col); | 81 | */ |
| 191 | } | 82 | const uint16_t fn_actions[] PROGMEM = { |
| 192 | 83 | [0] = ACTION_LAYER_MOMENTARY(1), | |
| 193 | uint8_t keymap_fn_layer(uint8_t index) | 84 | [1] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), |
| 194 | { | 85 | [2] = ACTION_LAYER_TAP_KEY(3, KC_SPACE), |
| 195 | return pgm_read_byte(&fn_layer[index]); | 86 | [3] = ACTION_LAYER_TAP_KEY(4, KC_SCOLON), |
| 196 | } | 87 | }; |
| 197 | |||
| 198 | uint8_t keymap_fn_keycode(uint8_t index) | ||
| 199 | { | ||
| 200 | return pgm_read_byte(&fn_keycode[index]); | ||
| 201 | } | ||
diff --git a/converter/m0110_usb/keymap_plain.c b/converter/m0110_usb/keymap_plain.c new file mode 100644 index 000000000..f262dca22 --- /dev/null +++ b/converter/m0110_usb/keymap_plain.c | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2014 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include <stdint.h> | ||
| 18 | #include "keycode.h" | ||
| 19 | #include "keymap_common.h" | ||
| 20 | |||
| 21 | |||
| 22 | const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 23 | /* Default: | ||
| 24 | * M0110 M0120 | ||
| 25 | * ,---------------------------------------------------------. ,---------------. | ||
| 26 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| -| +| *| | ||
| 27 | * |---------------------------------------------------------| |---------------| | ||
| 28 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| | ||
| 29 | * |---------------------------------------------------------| |---------------| | ||
| 30 | * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,| | ||
| 31 | * |---------------------------------------------------------| |---------------| | ||
| 32 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | | ||
| 33 | * `---------------------------------------------------------' |-----------|Ent| | ||
| 34 | * |Opt|Mac | Space |Mac |Opt| | 0| .| | | ||
| 35 | * `-----------------------------------------------' `---------------' | ||
| 36 | * M0110A | ||
| 37 | * ,---------------------------------------------------------. ,---------------. | ||
| 38 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Nlk| =| /| *| | ||
| 39 | * |---------------------------------------------------------| |---------------| | ||
| 40 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | ||
| 41 | * |-----------------------------------------------------' | |---------------| | ||
| 42 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| | ||
| 43 | * |---------------------------------------------------------| |---------------| | ||
| 44 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | | ||
| 45 | * |---------------------------------------------------------' |-----------|Ent| | ||
| 46 | * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | | ||
| 47 | * `---------------------------------------------------------' `---------------' | ||
| 48 | */ | ||
| 49 | [0] = KEYMAP( | ||
| 50 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,PEQL,PSLS,PAST, | ||
| 51 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, | ||
| 52 | LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, | ||
| 53 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, | ||
| 54 | LALT,LGUI, SPC, RGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT | ||
| 55 | ), | ||
| 56 | }; | ||
| 57 | |||
| 58 | /* | ||
| 59 | * Fn action definition | ||
| 60 | */ | ||
| 61 | const uint16_t fn_actions[] PROGMEM = { | ||
| 62 | }; | ||
| 63 | |||
| 64 | |||
diff --git a/converter/m0110_usb/keymap_spacefn.c b/converter/m0110_usb/keymap_spacefn.c new file mode 100644 index 000000000..5017861a3 --- /dev/null +++ b/converter/m0110_usb/keymap_spacefn.c | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2014 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include <stdint.h> | ||
| 18 | #include "keycode.h" | ||
| 19 | #include "keymap_common.h" | ||
| 20 | |||
| 21 | |||
| 22 | const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 23 | /* Default: | ||
| 24 | * M0110 M0120 | ||
| 25 | * ,---------------------------------------------------------. ,---------------. | ||
| 26 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| -| +| *| | ||
| 27 | * |---------------------------------------------------------| |---------------| | ||
| 28 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| | ||
| 29 | * |---------------------------------------------------------| |---------------| | ||
| 30 | * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,| | ||
| 31 | * |---------------------------------------------------------| |---------------| | ||
| 32 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | | ||
| 33 | * `---------------------------------------------------------' |-----------|Ent| | ||
| 34 | * |Opt|Mac | Space |Mac |Opt| | 0| .| | | ||
| 35 | * `-----------------------------------------------' `---------------' | ||
| 36 | * M0110A | ||
| 37 | * ,---------------------------------------------------------. ,---------------. | ||
| 38 | * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Nlk| =| /| *| | ||
| 39 | * |---------------------------------------------------------| |---------------| | ||
| 40 | * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| | ||
| 41 | * |-----------------------------------------------------' | |---------------| | ||
| 42 | * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| | ||
| 43 | * |---------------------------------------------------------| |---------------| | ||
| 44 | * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | | ||
| 45 | * |---------------------------------------------------------' |-----------|Ent| | ||
| 46 | * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | | ||
| 47 | * `---------------------------------------------------------' `---------------' | ||
| 48 | */ | ||
| 49 | [0] = KEYMAP( | ||
| 50 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,PEQL,PSLS,PAST, | ||
| 51 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, | ||
| 52 | LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, | ||
| 53 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, | ||
| 54 | LALT,LGUI, FN0, RGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT | ||
| 55 | ), | ||
| 56 | [1] = KEYMAP( | ||
| 57 | ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, | ||
| 58 | TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS, P7, P8, P9, PMNS, | ||
| 59 | LCTL,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS, P4, P5, P6, PPLS, | ||
| 60 | TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP, PGUP, P1, P2, P3, PENT, | ||
| 61 | TRNS,TRNS, TRNS, TRNS,INS, HOME,END, PGDN, P0, PDOT | ||
| 62 | ), | ||
| 63 | }; | ||
| 64 | |||
| 65 | /* | ||
| 66 | * Fn action definition | ||
| 67 | */ | ||
| 68 | const uint16_t fn_actions[] PROGMEM = { | ||
| 69 | [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), | ||
| 70 | [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde | ||
| 71 | }; | ||
