From 54a19346070531389c98c67e59cee1aaa13c36d5 Mon Sep 17 00:00:00 2001 From: Aldo Gunsing Date: Mon, 14 Nov 2016 23:30:06 +0100 Subject: [PATCH 1/8] core: Fix typo in definition AC_g --- tmk_core/common/actionmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/common/actionmap.h b/tmk_core/common/actionmap.h index 5e00bb2e..2ebfb0d0 100644 --- a/tmk_core/common/actionmap.h +++ b/tmk_core/common/actionmap.h @@ -28,7 +28,7 @@ along with this program. If not, see . #define AC_c(kc) ACTION_MODS_KEY(MOD_LCTL, KC_##kc) #define AC_s(kc) ACTION_MODS_KEY(MOD_LSFT, KC_##kc) #define AC_a(kc) ACTION_MODS_KEY(MOD_LALT, KC_##kc) -#define AC_g(kc) ACTION_MODS_KEY(MOD_LSFT, KC_##kc) +#define AC_g(kc) ACTION_MODS_KEY(MOD_LGUI, KC_##kc) /* Normal key */ #define AC_NO ACTION_KEY(KC_NO) From d14f72e2f73309ab61fee8945a95bb3266cdffe7 Mon Sep 17 00:00:00 2001 From: Erik Pettersson Date: Sat, 26 Nov 2016 09:58:21 +0100 Subject: [PATCH 2/8] Fix to make phantom board compile --- orphan/phantom/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orphan/phantom/keymap.c b/orphan/phantom/keymap.c index a040434f..81180aa5 100644 --- a/orphan/phantom/keymap.c +++ b/orphan/phantom/keymap.c @@ -145,7 +145,7 @@ action_t keymap_fn_to_action(uint8_t keycode) if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) { action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); } else { - action.code = ACTION_NO; + return (action_t)ACTION_NO; } return action; } From 391c979be751eaf113c8f53c36644a6bb6ff12f6 Mon Sep 17 00:00:00 2001 From: Luiz Ribeiro Date: Sun, 27 Nov 2016 11:38:24 -0500 Subject: [PATCH 3/8] V-USB remote wakeup --- tmk_core/protocol/vusb/main.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index 0d809536..794e4000 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -20,6 +20,7 @@ #include "timer.h" #include "uart.h" #include "debug.h" +#include "suspend.h" #define UART_BAUD_RATE 115200 @@ -41,6 +42,23 @@ static void initForUsbConnectivity(void) sei(); } +void usb_remote_wakeup(void) { + cli(); + + int8_t ddr_orig = USBDDR; + USBOUT |= (1 << USBMINUS); + USBDDR = ddr_orig | USBMASK; + USBOUT ^= USBMASK; + + _delay_ms(25); + + USBOUT ^= USBMASK; + USBDDR = ddr_orig; + USBOUT &= ~(1 << USBMINUS); + + sei(); +} + int main(void) { bool suspended = false; @@ -70,19 +88,6 @@ int main(void) // Suspend when no SOF in 3ms-10ms(7.1.7.4 Suspending of USB1.1) if (timer_elapsed(last_timer) > 5) { suspended = true; -/* - uart_putchar('S'); - _delay_ms(1); - cli(); - set_sleep_mode(SLEEP_MODE_PWR_DOWN); - sleep_enable(); - sleep_bod_disable(); - sei(); - sleep_cpu(); - sleep_disable(); - _delay_ms(10); - uart_putchar('W'); -*/ } } #endif @@ -95,6 +100,8 @@ int main(void) keyboard_task(); } vusb_transfer_keyboard(); + } else if (suspend_wakeup_condition()) { + usb_remote_wakeup(); } } } From ed538bdeb4ca6a8c70a0f992ab542a8fecae79e4 Mon Sep 17 00:00:00 2001 From: Erik Pettersson Date: Mon, 28 Nov 2016 13:19:50 +0100 Subject: [PATCH 4/8] Fix error in media layer for phantom iso keymap. --- orphan/phantom/keymap_iso.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/orphan/phantom/keymap_iso.h b/orphan/phantom/keymap_iso.h index 80e50731..af92e25e 100644 --- a/orphan/phantom/keymap_iso.h +++ b/orphan/phantom/keymap_iso.h @@ -11,9 +11,9 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 1: media keys */ KEYMAP_ISO(\ TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,SLEP, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,MUTE,VOLD,VOLU, TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,MSTP,MPLY,MPRV,MNXT,MSEL, TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,MUTE,VOLD,VOLU,TRNS, TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,MSTP,MPLY,MPRV,MNXT, TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,MSEL, \ TRNS,TRNS,TRNS,TRNS,CALC,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, CAPS, TRNS, \ TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS) }; From ec60203fd7f10ddc4025731be73ddef78c2fd5f6 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 24 Oct 2016 04:33:04 +0900 Subject: [PATCH 5/8] ps2_usb: Support for hidden switch in model M --- converter/ps2_usb/config.h | 4 +- converter/ps2_usb/config_rev1.h | 2 +- converter/ps2_usb/config_rev2.h | 3 +- converter/ps2_usb/keymap_common.h | 159 ++++++++++++++++++------------ 4 files changed, 101 insertions(+), 67 deletions(-) diff --git a/converter/ps2_usb/config.h b/converter/ps2_usb/config.h index 35eb414f..2fd3ad7f 100644 --- a/converter/ps2_usb/config.h +++ b/converter/ps2_usb/config.h @@ -36,7 +36,7 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ + keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \ ) @@ -61,7 +61,7 @@ along with this program. If not, see . * PS/2 Pin interrupt */ #ifdef PS2_USE_INT -#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) +#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U2__) /* uses INT1 for clock line(ATMega32U4) */ #define PS2_CLOCK_PORT PORTD #define PS2_CLOCK_PIN PIND diff --git a/converter/ps2_usb/config_rev1.h b/converter/ps2_usb/config_rev1.h index 75dc97df..ce670f50 100644 --- a/converter/ps2_usb/config_rev1.h +++ b/converter/ps2_usb/config_rev1.h @@ -36,7 +36,7 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ + keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \ ) diff --git a/converter/ps2_usb/config_rev2.h b/converter/ps2_usb/config_rev2.h index e7224d96..1f42cd49 100644 --- a/converter/ps2_usb/config_rev2.h +++ b/converter/ps2_usb/config_rev2.h @@ -35,7 +35,8 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ + keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \ ) diff --git a/converter/ps2_usb/keymap_common.h b/converter/ps2_usb/keymap_common.h index 6e612e60..4af67522 100644 --- a/converter/ps2_usb/keymap_common.h +++ b/converter/ps2_usb/keymap_common.h @@ -28,20 +28,55 @@ along with this program. If not, see . #include "keymap.h" +/* ,-----------------------------------------------. + * |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24| + * ,---. |-----------------------------------------------| ,-----------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut| + * `---' `-----------------------------------------------' `-----------' `-----------' + * ,-----------------------------------------------------------. ,-----------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| + * |-----------------------------------------------------------| |-----------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| + * |-----------------------------------------------------------| `-----------' |---------------| + * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| ^a|Entr| | 4| 5| 6|KP,| + * |-----------------------------------------------------------| ,---. |---------------| + * |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|Ent| + * |-----------------------------------------------------------| ,-----------. |---------------| + * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | #| 0| .|KP=| + * `-----------------------------------------------------------' `-----------' `---------------' + * + * PS/2 scan codes + * http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf + * ,-----------------------------------------------. + * | 08| 10| 18| 20| 28| 30| 38| 40| 48| 50| 57| 5F| + * ,---. |-----------------------------------------------| ,-----------. ,-----------. + * | 76| | 05| 06| 04| 0C| 03| 0B| 83| 0A| 01| 09| 78| 07| | FC| 7E| FE| | A1| B2| A3| + * `---' `-----------------------------------------------' `-----------' `-----------' + * ,-----------------------------------------------------------. ,-----------. ,---------------. + * | 0E| 16| 1E| 26| 25| 2E| 36| 3D| 3E| 46| 45| 4E| 55| 6A| 66| | F0| EC| FD| | 77| CA| 7C| 7B| + * |-----------------------------------------------------------| |-----------| |---------------| + * | 0D | 15| 1D| 24| 2D| 2C| 35| 3C| 43| 44| 4D| 54| 5B| 5D | | F1| E9| FA| | 6C| 75| 7D| 79| + * |-----------------------------------------------------------| `-----------' |---------------| + * | 58 | 1C| 1B| 23| 2B| 34| 33| 3B| 42| 4B| 4C| 52| ^a| 5A | | 6B| 73| 74| 6D| + * |-----------------------------------------------------------| ,---. |---------------| + * | 12 | 61| 1A| 22| 21| 2A| 32| 31| 3A| 41| 49| 4A| 51| 59 | | F5| | 69| 72| 7A| DA| + * |-----------------------------------------------------------| ,-----------. |---------------| + * | 14| 9F| 11| 67 | 29 | 64 | 13 | 91| A7| AF| 94| | EB| F2| F4| | 68|70 | 71| 63| + * `-----------------------------------------------------------' `-----------' `---------------' + * ^a ISO hash key uses identical scancode 5D to US backslash. + * 51, 63, 68, 6D: hidden keys in IBM model M + */ /* All keys */ #define KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ + K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \ + K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, KA1,KB2,KA3, \ + K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ + K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \ + K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K6D, \ + K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, KF5, K69,K72,K7A,KDA, \ + K14,K9F,K11,K67, K29, K64,K13,K91,KA7,KAF,K94, KEB,KF2,KF4, K68,K70,K71,K63, \ \ - K61, /* for European ISO */ \ - K51, K13, K6A, K64, K67, /* for Japanese JIS */ \ - K08, K10, K18, K20, K28, K30, K38, K40, K48, K50, K57, K5F, /* F13-24 */ \ KB7, KBF, KDE, /* System Power, Sleep, Wake */ \ - KA3, KB2, KA1, /* Mute, Volume Up, Volume Down */ \ KCD, K95, KBB, KB4, KD0, /* Next, Previous, Stop, Pause, Media Select */ \ KC8, KAB, KC0, /* Mail, Calculator, My Computer */ \ K90, KBA, KB8, KB0, /* WWW Search, Home, Back, Forward */ \ @@ -59,8 +94,8 @@ along with this program. If not, see . { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ { KC_##K50, KC_##K51, KC_##K52, KC_NO, KC_##K54, KC_##K55, KC_NO, KC_##K57 }, \ { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_NO, KC_##K5D, KC_NO, KC_##K5F }, \ - { KC_NO, KC_##K61, KC_NO, KC_NO, KC_##K64, KC_NO, KC_##K66, KC_##K67 }, \ - { KC_NO, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_##K61, KC_NO, KC_##K63, KC_##K64, KC_NO, KC_##K66, KC_##K67 }, \ + { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_NO, KC_NO }, \ { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ { KC_NO, KC_NO, KC_NO, KC_##K83, KC_NO, KC_NO, KC_NO, KC_NO }, \ @@ -81,6 +116,31 @@ along with this program. If not, see . { KC_NO, KC_NO, KC_##KFA, KC_NO, KC_##KFC, KC_##KFD, KC_##KFE, KC_NO }, \ } +#define KEYMAP_FULL( \ + K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \ + K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, KA1,KB2,KA3, \ + K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ + K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \ + K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K6D, \ + K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, KF5, K69,K72,K7A,KDA, \ + K14,K9F,K11,K67, K29, K64,K13,K91,KA7,KAF,K94, KEB,KF2,KF4, K68,K70,K71,K63 \ +) \ +KEYMAP_ALL( \ + K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \ + K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, KA1,KB2,KA3, \ + K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ + K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \ + K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K6D, \ + K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, KF5, K69,K72,K7A,KDA, \ + K14,K9F,K11,K67, K29, K64,K13,K91,KA7,KAF,K94, KEB,KF2,KF4, K68,K70,K71,K63, \ + \ + SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ + MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ + MAIL, CALCULATOR, MY_COMPUTER, \ + WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ + WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ +) + /* US layout */ #define KEYMAP( \ K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ @@ -90,23 +150,14 @@ along with this program. If not, see . K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ ) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - NUBS, \ - RO, KANA, JYEN, HENK, MHEN, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ +KEYMAP_FULL( \ + F13,F14,F15,F16,F17,F18,F19,F20,F21,F22,F23,F24, \ + K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, VOLD,VOLU,MUTE, \ + K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,JPY,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ + K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \ + K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,PCMM,\ + K12,NUBS,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, RO, K59, KF5, K69,K72,K7A,KDA, \ + K14,K9F,K11,MHEN, K29, HENK,KANA,K91,KA7,KAF,K94, KEB,KF2,KF4, PWR,K70,K71,PEQL \ ) /* ISO layout */ @@ -118,23 +169,14 @@ KEYMAP_ALL( \ K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ ) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - K61, \ - RO, KANA, JYEN, HENK, MHEN, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ +KEYMAP_FULL( \ + F13,F14,F15,F16,F17,F18,F19,F20,F21,F22,F23,F24, \ + K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, VOLD,VOLU,MUTE, \ + K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,JPY,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ + K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \ + K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,PCMM,\ + K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, RO, K59, KF5, K69,K72,K7A,KDA, \ + K14,K9F,K11,MHEN, K29, HENK,KANA,K91,KA7,KAF,K94, KEB,KF2,KF4, PWR,K70,K71,PEQL \ ) /* JIS layout */ @@ -146,23 +188,14 @@ KEYMAP_ALL( \ K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,K51, K59, KF5, K69,K72,K7A, \ K14,K9F,K11, K67,K29,K64,K13, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ ) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - NUBS, \ - K51, K13, K6A, K64, K67, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ +KEYMAP_FULL( \ + F13,F14,F15,F16,F17,F18,F19,F20,F21,F22,F23,F24, \ + K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, VOLD,VOLU,MUTE, \ + K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ + K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \ + K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,PCMM,\ + K12,NUBS,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, KF5, K69,K72,K7A,KDA, \ + K14,K9F,K11,K67, K29, K64,K13,K91,KA7,KAF,K94, KEB,KF2,KF4, PWR,K70,K71,PEQL \ ) #endif From a88ad583425a0efb9629b4b5030a4d611de77cb0 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 24 Oct 2016 12:50:35 +0900 Subject: [PATCH 6/8] core: Swap position of PEQL and PENT in unimap --- converter/adb_usb/unimap_plain.c | 4 +-- converter/ibm4704_usb/unimap_plain.c | 4 +-- converter/ibm4704_usb/unimap_trans.h | 16 ++++++------ converter/m0110_usb/unimap.c | 4 +-- converter/next_usb/unimap.c | 4 +-- converter/next_usb/unimap_trans.h | 4 +-- converter/ps2_usb/unimap_plain.c | 12 ++++----- converter/ps2_usb/unimap_trans.h | 38 +++++++++++++++++++++------- converter/usb_usb/unimap.c | 4 +-- converter/usb_usb/unimap_trans.h | 4 +-- tmk_core/common/unimap.h | 8 +++--- 11 files changed, 61 insertions(+), 41 deletions(-) diff --git a/converter/adb_usb/unimap_plain.c b/converter/adb_usb/unimap_plain.c index 2521810d..55cef804 100644 --- a/converter/adb_usb/unimap_plain.c +++ b/converter/adb_usb/unimap_plain.c @@ -31,8 +31,8 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = { FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, FN1, DEL, END, PGDN, P7, P8, P9, PMNS, LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PPLS, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, UP, P1, P2, P3, NO, - LCTL,LGUI,LALT,NO, SPC, NO, NO, RALT,RGUI,NO, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT + LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, UP, P1, P2, P3, PENT, + LCTL,LGUI,LALT,NO, SPC, NO, NO, RALT,RGUI,NO, RCTL, LEFT,DOWN,RGHT, P0, PDOT,NO ), UNIMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, diff --git a/converter/ibm4704_usb/unimap_plain.c b/converter/ibm4704_usb/unimap_plain.c index 436c3c74..82996b8c 100644 --- a/converter/ibm4704_usb/unimap_plain.c +++ b/converter/ibm4704_usb/unimap_plain.c @@ -30,8 +30,8 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = { GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, - LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, FN0, LEFT,DOWN,RGHT, P0, PDOT,PENT + LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT, + LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, FN0, LEFT,DOWN,RGHT, P0, PDOT,PEQL ), UNIMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, diff --git a/converter/ibm4704_usb/unimap_trans.h b/converter/ibm4704_usb/unimap_trans.h index 38bb5d3f..276083a9 100644 --- a/converter/ibm4704_usb/unimap_trans.h +++ b/converter/ibm4704_usb/unimap_trans.h @@ -32,9 +32,9 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { // 16*8 * |-------| |-----------------------------------------------------------| |-----------| |---------------| * | F5| F6| |Caps | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| |PrS|ScL|Pau| | 4| 5| 6|KP,| * |-------| |-----------------------------------------------------------| |-----------| |---------------| - * | F7| F8| |Shif| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |F11| Up|F12| | 1| 2| 3|KP=| + * | F7| F8| |Shif| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |F11| Up|F12| | 1| 2| 3|Ent| * |-------| |-----------------------------------------------------------| |-----------| |---------------| - * | F9|F10| |Ctrl |Gui|Alt | Space |Alt* |Gui|Ctrl | |Lef|Dow|Rig| |Esc| 0|KP.|Ent| + * | F9|F10| |Ctrl |Gui|Alt | Space |Alt* |Gui|Ctrl | |Lef|Dow|Rig| |Esc| 0|KP.|KP=| * `-------' `-----------------------------------------------------------' `-----------' `---------------' * scan codes * ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------. @@ -60,8 +60,8 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { // 16*8 { UNIMAP_M, UNIMAP_COMM, UNIMAP_DOT, UNIMAP_SLSH, UNIMAP_RO, UNIMAP_RSFT, UNIMAP_NUBS, UNIMAP_LALT }, // 38-3F { UNIMAP_SPC, UNIMAP_LGUI, UNIMAP_RGUI, UNIMAP_NO, UNIMAP_F7, UNIMAP_F8, UNIMAP_F1, UNIMAP_NLCK }, // 40-47 { UNIMAP_PSLS, UNIMAP_PAST, UNIMAP_PMNS, UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PPLS, UNIMAP_NO }, // 48-4F - { UNIMAP_P4, UNIMAP_P5, UNIMAP_P6, UNIMAP_PCMM, UNIMAP_F9, UNIMAP_F10, UNIMAP_F3, UNIMAP_PENT }, // 50-57 - { UNIMAP_P2, UNIMAP_P3, UNIMAP_PEQL, UNIMAP_ESC, UNIMAP_P0, UNIMAP_PDOT, UNIMAP_P1, UNIMAP_NO }, // 58-5F + { UNIMAP_P4, UNIMAP_P5, UNIMAP_P6, UNIMAP_PCMM, UNIMAP_F9, UNIMAP_F10, UNIMAP_F3, UNIMAP_PEQL }, // 50-57 + { UNIMAP_P2, UNIMAP_P3, UNIMAP_PENT, UNIMAP_ESC, UNIMAP_P0, UNIMAP_PDOT, UNIMAP_P1, UNIMAP_NO }, // 58-5F { UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_F2, UNIMAP_SLCK, UNIMAP_F4, UNIMAP_DOWN }, // 60-67 { UNIMAP_NO, UNIMAP_NO, UNIMAP_INS, UNIMAP_HOME, UNIMAP_PGUP, UNIMAP_DEL, UNIMAP_END, UNIMAP_PGDN }, // 68-6F { UNIMAP_PSCR, UNIMAP_F5, UNIMAP_PAUS, UNIMAP_NO, UNIMAP_F11, UNIMAP_UP, UNIMAP_F12, UNIMAP_F6 }, // 70-77 @@ -75,9 +75,9 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { // 16*8 * |---------------------------------------------------------------| |-----------| |---------------| * |Caps | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| F3| |PrS|ScL|Pau| | 4| 5| 6|KP,| * |---------------------------------------------------------------| |-----------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /| RO|Shift | F4| |F11| Up|F12| | 1| 2| 3|KP=| + * |Shift | Z| X| C| V| B| N| M| ,| .| /| RO|Shift | F4| |F11| Up|F12| | 1| 2| 3|Ent| * |---------------------------------------------------------------| |-----------| |---------------| - * |Ctrl |Gui|Alt | Space |Alt |Gui| Ctrl | |Lef|Dow|Rig| |Esc| 0|KP.|Ent| + * |Ctrl |Gui|Alt | Space |Alt |Gui| Ctrl | |Lef|Dow|Rig| |Esc| 0|KP.|KP=| * `---------------------------------------------------------------' `-----------' `---------------' * ,---------------------------------------------------------------. ,-----------. ,---------------. * | 00| 0F| 01| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 0E| | 44| 45| 46| | 43| 41| 42| 4A| @@ -100,13 +100,13 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { // 16*8 { UNIMAP_LSFT, UNIMAP_LCTL, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_N }, // 30-37 { UNIMAP_M, UNIMAP_COMM, UNIMAP_DOT, UNIMAP_SLSH, UNIMAP_RO, UNIMAP_RSFT, UNIMAP_F4, UNIMAP_LALT }, // 38-3F { UNIMAP_SPC, UNIMAP_PSLS, UNIMAP_PAST, UNIMAP_NLCK, UNIMAP_INS, UNIMAP_HOME, UNIMAP_PGUP, UNIMAP_LGUI }, // 40-47 - { UNIMAP_RGUI, UNIMAP_NO, UNIMAP_PMNS, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PENT, UNIMAP_RALT }, // 48-4F + { UNIMAP_RGUI, UNIMAP_NO, UNIMAP_PMNS, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PEQL, UNIMAP_RALT }, // 48-4F { UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PDOT, UNIMAP_DEL, UNIMAP_END, UNIMAP_PGDN, UNIMAP_RGHT }, // 50-57 { UNIMAP_NO, UNIMAP_NO, UNIMAP_PPLS, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, }, // 58-5F { UNIMAP_P4, UNIMAP_P5, UNIMAP_P6, UNIMAP_P0, UNIMAP_PSCR, UNIMAP_SLCK, UNIMAP_PAUS, UNIMAP_DOWN }, // 60-67 { UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PCMM, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, }, // 68-6F { UNIMAP_P1, UNIMAP_P2, UNIMAP_P3, UNIMAP_ESC, UNIMAP_F11, UNIMAP_UP, UNIMAP_F12, UNIMAP_LEFT }, // 70-77 - { UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, } // 78-7F + { UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PENT, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, } // 78-7F #endif }; diff --git a/converter/m0110_usb/unimap.c b/converter/m0110_usb/unimap.c index 54c856c2..4db7abf6 100644 --- a/converter/m0110_usb/unimap.c +++ b/converter/m0110_usb/unimap.c @@ -32,8 +32,8 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = { GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, NO, NO, NO, NLCK,PEQL,PSLS,PAST, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, FN1, NO, NO, NO, P7, P8, P9, PMNS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PPLS, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, NO, UP, P1, P2, P3, NO, - NO, LGUI,LALT,NO, SPC, NO, NO, NO, FN0, NO, NO, LEFT,DOWN,RGHT, P0, PDOT,PENT + LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, NO, UP, P1, P2, P3, PENT, + NO, LGUI,LALT,NO, SPC, NO, NO, NO, FN0, NO, NO, LEFT,DOWN,RGHT, P0, PDOT,NO ), UNIMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, diff --git a/converter/next_usb/unimap.c b/converter/next_usb/unimap.c index f3cfcd4a..8b57a05f 100644 --- a/converter/next_usb/unimap.c +++ b/converter/next_usb/unimap.c @@ -35,8 +35,8 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = { ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, VOLU,MUTE,PGUP, GRV, BSLS,PSLS,PAST, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, VOLD,NO, PGDN, P7, P8, P9, PMNS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NO, ENT, P4, P5, P6, PPLS, - LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, UP, P1, P2, P3, NO, - LALT,LGUI,NO, NO, SPC, NO, NO, NO, NO, FN0, RALT, LEFT,DOWN,RGHT, P0, PDOT,PENT + LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, UP, P1, P2, P3, PENT, + LALT,LGUI,NO, NO, SPC, NO, NO, NO, NO, FN0, RALT, LEFT,DOWN,RGHT, P0, PDOT,NO ), UNIMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, diff --git a/converter/next_usb/unimap_trans.h b/converter/next_usb/unimap_trans.h index 9a5faf5d..71b39c2a 100644 --- a/converter/next_usb/unimap_trans.h +++ b/converter/next_usb/unimap_trans.h @@ -37,9 +37,9 @@ along with this program. If not, see . * |-----------------------------------------------------------| `-----------' |---------------| * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| | 4| 5| 6|KP,| * |-----------------------------------------------------------| ,---. |---------------| - * |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=| + * |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|Ent| * |-----------------------------------------------------------| ,-----------. |---------------| - * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| + * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|KP=| * `-----------------------------------------------------------' `-----------' `---------------' * * NeXT Matrix(Scan code) diff --git a/converter/ps2_usb/unimap_plain.c b/converter/ps2_usb/unimap_plain.c index bdf8d1f3..93d7b57b 100644 --- a/converter/ps2_usb/unimap_plain.c +++ b/converter/ps2_usb/unimap_plain.c @@ -24,22 +24,22 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (" #else const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = { #endif - UNIMAP( + UNIMAP_PS2( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NO, ENT, P4, P5, P6, PCMM, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, - LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,FN0, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT + CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PCMM, + LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT, + LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,FN0, RCTL, LEFT,DOWN,RGHT, NUHS,P0, PDOT,PEQL ), UNIMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, GRV, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, + TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS + TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS,TRNS,TRNS,TRNS ), }; diff --git a/converter/ps2_usb/unimap_trans.h b/converter/ps2_usb/unimap_trans.h index 472814a6..7a444580 100644 --- a/converter/ps2_usb/unimap_trans.h +++ b/converter/ps2_usb/unimap_trans.h @@ -22,6 +22,25 @@ along with this program. If not, see . #include "unimap.h" +#define UNIMAP_PS2( \ + K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73, \ + K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, K01,K02,K03, \ + K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K74,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ + K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, \ + K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K28, K5C,K5D,K5E,K66, \ + K79,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K75,K7D, K52, K59,K5A,K5B,K58, \ + K78,K7B,K7A,K77, K2C, K76,K00,K7E,K7F,K65,K7C, K50,K51,K4F, K32,K62,K63,K67 \ +) UNIMAP ( \ + K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73, \ + K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, K01,K02,K03, \ + K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K74,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ + K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, \ + K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,K66, \ + K79,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K75,K7D, K52, K59,K5A,K5B,K58, \ + K78,K7B,K7A,K77, K2C, K76,K00,K7E,K7F,K65,K7C, K50,K51,K4F, K62,K63,K67 \ +) + + /* Mapping to Universal keyboard layout * * Universal keyboard layout @@ -35,11 +54,11 @@ along with this program. If not, see . * |-----------------------------------------------------------| |-----------| |---------------| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| * |-----------------------------------------------------------| `-----------' |---------------| - * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| | 4| 5| 6|KP,| + * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| ^a|Retn| | 4| 5| 6|KP,| * |-----------------------------------------------------------| ,---. |---------------| * |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=| * |-----------------------------------------------------------| ,-----------. |---------------| - * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| + * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | #| 0| .|Ent| * `-----------------------------------------------------------' `-----------' `---------------' * * PS/2 scan codes @@ -54,16 +73,18 @@ along with this program. If not, see . * |-----------------------------------------------------------| |-----------| |---------------| * | 0D | 15| 1D| 24| 2D| 2C| 35| 3C| 43| 44| 4D| 54| 5B| 5D | | F1| E9| FA| | 6C| 75| 7D| 79| * |-----------------------------------------------------------| `-----------' |---------------| - * | 58 | 1C| 1B| 23| 2B| 34| 33| 3B| 42| 4B| 4C| 52| --| 5A | | 6B| 73| 74| 6D| + * | 58 | 1C| 1B| 23| 2B| 34| 33| 3B| 42| 4B| 4C| 52| ^a| 5A | | 6B| 73| 74| 6D| * |-----------------------------------------------------------| ,---. |---------------| - * | 12 | 61| 1A| 22| 21| 2A| 32| 31| 3A| 41| 49| 4A| 51| 59 | | F5| | 69| 72| 7A| 0F| + * | 12 | 61| 1A| 22| 21| 2A| 32| 31| 3A| 41| 49| 4A| 51| 59 | | F5| | 69| 72| 7A| DA| * |-----------------------------------------------------------| ,-----------. |---------------| - * | 14| 9F| 11| 67 | 29 | 64 | 13 | 91| A7| AF| 94| | EB| F2| F4| | 70 | 71| DA| + * | 14| 9F| 11| 67 | 29 | 64 | 13 | 91| A7| AF| 94| | EB| F2| F4| | 68| 70| 71| 63| * `-----------------------------------------------------------' `-----------' `---------------' + * ^a: ISO hash key uses identical scancode 5D to US backslash. + * 51, 63, 68, 6D: hidden keys in IBM model M */ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { { UNIMAP_NO, UNIMAP_F9, UNIMAP_NO, UNIMAP_F5, UNIMAP_F3, UNIMAP_F1, UNIMAP_F2, UNIMAP_F12 }, /* 00-07 */ - { UNIMAP_F13, UNIMAP_F10, UNIMAP_F8, UNIMAP_F6, UNIMAP_F4, UNIMAP_TAB, UNIMAP_GRV, UNIMAP_PEQL }, /* 08-0F */ + { UNIMAP_F13, UNIMAP_F10, UNIMAP_F8, UNIMAP_F6, UNIMAP_F4, UNIMAP_TAB, UNIMAP_GRV, UNIMAP_NO }, /* 08-0F */ { UNIMAP_F14, UNIMAP_LALT, UNIMAP_LSHIFT,UNIMAP_KANA, UNIMAP_LCTL, UNIMAP_Q, UNIMAP_1, UNIMAP_NO }, /* 10-17 */ { UNIMAP_F15, UNIMAP_NO, UNIMAP_Z, UNIMAP_S, UNIMAP_A, UNIMAP_W, UNIMAP_2, UNIMAP_NO }, /* 18-1F */ { UNIMAP_F16, UNIMAP_C, UNIMAP_X, UNIMAP_D, UNIMAP_E, UNIMAP_4, UNIMAP_3, UNIMAP_NO }, /* 20-27 */ @@ -74,8 +95,8 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { { UNIMAP_F21, UNIMAP_DOT, UNIMAP_SLASH, UNIMAP_L, UNIMAP_SCOLON,UNIMAP_P, UNIMAP_MINUS, UNIMAP_NO }, /* 48-4F */ { UNIMAP_F22, UNIMAP_RO, UNIMAP_QUOTE, UNIMAP_NO, UNIMAP_LBRC, UNIMAP_EQUAL, UNIMAP_NO, UNIMAP_F23 }, /* 50-57 */ { UNIMAP_CAPS, UNIMAP_RSHIFT,UNIMAP_ENTER, UNIMAP_RBRC, UNIMAP_NO, UNIMAP_BSLASH,UNIMAP_NO, UNIMAP_F24 }, /* 58-5F */ - { UNIMAP_NO, UNIMAP_NUBS, UNIMAP_NO, UNIMAP_NO, UNIMAP_HENK, UNIMAP_NO, UNIMAP_BSPACE,UNIMAP_MHEN }, /* 60-67 */ - { UNIMAP_NO, UNIMAP_P1, UNIMAP_JYEN, UNIMAP_P4, UNIMAP_P7, UNIMAP_PCMM, UNIMAP_NO, UNIMAP_NO }, /* 68-6F */ + { UNIMAP_NO, UNIMAP_NUBS, UNIMAP_NO, UNIMAP_PEQL, UNIMAP_HENK, UNIMAP_NO, UNIMAP_BSPACE,UNIMAP_MHEN }, /* 60-67 */ + { UNIMAP_NUHS, UNIMAP_P1, UNIMAP_JYEN, UNIMAP_P4, UNIMAP_P7, UNIMAP_PCMM, UNIMAP_NO, UNIMAP_NO }, /* 68-6F */ { UNIMAP_P0, UNIMAP_PDOT, UNIMAP_P2, UNIMAP_P5, UNIMAP_P6, UNIMAP_P8, UNIMAP_ESC, UNIMAP_NLCK }, /* 70-77 */ { UNIMAP_F11, UNIMAP_PPLS, UNIMAP_P3, UNIMAP_PMNS, UNIMAP_PAST, UNIMAP_P9, UNIMAP_SLCK, UNIMAP_NO }, /* 78-7F */ { UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_F7, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* 80-87 */ @@ -97,4 +118,3 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { }; #endif - diff --git a/converter/usb_usb/unimap.c b/converter/usb_usb/unimap.c index 2c123806..0f34ece8 100644 --- a/converter/usb_usb/unimap.c +++ b/converter/usb_usb/unimap.c @@ -30,8 +30,8 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = { GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, - LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,FN0, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT + LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT, + LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,FN0, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PEQL ), UNIMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, diff --git a/converter/usb_usb/unimap_trans.h b/converter/usb_usb/unimap_trans.h index e4e59d36..9dc230f9 100644 --- a/converter/usb_usb/unimap_trans.h +++ b/converter/usb_usb/unimap_trans.h @@ -37,9 +37,9 @@ along with this program. If not, see . * |-----------------------------------------------------------| `-----------' |---------------| * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| | 4| 5| 6|KP,| * |-----------------------------------------------------------| ,---. |---------------| - * |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=| + * |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|Ent| * |-----------------------------------------------------------| ,-----------. |---------------| - * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| + * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|KP=| * `-----------------------------------------------------------' `-----------' `---------------' */ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { diff --git a/tmk_core/common/unimap.h b/tmk_core/common/unimap.h index 2dd5b221..6a78d885 100644 --- a/tmk_core/common/unimap.h +++ b/tmk_core/common/unimap.h @@ -28,9 +28,9 @@ Copyright 2016 Jun Wako |-----------------------------------------------------------| `-----------' |---------------| |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Entr| | 4| 5| 6|KP,| |-----------------------------------------------------------| ,---. |---------------| -|Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=| +|Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|Ent| |-----------------------------------------------------------| ,-----------. |---------------| -|Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| +|Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|KP=| `-----------------------------------------------------------' `-----------' `---------------' App: Windows Menu key Gui: Windows key, Mac ⌘ key or Meta key @@ -52,8 +52,8 @@ https://en.wikipedia.org/wiki/Keyboard_layout#Hangul_.28for_Korean.29 K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K74,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, \ K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,K66, \ - K79,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K75,K7D, K52, K59,K5A,K5B,K67, \ - K78,K7B,K7A,K77, K2C, K76,K00,K7E,K7F,K65,K7C, K50,K51,K4F, K62, K63,K58 \ + K79,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K75,K7D, K52, K59,K5A,K5B,K58, \ + K78,K7B,K7A,K77, K2C, K76,K00,K7E,K7F,K65,K7C, K50,K51,K4F, K62,K63,K67 \ ) { \ { AC_##K00, AC_##K01, AC_##K02, AC_##K03, AC_##K04, AC_##K05, AC_##K06, AC_##K07, /* 00-07 */ \ AC_##K08, AC_##K09, AC_##K0A, AC_##K0B, AC_##K0C, AC_##K0D, AC_##K0E, AC_##K0F }, /* 08-0F */ \ From a6a6d4ab49069c2c995fb501f6594c9836b65de7 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 4 Dec 2016 15:23:26 +1100 Subject: [PATCH 7/8] Add in basic documentation for Macro system --- tmk_core/doc/keymap.md | 55 ++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/tmk_core/doc/keymap.md b/tmk_core/doc/keymap.md index df5d6de1..30ee5f18 100644 --- a/tmk_core/doc/keymap.md +++ b/tmk_core/doc/keymap.md @@ -379,19 +379,33 @@ Default Layer also has bitwise operations, they are executed when key is release ACTION_DEFAULT_LAYER_BIT_SET(part, bits) - ### 2.3 Macro action -***TBD*** +`Macro` actions allow you to register a complex sequence of keystrokes when a key is pressed, where macros are simple sequences of keypresses. -`Macro` action indicates complex key strokes. - - MACRO( D(LSHIFT), D(D), END ) - MACRO( U(D), U(LSHIFT), END ) - MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END ) + ACTION_MACRO(id) + ACTION_MACRO_TAP(id) -#### 2.3.1 Macro Commands -- **MACRO()** -- **MACRO_NONE** +`id` is an 8-bit user-defined value the macro getter function can use to pick the specific macro. + + +#### 2.3.1 Implementing Macro getter function +To implement `macro` functions, the macro lookup list must be implemented: + + const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); + +The function must always return a valid macro, and default implementation of `action_get_macro` always returns `MACRO_NONE` which has no effect. + +#### 2.3.1.1 Limitations +Similar to the Function Action system, the selector functions is passed a `keyrecord_t` object, so it can inspect the key state (e.g. different macros on key press or release), and key itself. + +Unlike the Function Action system,`macros` are pre-recorded key sequences, so you can only select from a list. If you want to use dynamic macros then you should look at the more complex function action system. + +#### 2.3.2 Implementing/Defining Macro sequences +Macros are of the form (must be wrapped by the `MACRO` function, and end with an `END` mark) + + MACRO( ..., END ) + +Within each macro, the following commands can be used: - **I()** change interval of stroke. - **D()** press key @@ -401,19 +415,25 @@ Default Layer also has bitwise operations, they are executed when key is release - **SM()** store modifier state - **RM()** restore modifier state - **CM()** clear modifier state -- **END** end mark + +e.g.: + + MACRO( D(LSHIFT), D(D), END ) // hold down LSHIFT and D - will print 'D' + MACRO( U(D), U(LSHIFT), END ) // release U and LSHIFT keys (an event.pressed == False counterpart for the one above) + MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END ) // slowly print out h-e-l-l---o #### 2.3.2 Examples -***TBD*** + +in keymap.c, define `action_get_macro` const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch (id) { - case HELLO: + case 0: return (record->event.pressed ? MACRO( I(0), T(H), T(E), T(L), T(L), W(255), T(O), END ) : MACRO_NONE ); - case ALT_TAB: + case 1: return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); @@ -421,7 +441,12 @@ Default Layer also has bitwise operations, they are executed when key is release return MACRO_NONE; } - +in keymap.c, bind items in `fn_actions` to the macro function + + const action_t PROGMEM fn_actions[] = { + [0] = ACTION_MACRO(0), // will print 'hello' for example + [1] = ACTION_MACRO(1), + }; ### 2.4 Function action From a499c19cd0fc8aac8d63d4009145b1f7265ee607 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 4 Dec 2016 13:19:25 +1100 Subject: [PATCH 8/8] Add note for L/R side bit being ignored --- tmk_core/doc/keymap.md | 1 + 1 file changed, 1 insertion(+) diff --git a/tmk_core/doc/keymap.md b/tmk_core/doc/keymap.md index 30ee5f18..87b72e05 100644 --- a/tmk_core/doc/keymap.md +++ b/tmk_core/doc/keymap.md @@ -569,6 +569,7 @@ This registers modifier key(s) simultaneously with layer switching. ACTION_LAYER_MODS(2, MOD_LSFT | MOD_LALT) +This function can only register left-sided modifiers. The handedness of the modifier (left/right) is an extra bit that is not able to be passed through into the layer system. See: [`common/action_code.h`](../common/action_code.h), the spec for ACT_LAYER_TAP only allows four bits for the mods, whereas the mods themselves require five bits, with the high bit being the left/right handedness. ## 4. Tapping