Merge remote-tracking branch 'tmk/master'

This commit is contained in:
Mark Sikora 2022-11-06 08:36:51 -05:00
commit 994d664fd0
26 changed files with 11647 additions and 11876 deletions

View file

@ -78,9 +78,6 @@ UNIMAP_ENABLE ?= yes # Use unimap
ACTIONMAP_ENABLE ?= no # Use 16bit actionmap instead of 8bit keymap
KEYMAP_SECTION_ENABLE ?= yes # fixed address keymap for keymap editor
# ADB Mice need acceleration for todays much bigger screens.
ADB_MOUSE_MAXACC ?= 1
OPT_DEFS += -DADB_MOUSE_MAXACC=$(ADB_MOUSE_MAXACC)
# Enable scroll wheel functionality using the y-axis of the mouse
# Hold the assigned button down to scroll using the mouse
@ -96,12 +93,13 @@ OPT_DEFS += -DADB_MOUSE_MAXACC=$(ADB_MOUSE_MAXACC)
#
ADB_MOUSE_SCROLL_BUTTON ?= 0 # Assign the button (1-8) (0 to disable)
ADB_MOUSE_SCROLL_SPEED ?= 10 # 1 (fastest) to 127 (slowest)
OPT_DEFS += -DADB_MOUSE_SCROLL_BUTTON=$(ADB_MOUSE_SCROLL_BUTTON)
OPT_DEFS += -DADB_MOUSE_SCROLL_SPEED=$(ADB_MOUSE_SCROLL_SPEED)
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax
OPT_DEFS += -DADB_MOUSE_SCROLL_BUTTON=$(ADB_MOUSE_SCROLL_BUTTON)
OPT_DEFS += -DADB_MOUSE_SCROLL_SPEED=$(ADB_MOUSE_SCROLL_SPEED)
#
# Keymap file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -47,9 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// https://github.com/tmk/tmk_keyboard/issues/724
#define ADB_MOUSE_2ND_BUTTON_QUIRK
// Scan unsupported devices with register0 when SRQ is asserted
#define ADB_SRQ_SCAN_REG0
/* ADB port setting */
#define ADB_PORT PORTD

File diff suppressed because it is too large Load diff

View file

