From a747343b6172459a8b003907327a7d785ae2b43d Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 10 Dec 2016 03:19:32 +0700 Subject: Enable PS2 remote mode --- keyboards/handwired/promethium/promethium.h | 1 + 1 file changed, 1 insertion(+) (limited to 'keyboards/handwired/promethium') diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h index 662eeab99..5b3675c5e 100644 --- a/keyboards/handwired/promethium/promethium.h +++ b/keyboards/handwired/promethium/promethium.h @@ -4,6 +4,7 @@ #include "quantum.h" #define PS2_INIT_DELAY 2000 +#define PS2_MOUSE_USE_REMOTE_MODE #define KEYMAP( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ -- cgit v1.2.3-24-g4f1b From 9838ddcead713f5a61486bd2c3f230f29991cb79 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 10 Dec 2016 03:20:02 +0700 Subject: Pretend to be Thinkpad USB Keyboard --- keyboards/handwired/promethium/config.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'keyboards/handwired/promethium') diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h index 473af67d3..097920a54 100644 --- a/keyboards/handwired/promethium/config.h +++ b/keyboards/handwired/promethium/config.h @@ -20,9 +20,15 @@ along with this program. If not, see . #include "config_common.h" +#define USB_VENDOR_ID_LENOVO 0x17ef +#define USB_DEVICE_ID_LENOVO_TPKBD 0x6009 +#define USB_DEVICE_ID_LENOVO_CUSBKBD 0x6047 +#define USB_DEVICE_ID_LENOVO_CBTKBD 0x6048 +#define USB_DEVICE_ID_LENOVO_TPPRODOCK 0x6067 + /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6660 +#define VENDOR_ID USB_VENDOR_ID_LENOVO +#define PRODUCT_ID USB_DEVICE_ID_LENOVO_CBTKBD #define DEVICE_VER 0x0001 #define MANUFACTURER Priyadi #define PRODUCT Promethium Keyboard -- cgit v1.2.3-24-g4f1b From 0b54b32361ca0bb32086f0a8f74a9beedd3b6fa1 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 10 Dec 2016 19:39:27 +0700 Subject: Enable Adafruit BLE support --- keyboards/handwired/promethium/config.h | 2 +- keyboards/handwired/promethium/rules.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/handwired/promethium') diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h index 097920a54..23fbfd0b9 100644 --- a/keyboards/handwired/promethium/config.h +++ b/keyboards/handwired/promethium/config.h @@ -32,7 +32,7 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER Priyadi #define PRODUCT Promethium Keyboard -#define DESCRIPTION Promethium Keyboard +#define DESCRIPTION /* key matrix size */ #define MATRIX_ROWS 8 diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk index 891f523c2..f305c07e8 100644 --- a/keyboards/handwired/promethium/rules.mk +++ b/keyboards/handwired/promethium/rules.mk @@ -1,4 +1,3 @@ - # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -66,6 +65,7 @@ BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. PS2_MOUSE_ENABLE ?= yes PS2_USE_INT ?= yes +ADAFRUIT_BLE_ENABLE ?= yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -- cgit v1.2.3-24-g4f1b From 32e952bda9ca6bde37c2a450c51a036b13aabd80 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 14 Dec 2016 05:56:17 +0700 Subject: disable remote mode --- keyboards/handwired/promethium/promethium.h | 1 - 1 file changed, 1 deletion(-) (limited to 'keyboards/handwired/promethium') diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h index 5b3675c5e..662eeab99 100644 --- a/keyboards/handwired/promethium/promethium.h +++ b/keyboards/handwired/promethium/promethium.h @@ -4,7 +4,6 @@ #include "quantum.h" #define PS2_INIT_DELAY 2000 -#define PS2_MOUSE_USE_REMOTE_MODE #define KEYMAP( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ -- cgit v1.2.3-24-g4f1b From e5b165c2555365b495a29c4f85f8bf53a511304a Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 14 Dec 2016 07:10:28 +0700 Subject: fine tune trackpoint initialization --- .../handwired/promethium/keymaps/priyadi/keymap.c | 110 ++++----------------- keyboards/handwired/promethium/rules.mk | 1 + 2 files changed, 21 insertions(+), 90 deletions(-) (limited to 'keyboards/handwired/promethium') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index bf797a749..db33b9f66 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -736,106 +736,36 @@ void shutdown_user() void ps2_mouse_init_user() { + uint8_t rcv; + // set TrackPoint sensitivity PS2_MOUSE_SEND(0xE2, "set trackpoint sensitivity: 0xE2"); PS2_MOUSE_SEND(0x81, "set trackpoint sensitivity: 0x81"); PS2_MOUSE_SEND(0x4A, "set trackpoint sensitivity: 0x4A"); - PS2_MOUSE_SEND(0x60, "set trackpoint sensitivity: 0x60"); + PS2_MOUSE_SEND(0x49, "set trackpoint sensitivity: 0x59"); + + // set TrackPoint Negative Inertia factor + PS2_MOUSE_SEND(0xE2, "set negative inertia factor: 0xE2"); + PS2_MOUSE_SEND(0x81, "set negative inertia factor: 0x81"); + PS2_MOUSE_SEND(0x4D, "set negative inertia factor: 0x4D"); + PS2_MOUSE_SEND(0x06, "set negative inertia factor: 0x06"); // set TrackPoint speed // (transfer function upper plateau speed) PS2_MOUSE_SEND(0xE2, "set trackpoint speed: 0xE2"); PS2_MOUSE_SEND(0x81, "set trackpoint speed: 0x81"); PS2_MOUSE_SEND(0x60, "set trackpoint speed: 0x60"); - PS2_MOUSE_SEND(0x90, "set trackpoint speed: 0x90"); + PS2_MOUSE_SEND(0x61, "set trackpoint speed: 0x61"); - // set TrackPoint Negative Inertia factor - PS2_MOUSE_SEND(0xE2, "set negative inertia factor: 0xE2"); - PS2_MOUSE_SEND(0x81, "set negative inertia factor: 0x81"); - PS2_MOUSE_SEND(0x4D, "set negative inertia factor: 0x4D"); - PS2_MOUSE_SEND(0x03, "set negative inertia factor: 0x03"); - - // disable up threshold (click) - PS2_MOUSE_SEND(0xE2, "set disable up threshold: 0xE2"); - PS2_MOUSE_SEND(0x47, "set disable up threshold: 0x47"); - PS2_MOUSE_SEND(0x2C, "set disable up threshold: 0x2C"); - PS2_MOUSE_SEND(0x01, "set disable up threshold: 0x01"); - - // enable TrackPoint Press to Select (PtS) - // print("ps2_mouse_init: send 0xE2: "); - // rcv = ps2_host_send(0xE2); - // phex(rcv); phex(ps2_error); print("\n"); - // print("ps2_mouse_init: send 0x47: "); - // rcv = ps2_host_send(0x47); - // phex(rcv); phex(ps2_error); print("\n"); - // print("ps2_mouse_init: send 0x2C: "); - // rcv = ps2_host_send(0x2C); - // phex(rcv); phex(ps2_error); print("\n"); - // print("ps2_mouse_init: send 0x00: "); - // rcv = ps2_host_send(0x00); - // phex(rcv); phex(ps2_error); print("\n"); - - // set TrackPoint Press to Select threshold - // print("ps2_mouse_init: send 0xE2: "); - // rcv = ps2_host_send(0xE2); - // phex(rcv); phex(ps2_error); print("\n"); - // print("ps2_mouse_init: send 0x81: "); - // rcv = ps2_host_send(0x81); - // phex(rcv); phex(ps2_error); print("\n"); - // print("ps2_mouse_init: send 0x5C: "); - // rcv = ps2_host_send(0x5C); - // phex(rcv); phex(ps2_error); print("\n"); - // // default PtS threshold is 0x08 - // print("ps2_mouse_init: send 0x04: "); - // rcv = ps2_host_send(0x04); - // phex(rcv); phex(ps2_error); print("\n"); - - // set TrackPoint Press to Select time constant (zTc) - // print("ps2_mouse_init: send 0xE2: "); - // rcv = ps2_host_send(0xE2); - // phex(rcv); phex(ps2_error); print("\n"); - // print("ps2_mouse_init: send 0x81: "); - // rcv = ps2_host_send(0x81); - // phex(rcv); phex(ps2_error); print("\n"); - // print("ps2_mouse_init: send 0x5E: "); - // rcv = ps2_host_send(0x5E); - // phex(rcv); phex(ps2_error); print("\n"); - // // default zTc is 0x26 - // print("ps2_mouse_init: send 0x45: "); - // rcv = ps2_host_send(0x45); - // phex(rcv); phex(ps2_error); print("\n"); - - /* - // set TrackPoint Press to Select Jenks Curvature (jkcur) - print("ps2_mouse_init: send 0xE2: "); - rcv = ps2_host_send(0xE2); - phex(rcv); phex(ps2_error); print("\n"); - print("ps2_mouse_init: send 0x81: "); - rcv = ps2_host_send(0x81); - phex(rcv); phex(ps2_error); print("\n"); - print("ps2_mouse_init: send 0x5D: "); - rcv = ps2_host_send(0x5D); - phex(rcv); phex(ps2_error); print("\n"); - // default jkcur is 0x87 - print("ps2_mouse_init: send 0x87: "); - rcv = ps2_host_send(0x87); - phex(rcv); phex(ps2_error); print("\n"); - */ - - /* - // set TrackPoint Minimum Drag (mindrag) - print("ps2_mouse_init: send 0xE2: "); + // inquire pts status rcv = ps2_host_send(0xE2); - phex(rcv); phex(ps2_error); print("\n"); - print("ps2_mouse_init: send 0x81: "); - rcv = ps2_host_send(0x81); - phex(rcv); phex(ps2_error); print("\n"); - print("ps2_mouse_init: send 0x59: "); - rcv = ps2_host_send(0x59); - phex(rcv); phex(ps2_error); print("\n"); - // default PtS mindrag is 0x14 - print("ps2_mouse_init: send 0x14: "); - rcv = ps2_host_send(0x14); - phex(rcv); phex(ps2_error); print("\n"); - */ + rcv = ps2_host_send(0x2C); + rcv = ps2_host_recv_response(); + if ((rcv & 1) == 1) { + // if on, disable pts + rcv = ps2_host_send(0xE2); + rcv = ps2_host_send(0x47); + rcv = ps2_host_send(0x2C); + rcv = ps2_host_send(0x01); + } } \ No newline at end of file diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk index f305c07e8..465ef3359 100644 --- a/keyboards/handwired/promethium/rules.mk +++ b/keyboards/handwired/promethium/rules.mk @@ -66,6 +66,7 @@ RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this PS2_MOUSE_ENABLE ?= yes PS2_USE_INT ?= yes ADAFRUIT_BLE_ENABLE ?= yes +API_SYSEX_ENABLE ?= no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -- cgit v1.2.3-24-g4f1b From c641e46567391276f7580996d544060d1bbac702 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 16 Dec 2016 01:16:55 +0700 Subject: QWERTZ style dot & comma, move QUOT to SCLN position --- .../handwired/promethium/keymaps/priyadi/keymap.c | 58 +++++++++++++++++----- 1 file changed, 45 insertions(+), 13 deletions(-) (limited to 'keyboards/handwired/promethium') diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index db33b9f66..7ae269563 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -425,7 +425,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = KEYMAP( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT , + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT , KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL ), @@ -442,10 +442,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_COLEMAK] = KEYMAP( - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT , - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL + _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______, + _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______, + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Workman @@ -460,10 +460,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_WORKMAN] = KEYMAP( - KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC, - KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_ENT , - KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL + _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______, + _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, + _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Punc @@ -551,7 +551,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_GUI] = KEYMAP( _______, LGUI(KC_1),LGUI(KC_2),LGUI(KC_3),LGUI(KC_4),LGUI(KC_5),LGUI(KC_6),LGUI(KC_7),LGUI(KC_8),LGUI(KC_9),LGUI(KC_0), _______, - LINUX, _______, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,_______, QWERTY, + LINUX, _______, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,KC_PAUS, QWERTY, WIN, _______, KC_MPRV, KC_MPLY, KC_MNXT, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, COLEMAK, OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, RGB_VAI, RGB_VAD, WORKMAN ), @@ -582,6 +582,39 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif switch (keycode) { + // QWERTZ style comma and dot: semicolon and colon when shifted + case KC_COMM: + if (record->event.pressed) { + bool lshifted = keyboard_report->mods & MOD_BIT(KC_LSFT); + bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT); + if (lshifted || rshifted) { + if (lshifted) unregister_code(KC_LSFT); + if (rshifted) unregister_code(KC_RSFT); + register_code(KC_SCLN); + unregister_code(KC_SCLN); + if (lshifted) register_code(KC_LSFT); + if (rshifted) register_code(KC_RSFT); + } else { + register_code(KC_COMM); + unregister_code(KC_COMM); + } + } + return false; + break; + case KC_DOT: + if (record->event.pressed) { + if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT))) { + register_code(KC_SCLN); + unregister_code(KC_SCLN); + } else { + register_code(KC_DOT); + unregister_code(KC_DOT); + } + } + return false; + break; + + // layout switchers case QWERTY: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -610,8 +643,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; - - + // layer switcher case PUNC: if (record->event.pressed) { layer_on(_PUNC); @@ -673,7 +705,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; - + // OS switchers case LINUX: set_unicode_input_mode(UC_LNX); #ifdef AUDIO_ENABLE -- cgit v1.2.3-24-g4f1b