@ -27,59 +27,57 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |F24|
* `---' `---------------' `---------------' `---------------' `-----------' `---'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,---.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *| |VUp|
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY| BS| |Ins|Hom|PgU| |NmL| =| /| *| |VUp|
* |-----------------------------------------------------------| |-----------| |---------------| |---|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| -| |VDn|
* |-----------------------------------------------------------| `-----------' |---------------| |---|
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '| #| Ret| | 4| 5| 6| +| |Mut|
* |-----------------------------------------------------------| ,---. |---------------| `---'
* |Shif| <| Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
* |Shif| <| Z| X| C| V| B| N| M| ,| ,| /| RO| Shift| |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------|Ent| ,---.
* |Ctrl |Opt |Gui | Space |Gui* |Opt |Ctrl | |Lef|Dow|Rig| | 0| .| | |F13|
* |Ctrl |Opt |Cmd |Eng| Space |Jpn|Ent|Cmd* |Opt |Ctrl | |Lef|Dow|Rig| | 0| ,| .| | |F13|
* `-----------------------------------------------------------' `-----------' `---------------' `---'
* Eng:, Jpn:
*
* ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---.
* | 35| | 7A| 78| 63| 76| | 60| 61| 62| 64| | 65| 6D| 67| 6F| | 69| 6B| 71| | 7F|
* `---' `---------------' `---------------' `---------------' `-----------' `---'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,---.
* |*32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33 | | 72| 73| 74| | 47| 51| 4B| 43| | 48|
* |*32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 5D| 33| | 72| 73| 74| | 47| 51| 4B| 43| | 48|
* |-----------------------------------------------------------| |-----------| |---------------| |---|
* | 30 | 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A | | 75| 77| 79| | 59| 5B| 5C| 4E| | 49|
* | 30 | 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A | | 75| 77| 79| | 59| 5B| 5C| 4E| | 49|
* |-----------------------------------------------------------| `-----------' |---------------| |---|
* | 39 | 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27|*70| 24 | | 56| 57| 58| 45| | 4A|
* |-----------------------------------------------------------| ,---. |---------------| `---'
* | 38 |*0A| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 7B | | 3E| | 53| 54| 55| |
* | 38 |*0A| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 5E| 7B | | 3E| | 53| 54| 55| |
* |-----------------------------------------------------------| ,-----------. |-----------| 4C| ,---.
* | 36 | 3A | 37 | 31 | 37 | 7C | 7D | | 3B| 3D| 3C| | 52 | 41| | | 42|
* | 36 | 3A | 37 | 66| 31 | 68| 6A| *37 | 7C | 7D | | 3B| 3D| 3C| | 52| 5F| 41| | | 42|
* `-----------------------------------------------------------' `-----------' `---------------' `---'
* NOTE: Not-extended ADB keyboards have no discrimination between left and right modifiers.
* Use left ones for mapping. Right modifier always sends same code as left one.
* Apple Extended Keyboard can discriminate the modifiers except for Command(GUI) key.
* For Apple ISO keyboard scan code 0A and 32 are swapped and scan code 2A is translated to 70.
* For ISO keyboard scan code 0A and 32 are swapped and scan code 2A is translated to 70.
* For JIS Keyboard scan code 2A is translated to 70.
*/
#define UNIMAP_ADB( \
K35, K7A,K78,K63,K76,K60,K61,K62,K64,K65,K6D,K67,K6F, K69,K6B,K71, K7F, \
K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18, K33, K72,K73,K74, K47,K51,K4B,K43, K48, \
K30,K0C,K0D,K0E,K0F,K10,K11,K20,K22,K1F,K23,K21,K1E, K2A, K75,K77,K79, K59,K5B,K5C,K4E, K49, \
K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K5D,K33, K72,K73,K74, K47,K51,K4B,K43, K48, \
K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K2A, K75,K77,K79, K59,K5B,K5C,K4E, K49, \
K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K70,K24, K56,K57,K58,K45, K4A, \
K38,K0A,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K7B, K3E, K53,K54,K55,K4C, \
K36,K3A,K37, K31, K7C,K7D, K3B,K3D,K3C, K52,K41, K42 \
K38,K0A,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K5E,K7B, K3E, K53,K54,K55,K4C, \
K36,K3A,K37,K66, K31, K68,K6A, K7C,K7D, K3B,K3D,K3C, K52,K5F,K41, K42 \
) UNIMAP( \
K42,NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, K7F, \
K35, K7A,K78,K63,K76,K60,K61,K62,K64,K65,K6D,K67,K6F, K69,K6B,K71, K49,K48,K4A, \
K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,NO, K33, K72,K73,K74, K47,K51,K4B,K43, \
K30,K0C,K0D,K0E,K0F,K10,K11,K20,K22,K1F,K23,K21,K1E, K2A, K75,K77,K79, K59,K5B,K5C,K4E, \
K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K5D,K33, K72,K73,K74, K47,K51,K4B,K43, \
K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K2A, K75,K77,K79, K59,K5B,K5C,K4E, \
K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K70,K24, K56,K57,K58,K45, \
K38,K0A,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, NO, K7B, K3E, K53,K54,K55,K4C, \
K36,K37,K3A,NO, K31, NO, NO, K7C,NO, NO, K7D, K3B,K3D,K3C, K52,K41,NO \
K38,K0A,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K5E,K7B, K3E, K53,K54,K55,K4C, \
K36,K37,K3A,K66, K31, K68,K6A,K7C,NO, NO, K7D, K3B,K3D,K3C, K52, K41,K5F \
)
// http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c
// http://opensource.apple.com//source/IOHIDFamily/IOHIDFamily-701.20.10/IOHIDFamily/Cosmo_USB2ADB.c
// http://m0115.web.fc2.com/m0115.jpg
// Not used: UNIMAP_{F14, F15, F21, F22, KP_EQUAL}
// Not mapped: 0x46, 0x4D, 0x6C
// https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#scan-codes
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
// Position(unimap) ADB scan code(matrix)
// ---------------------------------------------
@ -161,14 +159,14 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
UNIMAP_RIGHT, // 0x3C
UNIMAP_DOWN, // 0x3D
UNIMAP_UP, // 0x3E
UNIMAP_F23, // 0x3F FN?
UNIMAP_NO, // 0x3F FN?
},
{
UNIMAP_F17, // 0x40
UNIMAP_KP_DOT, // 0x41
UNIMAP_NO, // 0x40
UNIMAP_KP_DOT, // 0x41 ADB keypad dot
UNIMAP_F13, // 0x42 Mic(Adjustable keyboard)
UNIMAP_KP_MINUS, // 0x43 ADB keypad asterisk(top right)
UNIMAP_F18, // 0x44 dup
UNIMAP_NO, // 0x44
UNIMAP_KP_COMMA, // 0x45 ADB keypad plus
UNIMAP_NO, // 0x46
UNIMAP_NUMLOCK, // 0x47
@ -181,10 +179,10 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
UNIMAP_KP_ENTER, // 0x4C dup
UNIMAP_NO, // 0x4D
UNIMAP_KP_PLUS, // 0x4E ADB keypad minus
UNIMAP_F18, // 0x4F dup
UNIMAP_NO, // 0x4F
},
{
UNIMAP_F19, // 0x50
UNIMAP_NO, // 0x50
UNIMAP_KP_SLASH, // 0x51 ADB keypad equal(next to clear/numlock)
UNIMAP_KP_0, // 0x52
UNIMAP_KP_1, // 0x53
@ -196,12 +194,12 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
{
UNIMAP_KP_6, // 0x58
UNIMAP_KP_7, // 0x59
UNIMAP_F20, // 0x5A
UNIMAP_NO, // 0x5A
UNIMAP_KP_8, // 0x5B
UNIMAP_KP_9, // 0x5C
UNIMAP_JYEN, // 0x5D
UNIMAP_RO, // 0x5E
UNIMAP_KP_COMMA, // 0x5F
UNIMAP_JPY, // 0x5D JIS Yen
UNIMAP_RO, // 0x5E JIS Ro
UNIMAP_KP_EQUAL, // 0x5F JIS keypad comma
},
{
UNIMAP_F5, // 0x60
@ -210,13 +208,13 @@ const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
UNIMAP_F3, // 0x63
UNIMAP_F8, // 0x64
UNIMAP_F9, // 0x65
UNIMAP_MHEN, // 0x66
UNIMAP_MHEN, // 0x66 Eisu
UNIMAP_F11, // 0x67
},
{
UNIMAP_HENK, // 0x68
UNIMAP_HENK, // 0x68 Kana
UNIMAP_PSCREEN, // 0x69 PrintScreen/F13
UNIMAP_F16, // 0x6A
UNIMAP_KANA, // 0x6A
UNIMAP_SCROLLLOCK, // 0x6B ScrollLock/F14
UNIMAP_NO, // 0x6C
UNIMAP_F10, // 0x6D

View file

@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define AC_FN0 ACTION_LAYER_TAP_KEY(1, KC_GRV)
#define AC_FN1 ACTION_LAYER_TAP_KEY(2, KC_BSLS)
#define AC_FN1 ACTION_LAYER_TAP_KEY(1, KC_BSLS)
#define AC_PKEY ACTION_MODS_TAP_KEY(MOD_NONE, KC_PWR)
#ifdef KEYMAP_SECTION_ENABLE
@ -31,27 +31,24 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|
* `---' `---------------' `---------------' `---------------' `-----------' `---'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,---.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *| |VUp|
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY| BS| |Ins|Hom|PgU| |NmL| =| /| *| |VUp|
* |-----------------------------------------------------------| |-----------| |---------------| |---|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -| |VDn|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| -| |VDn|
* |-----------------------------------------------------------| `-----------' |---------------| |---|
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|# |Retn| | 4| 5| 6| +| |Mut|
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '| #| Ret| | 4| 5| 6| +| |Mut|
* |-----------------------------------------------------------| ,---. |---------------| `---'
* |Shif|\ | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
* |Shif| <| Z| X| C| V| B| N| M| ,| ,| /| RO| Shift| |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------|Ent| ,---.
* |Ctrl |Opt |Gui | Space |Gui* |Opt |Ctrl | |Lef|Dow|Rig| | 0| .| | |Ply|
* |Ctrl |Opt |Gui |MHN| Space |HNK|KAN|Gui* |Opt |Ctrl | |Lef|Dow|Rig| | 0| ,| .| | |Ply|
* `-----------------------------------------------------------' `-----------' `---------------' `---'
* NOTE: Not-extended ADB keyboards have no discrimination between left and right modifiers.
* Use left ones for mapping. Right modifier always sends same code as left one.
* Apple Extended Keyboard can discriminate the modifiers except for Command(GUI) key.
*/
[0] = UNIMAP_ADB(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, PKEY,
FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST, VOLU,
FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JPY, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST, VOLU,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, FN1, DEL, END, PGDN, P7, P8, P9, PMNS, VOLD,
LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PPLS, MUTE,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, PENT,
LCTL,LALT,LGUI, SPC, RALT,RCTL, LEFT,DOWN,RGHT, P0, PDOT, MPLY
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT,
LCTL,LALT,LGUI,MHEN, SPC, HENK,KANA, RALT,RCTL, LEFT,DOWN,RGHT, P0, PCMM,PDOT, MPLY
),
/*
@ -59,48 +56,23 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
* | `| | | | | | | | | | | | | | | | | | | | | |
* `---' `---------------' `---------------' `---------------' `-----------' `---'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,---.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | | | | | | | | | | | |
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| | | | | | | | | | | |
* |-----------------------------------------------------------| |-----------| |---------------| |---|
* | | | | | | | | |PrS|ScL|Pau|Up |INS| | | | | | | | | | | | |
* |-----------------------------------------------------------| `-----------' |---------------| |---|
* |CapsLo|VoD|VoU|Mut| | | | |Hom|PgU|Lef|Rig|# |Retn| | | | | | | |
* |-----------------------------------------------------------| ,---. |---------------| `---'
* | | | | | | | | | |End|PgD|Dow|Shift | |PgU| | | | | |
* | | | | | | | | | |End|PgD|Dow| RO| Shift| |PgU| | | | | |
* |-----------------------------------------------------------| ,-----------. |-----------| | ,---.
* | | | | | | | | |Hom|PgD|End| | | | | | |
* | | | | | | | | | | |Hom|PgD|End| | | | | | | |
* `-----------------------------------------------------------' `-----------' `---------------' `---'
*/
[1] = UNIMAP_ADB(
GRV, 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, DEL, 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, TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, 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,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN, TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS, TRNS
),
/*
* ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---.
* | `| | | | | | | | | | | | | | | | | | | | | |
* `---' `---------------' `---------------' `---------------' `-----------' `---'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,---.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | | | | | | | | | | | |
* |-----------------------------------------------------------| |-----------| |---------------| |---|
* | | | | | | | | |PrS|ScL|Pau|Up |INS| | | | | | | | | | | | |
* |-----------------------------------------------------------| `-----------' |---------------| |---|
* |CapsLo|VoD|VoU|Mut| | | | |Hom|PgU|Lef|Rig|# |Retn| | | | | | | |
* |-----------------------------------------------------------| ,---. |---------------| `---'
* | | | | | | | | | |End|PgD|Dow|Shift | |PgU| | | | | |
* |-----------------------------------------------------------| ,-----------. |-----------| | ,---.
* | | | | | | | | |Hom|PgD|End| | | | | | |
* `-----------------------------------------------------------' `-----------' `---------------' `---'
*/
[2] = UNIMAP_ADB(
GRV, 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, DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, 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,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN, TRNS, PGUP, 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,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS, HOME,PGDN,END, TRNS,TRNS,TRNS, TRNS
),
};

View file

@ -74,7 +74,7 @@ BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1150)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+2200)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+400)
CONSOLE_ENABLE ?= yes # Console for debug(+4150)
COMMAND_ENABLE ?= no # Commands for debug and configuration(+3600)
COMMAND_ENABLE ?= yes # Commands for debug and configuration(+3600)
NKRO_ENABLE ?= yes # USB Nkey Rollover(+350)
KEYMAP_SECTION_ENABLE ?= yes

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -45,6 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// G80-2551 terminal keyboard support
#define G80_2551_SUPPORT
// SIEMENS PCD 2 keyboard support
#define SIEMENS_PCD_SUPPORT
// Mouse Extended Report
//#define MOUSE_EXT_REPORT

View file

@ -178,12 +178,18 @@ uint8_t IBMPCConverter::process_interface(void)
if (ibmpc.error) {
xprintf("\n%u ERR:%02X ISR:%04X ", timer_read(), ibmpc.error, ibmpc.isr_debug);
/* Error handling:
* IBMPC_ERR_PARITY Reinit
* IBMPC_ERR_PARITY_AA AT/XT Auto-Switching
* IBMPC_ERR_SEND Ignore
* IBMPC_ERR_TIMEOUT Reinit
* IBMPC_ERR_FULL Ignore
* IBMPC_ERR_ILLEGAL Reinit
* IBMPC_ERR_FF Ignore(not used)
*/
// when recv error, neither send error nor buffer full
if (!(ibmpc.error & (IBMPC_ERR_SEND | IBMPC_ERR_FULL))) {
if (state == LOOP) {
// Reset
state = ERROR;
}
state = ERROR;
if (ibmpc.error == IBMPC_ERR_PARITY_AA) {
// AT/XT Auto-Switching support
// https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-Keyboard-Converter#atxt-auto-switching
@ -219,6 +225,7 @@ uint8_t IBMPCConverter::process_interface(void)
case INIT:
xprintf("I%u ", timer_read());
init_time = timer_read();
ibmpc.host_isr_clear();
ibmpc.host_enable();
state = WAIT_SETTLE;
break;
@ -873,8 +880,16 @@ int8_t IBMPCConverter::process_cs1(uint8_t code)
*/
uint8_t IBMPCConverter::cs2_e0code(uint8_t code) {
switch(code) {
// E0 prefixed codes translation See [a].
case 0x11: return 0x0F; // right alt
case 0x11: if (0xAB90 == keyboard_id || 0xAB91 == keyboard_id)
return 0x13; // Hiragana(5576) -> KANA
else
return 0x0F; // right alt
case 0x41: if (0xAB90 == keyboard_id || 0xAB91 == keyboard_id)
return 0x7C; // Keypad ,(5576) -> Keypad *
else
return (code & 0x7F);
case 0x14: return 0x19; // right control
case 0x1F: return 0x17; // left GUI
case 0x27: return 0x1F; // right GUI
@ -975,13 +990,6 @@ uint8_t IBMPCConverter::translate_5576_cs2(uint8_t code) {
}
return code;
}
uint8_t IBMPCConverter::translate_5576_cs2_e0(uint8_t code) {
switch (code) {
case 0x11: return 0x13; // Hiragana -> KANA
case 0x41: return 0x7C; // Keypad , -> Keypad *
}
return code;
}
int8_t IBMPCConverter::process_cs2(uint8_t code)
{
@ -1028,9 +1036,6 @@ int8_t IBMPCConverter::process_cs2(uint8_t code)
}
break;
case CS2_E0: // E0-Prefixed
if (0xAB90 == keyboard_id || 0xAB91 == keyboard_id) {
code = translate_5576_cs2_e0(code);
}
switch (code) {
case 0x12: // to be ignored
case 0x59: // to be ignored
@ -1075,9 +1080,6 @@ int8_t IBMPCConverter::process_cs2(uint8_t code)
}
break;
case CS2_E0_F0: // Break code of E0-prefixed
if (0xAB90 == keyboard_id || 0xAB91 == keyboard_id) {
code = translate_5576_cs2_e0(code);
}
switch (code) {
case 0x12: // to be ignored
case 0x59: // to be ignored

View file

@ -0,0 +1,93 @@
# Target file name (without extension).
TARGET = serial_mouse
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# project specific files
SRC = serial_mouse.c
CONFIG_H = config.h
# MCU name
#MCU = at90usb1287
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
#MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
#EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
#COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover
NO_KEYBOARD = yes # disable keyboard
SERIAL_MOUSE_MICROSOFT_ENABLE = yes
SERIAL_MOUSE_USE_UART = yes # Hardware UART(preferable)
#SERIAL_MOUSE_USE_SOFT = yes # Software Serial
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/rules.mk

View file

@ -0,0 +1,60 @@
Serial Mouse Converter
======================
This makes old serial mouse into modern USB one.
Tested by:
- Microsoft green-eyed mouse
- DELL mouse can work with DTR only.
Pinout
------
DE-9 DB-25 DTE DCE Description
----------------------------------------------------------------
2 3 RXD TXD data from mouse
3 2 TXD RXD used by mouse as power source?
4 20 DTR DSR used by mouse as power source
5 7 GND GND
7 4 RTS CTS used by mouse as power source
*DTE=Converter, DCE=Mouse
## RS-232 Driver
Microsoft mouse seems to need higher voltage for power source.
SP3232E outputs only +-6V at charge pump output and didn't work.
ADM232A works for both Microsoft and DELL.
Microsoft green-eyed mouse requires both while DELL mouse can work with DTR only.
## Wiring
Mouse RXD, TXD, DTR and RTS should be wired to RS-232 driver.
Wire up RS-232 driver charge pump output V+ to DTR and RTS for power source purpose.
Connect Mouse TXD to AVR PD2(RXD) *through* RS-232 driver for mouse data.
UART Setting
------------
defined in config.h.
### Microsoft serial mouse
1200 baud, 7-bit data, no parity, 1-bit stop, lsb-first
### MouseSystems
1200 baud, 8-bit data, no parity, 1-bit stop, lsb-first(Not tested)
Resources
---------
Get power out of PC RS-232 port:
https://www.epanorama.net/circuits/rspower.html
Microsoft serial mouse:
https://web.archive.org/web/20130307230349/www.kryslix.com/nsfaq/Q.12.html
Serial Mice Protocols:
https://roborooter.com/post/serial-mice/

View file

@ -0,0 +1,120 @@
/*
Copyright 2022 Jun Wako <wakojun@gmail.com>
*/
#ifndef CONFIG_H
#define CONFIG_H
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x31CE
#define DEVICE_VER 0x0001
#define MANUFACTURER TMK
#define PRODUCT Serial Mouse
#define DESCRIPTION TMK keyboard firmware
/* key matrix size */
#define MATRIX_ROWS 1
#define MATRIX_COLS 1
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
/*
* Hardware Serial(UART)
* 1200 baud, 7-bit data, no parity, 1-bit stop, lsb-first
*/
#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U2__)
#define SERIAL_UART_BAUD 1200
#define SERIAL_UART_DATA UDR1
#define SERIAL_UART_UBRR ((F_CPU/(16UL*SERIAL_UART_BAUD))-1)
#define SERIAL_UART_RXD_VECT USART1_RX_vect
#define SERIAL_UART_TXD_READY (UCSR1A&(1<<UDRE1))
#define SERIAL_UART_INIT() do { \
UBRR1L = (uint8_t) SERIAL_UART_UBRR; /* baud rate */ \
UBRR1H = (uint8_t) (SERIAL_UART_UBRR>>8); /* baud rate */ \
UCSR1B |= (1<<RXCIE1) | (1<<RXEN1); /* RX interrupt, RX: enable */ \
UCSR1B |= (0<<TXCIE1) | (1<<TXEN1); /* TX interrupt, TX: enable */ \
UCSR1C = (1<<UCSZ11) | (0<<UCSZ10) | /* data: 7-bit */ \
(0<<UPM11) | (0<<UPM10); /* parity: none(00), even(01), odd(11) */ \
DDRD &= ~(1<<2); PORTD |= (1<<2); /* Pull-up RXD pin */ \
sei(); \
} while(0)
#else
#error "USART configuration is needed."
#endif
/*
* Software Serial
* 1200 baud, 7-bit data, no parity, 1-bit stop, lsb-first
*/
#define SERIAL_SOFT_BAUD 1200
#define SERIAL_SOFT_PARITY_NONE
#define SERIAL_SOFT_BIT_ORDER_LSB
//#define SERIAL_SOFT_LOGIC_NEGATIVE
#define SERIAL_SOFT_DATA_7BIT
#define SERIAL_SOFT_DEBUG
/* RXD Port */
#define SERIAL_SOFT_RXD_DDR DDRD
#define SERIAL_SOFT_RXD_PORT PORTD
#define SERIAL_SOFT_RXD_PIN PIND
#define SERIAL_SOFT_RXD_BIT 2
#define SERIAL_SOFT_RXD_READ() (SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
/* RXD Interupt */
#define SERIAL_SOFT_RXD_VECT INT2_vect
#define SERIAL_SOFT_RXD_INIT() do { \
/* pin configuration: input with pull-up */ \
SERIAL_SOFT_RXD_DDR &= ~(1<<SERIAL_SOFT_RXD_BIT); \
SERIAL_SOFT_RXD_PORT |= (1<<SERIAL_SOFT_RXD_BIT); \
/* enable interrupt: INT2(Positive:falling edge, Negative:rising edge) */ \
EICRA |= ((1<<ISC21)|(0<<ISC20)); \
EIMSK |= (1<<INT2); \
sei(); \
} while (0)
#define SERIAL_SOFT_RXD_INT_ENTER()
#define SERIAL_SOFT_RXD_INT_EXIT() do { \
/* clear interrupt flag */ \
EIFR = (1<<INTF2); \
} while (0)
/* TXD Port */
#define SERIAL_SOFT_TXD_DDR DDRD
#define SERIAL_SOFT_TXD_PORT PORTD
#define SERIAL_SOFT_TXD_PIN PIND
#define SERIAL_SOFT_TXD_BIT 3
#define SERIAL_SOFT_TXD_HI() do { SERIAL_SOFT_TXD_PORT |= (1<<SERIAL_SOFT_TXD_BIT); } while (0)
#define SERIAL_SOFT_TXD_LO() do { SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); } while (0)
#define SERIAL_SOFT_TXD_INIT() do { \
/* pin configuration: output */ \
SERIAL_SOFT_TXD_DDR |= (1<<SERIAL_SOFT_TXD_BIT); \
/* idle */ \
SERIAL_SOFT_TXD_ON(); \
} while (0)
#endif

View file

@ -0,0 +1,21 @@
/*
Copyright 2022 Jun Wako <wakojun@gmail.com>
*/
#include <stdint.h>
#include <stdbool.h>
#include "debug.h"
#include "serial_mouse.h"
void hook_early_init(void)
{
debug_enable = true;
debug_mouse = true;
serial_mouse_init();
}
void hook_main_loop(void)
{
serial_mouse_task();
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -264,6 +264,7 @@ enum unimap_position_codes {
#define UNIMAP_NUBS UNIMAP_NONUS_BSLASH
/* Japanese specific */
#define UNIMAP_ZKHK UNIMAP_GRAVE
#define UNIMAP_JPY UNIMAP_JYEN
/* Keypad */
#define UNIMAP_P1 UNIMAP_KP_1
#define UNIMAP_P2 UNIMAP_KP_2

View file

@ -164,7 +164,7 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
// the stop by a minimum of 140 J.lS beyond its normal duration, as shown in Figure 8-15."
// http://ww1.microchip.com/downloads/en/AppNotes/00591b.pdf
if (!data_in()) { adb_srq = true; } else { adb_srq = false; }
if (!wait_data_hi(500)) { // Service Request(310us Adjustable Keyboard): just ignored
if (!wait_data_hi(500)) { // wait for end of SRQ:(310us Adjustable Keyboard)
xprintf("R");
sei();
return 0;
@ -198,12 +198,14 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
// |________| |
//
uint8_t lo = (uint8_t) wait_data_hi(130);
if (!lo)
goto error; // no more bit or after stop bit
if (!lo) {
goto error; // SRQ?
}
uint8_t hi = (uint8_t) wait_data_lo(lo);
if (!hi)
goto error; // stop bit extedned by Srq?
if (!hi) {
goto error; // stop bit
}
if (n/8 >= len) continue; // can't store in buf
@ -216,6 +218,7 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
error:
sei();
_delay_us(200);
return n/8;
}
@ -244,6 +247,7 @@ void adb_host_listen_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
}
place_bit0(); // Stopbit(0);
sei();
_delay_us(200);
}
void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l)

View file

@ -68,11 +68,6 @@ POSSIBILITY OF SUCH DAMAGE.
#define ADB_ADDR_13 13
#define ADB_ADDR_14 14
#define ADB_ADDR_15 15
// for temporary purpose, do not use for polling
#define ADB_ADDR_KBD_POLL 9
#define ADB_ADDR_MOUSE_POLL 10
#define ADB_ADDR_KBD_TMP 14
#define ADB_ADDR_MOUSE_TMP 15
// Command Type
#define ADB_CMD_RESET 0
#define ADB_CMD_FLUSH 1

View file

@ -140,6 +140,13 @@ RETRY:
WAIT(data_hi, 300, 7);
WAIT(clock_hi, 300, 8);
#ifdef SIEMENS_PCD_SUPPORT
// inhibit - https://github.com/tmk/tmk_keyboard/issues/747
wait_us(15);
clock_lo();
wait_us(150);
#endif
// clear buffer to get response correctly
host_isr_clear();
@ -360,6 +367,13 @@ void IBMPC::isr(void)
}
DONE:
#ifdef SIEMENS_PCD_SUPPORT
// inhibit - https://github.com/tmk/tmk_keyboard/issues/747
clock_lo();
wait_us(150);
clock_hi();
#endif
// store data
ringbuf_put(isr_state & 0xFF);
if (ringbuf_is_full()) {

View file

@ -86,7 +86,9 @@ void serial_init(void)
}
/* RX ring buffer */
#define RBUF_SIZE 8
#ifndef RBUF_SIZE
#define RBUF_SIZE 256
#endif
static uint8_t rbuf[RBUF_SIZE];
static uint8_t rbuf_head = 0;
static uint8_t rbuf_tail = 0;

@ -1 +1 @@
Subproject commit e37ed6cf28b45db8022fd513b338d22c5515afed
Subproject commit 35606b2a9bb1e02e1adac14a8484c32d7a5e9f1c

View file

@ -139,6 +139,7 @@ CFLAGS += -Wstrict-prototypes
CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
CFLAGS += $(CSTANDARD)
CFLAGS += -flto
ifdef CONFIG_H
CFLAGS += -include $(CONFIG_H)
endif
@ -173,6 +174,7 @@ CPPFLAGS += -Wundef
CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
#CPPFLAGS += $(CSTANDARD)
CPPFLAGS += -flto
ifdef CONFIG_H
CPPFLAGS += -include $(CONFIG_H)
endif
@ -189,6 +191,7 @@ endif
# dump that will be displayed for a given single line of source input.
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
ASFLAGS += -flto
ifdef CONFIG_H
ASFLAGS += -include $(CONFIG_H)
endif
@ -261,6 +264,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
#LDFLAGS += -T linker_script.x
# You can give EXTRALDFLAGS at 'make' command line.
LDFLAGS += $(EXTRALDFLAGS)
LDFLAGS += -flto