aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/frosty_flake/keymaps/nikchi/Makefile23
-rw-r--r--keyboards/frosty_flake/keymaps/nikchi/config.h24
-rw-r--r--keyboards/frosty_flake/keymaps/nikchi/keymap.c224
-rw-r--r--keyboards/frosty_flake/keymaps/nikchi/readme.md24
-rw-r--r--keyboards/frosty_flake/rules.mk4
-rw-r--r--keyboards/handwired/trackpoint/Makefile3
-rw-r--r--keyboards/handwired/trackpoint/README.md10
-rw-r--r--keyboards/handwired/trackpoint/config.h75
-rw-r--r--keyboards/handwired/trackpoint/keymaps/default/keymap.c7
-rw-r--r--keyboards/handwired/trackpoint/rules.mk25
-rw-r--r--keyboards/handwired/trackpoint/trackpoint.c5
-rw-r--r--keyboards/handwired/trackpoint/trackpoint.h13
-rw-r--r--keyboards/handwired/trackpoint/wiring.pngbin0 -> 7217 bytes
-rw-r--r--keyboards/preonic/keymaps/nikchi/Makefile3
-rw-r--r--keyboards/preonic/keymaps/nikchi/config.h29
-rw-r--r--keyboards/preonic/keymaps/nikchi/keymap.c221
-rw-r--r--keyboards/preonic/keymaps/nikchi/readme.md1
-rw-r--r--quantum/process_keycode/process_unicodemap.c2
-rw-r--r--tmk_core/common.mk20
-rw-r--r--tmk_core/common/action.c34
-rw-r--r--tmk_core/protocol/lufa/lufa.c2
-rw-r--r--tmk_core/protocol/ps2_mouse.c29
22 files changed, 750 insertions, 28 deletions
diff --git a/keyboards/frosty_flake/keymaps/nikchi/Makefile b/keyboards/frosty_flake/keymaps/nikchi/Makefile
new file mode 100644
index 000000000..ad86e82d2
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/nikchi/Makefile
@@ -0,0 +1,23 @@
1# Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
6MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
7EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
8CONSOLE_ENABLE = no # Console for debug(+400)
9COMMAND_ENABLE = no # Commands for debug and configuration
10NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
11BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
12MIDI_ENABLE = no # MIDI controls
13AUDIO_ENABLE = no # Audio output on port C6
14UNICODE_ENABLE = no # Unicode
15UNICODEMAP_ENABLE = yes # unicodemap
16BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
18SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
19TAP_DANCE_ENABLE = yes
20
21ifndef QUANTUM_DIR
22 include ../../../../Makefile
23endif
diff --git a/keyboards/frosty_flake/keymaps/nikchi/config.h b/keyboards/frosty_flake/keymaps/nikchi/config.h
new file mode 100644
index 000000000..e91d082c8
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/nikchi/config.h
@@ -0,0 +1,24 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6#define TAPPING_TERM 300
7#define LEADER_TIMEOUT 400
8
9#define DISABLE_SPACE_CADET_ROLLOVER
10
11#define UNICODE_TYPE_DELAY 0
12
13#define LSPO_KEY KC_9
14#define RSPC_KEY KC_0
15
16#define MOUSEKEY_INTERVAL 20
17#define MOUSEKEY_DELAY 0
18#define MOUSEKEY_TIME_TO_MAX 60
19#define MOUSEKEY_MAX_SPEED 7
20#define MOUSEKEY_WHEEL_DELAY 0
21// place overrides here
22
23#endif
24
diff --git a/keyboards/frosty_flake/keymaps/nikchi/keymap.c b/keyboards/frosty_flake/keymaps/nikchi/keymap.c
new file mode 100644
index 000000000..c9e220721
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/nikchi/keymap.c
@@ -0,0 +1,224 @@
1#include "frosty_flake.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4#include "process_unicode.h"
5#include "process_unicodemap.h"
6#include "quantum.h"
7
8#define _______ KC_TRNS
9
10
11//declarations for tap dancing emojis
12void register_hex32(uint32_t hex);
13void cycleEmojis(qk_tap_dance_state_t *state, void *user_data);
14void cycleAnimals(qk_tap_dance_state_t *state, void *user_data);
15void cycleHands(qk_tap_dance_state_t *state, void *user_data);
16
17void tap(uint16_t keycode){
18 register_code(keycode);
19 unregister_code(keycode);
20};
21
22//Tap Dance Declarations
23enum taps{
24 TD_CTCPS = 0,
25 EMOJIS,
26 ANIMAL,
27 HAND
28};
29
30enum unicode_name { // split every five emojis
31 THINK = 1, // thinking face 🤔
32 GRIN, // grinning face 😊
33 SMRK, // smirk 😏
34 WEARY, // good shit 😩
35 UNAMU, // unamused 😒
36
37 SNEK, // snke 🐍
38 PENGUIN, // 🐧
39 DRAGON, // 🐉
40 MONKEY, // 🐒
41 CHICK, // 🐥
42
43 OKOK, // 👌
44 EFFU, // 🖕
45 INUP, // 👆
46 THUP, // 👍
47 THDN, // 👎
48
49 BBB, // dat B 🅱
50 POO, // poop 💩
51 HUNDR, // 100 💯
52 EGGPL, // EGGPLANT 🍆
53 WATER, // wet 💦
54
55 LIT // fire 🔥
56
57};
58
59enum my_macros {
60 NEWDESK = 0,
61 LEFTDESK,
62 RIGHTDESK,
63 CLOSEDESK
64};
65enum quick {
66 DISFACE = 0,
67 TFLIP,
68 TPUT,
69 SHRUG,
70 FACE,
71 RANDIG
72};
73
74// Tap Dance Definitions
75qk_tap_dance_action_t tap_dance_actions[] = {
76 // Tap once for CTRL, twice for Caps Lock
77 [TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS),
78 [EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleEmojis, NULL, NULL),
79 [ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED(cycleAnimals, NULL, NULL),
80 [HAND] = ACTION_TAP_DANCE_FN_ADVANCED(cycleHands, NULL, NULL)
81// Other declarations would go here, separated by commas, if you have them
82};
83
84// macros
85const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
86 switch(id) {
87 case NEWDESK: // this would trigger when you hit a key mapped as M(0)
88 if (record->event.pressed) {
89 return MACRO( I(1), D(LGUI), D(LCTL), D(D), U(LGUI), U(LCTL), U(D), END ); // NEW DESKTOP
90 }
91 break;
92 case LEFTDESK: // this would trigger when you hit a key mapped as M(0)
93 if (record->event.pressed) {
94 return MACRO( I(1), D(LGUI), D(LCTL), D(LEFT), U(LGUI), U(LCTL), U(LEFT), END ); // LEFT DESKTOP
95 }
96 break;
97 case RIGHTDESK: // this would trigger when you hit a key mapped as M(0)
98 if (record->event.pressed) {
99 return MACRO( I(1), D(LGUI), D(LCTL), D(RGHT), U(LGUI), U(LCTL), U(RGHT), END ); // RIGHT DESKTOP
100 }
101 break;
102 case CLOSEDESK: // this would trigger when you hit a key mapped as M(0)
103 if (record->event.pressed) {
104 return MACRO( I(1), D(LGUI), D(LCTL), D(F4), U(LGUI), U(LCTL), U(F4), END ); // CLOSE DESKTOP
105 }
106 break;
107 }
108 return MACRO_NONE;
109};
110
111// emojis in unicode
112const uint32_t PROGMEM unicode_map[] = {
113 [THINK] = 0x1F914,
114 [GRIN] = 0x1F600,
115 [BBB] = 0x1F171,
116 [POO] = 0x1F4A9,
117 [HUNDR] = 0x1F4AF,
118 [SMRK] = 0x1F60F,
119 [WEARY] = 0x1F629,
120 [EGGPL] = 0x1F346,
121 [WATER] = 0x1F4A6,
122 [LIT] = 0x1F525,
123 [UNAMU] = 0x1F612,
124 [SNEK] = 0x1F40D,
125 [PENGUIN] = 0x1F427,
126 [MONKEY] = 0x1F412,
127 [CHICK] = 0x1F425,
128 [DRAGON] = 0x1F409,
129 [OKOK] = 0x1F44C,
130 [EFFU] = 0x1F595,
131 [INUP] = 0x1F446,
132 [THDN] = 0x1F44E,
133 [THUP] = 0x1F44D
134 };
135// Layouts
136const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
137[0] = KEYMAP(\
138 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \
139 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
140 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, KC_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \
141 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \
142 KC_LSPO,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \
143 TD(TD_CTCPS),KC_LGUI,KC_LALT, KC_SPC, KC_LEAD,KC_RGUI, KC_APP,MO(1) , KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT),
144[1] = KEYMAP(\
145 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \
146 TD(EMOJIS),TD(ANIMAL),TD(HAND),X(SMRK),X(WEARY),X(UNAMU), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
147 KC_TAB, KC_Q, M(0), KC_E, KC_R,X(EGGPL),X(WATER), KC_U, KC_I, KC_O, KC_P, KC_UP ,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \
148 KC_LCTL, M(1), M(3), M(2), KC_F, X(LIT), X(SNEK), KC_J, KC_K, KC_L,KC_LEFT,KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \
149 KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, X(HUNDR), X(BBB), X(POO), KC_M,KC_COMM, KC_DOT,KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \
150 KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2),_______ , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT),
151[2] = KEYMAP(\
152 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \
153 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
154 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \
155 KC_LCTL, KC_D, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \
156 KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \
157 KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, _______, _______, KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT),
158};
159
160LEADER_EXTERNS();
161
162void matrix_scan_user(void) {
163 LEADER_DICTIONARY() {
164 leading = false;
165 leader_end();
166
167 SEQ_TWO_KEYS(KC_A, KC_A) { // select all and copy
168 register_code(KC_LCTL);
169 tap(KC_A);
170 tap(KC_C);
171 unregister_code(KC_LCTL);
172 }
173
174 }
175}
176
177void matrix_init_user(void) {
178 _delay_ms(500);
179 set_unicode_input_mode(UC_WINC);
180};
181
182
183void cycleEmojis(qk_tap_dance_state_t *state, void *user_data) {
184 if(state->count == 1) {
185 unicode_input_start();
186 register_hex32(pgm_read_dword(&unicode_map[state->count]));
187 unicode_input_finish();
188 }
189 else if(state->count <= 5) {
190 tap(KC_BSPC);
191 unicode_input_start();
192 register_hex32(pgm_read_dword(&unicode_map[state->count]));
193 unicode_input_finish();
194 }
195};
196
197void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) {
198 if(state->count == 1) {
199 unicode_input_start();
200 register_hex32(pgm_read_dword(&unicode_map[state->count+5]));
201 unicode_input_finish();
202 }
203 else if(state->count <= 5) {
204 tap(KC_BSPC);
205 unicode_input_start();
206 register_hex32(pgm_read_dword(&unicode_map[state->count+5]));
207 unicode_input_finish();
208 }
209};
210
211void cycleHands(qk_tap_dance_state_t *state, void *user_data) {
212 if(state->count == 1) {
213 unicode_input_start();
214 register_hex32(pgm_read_dword(&unicode_map[state->count+10]));
215 unicode_input_finish();
216 }
217 else if(state->count <= 5) {
218 tap(KC_BSPC);
219 unicode_input_start();
220 register_hex32(pgm_read_dword(&unicode_map[state->count+10]));
221 unicode_input_finish();
222 }
223};
224
diff --git a/keyboards/frosty_flake/keymaps/nikchi/readme.md b/keyboards/frosty_flake/keymaps/nikchi/readme.md
new file mode 100644
index 000000000..0b01f9dbf
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/nikchi/readme.md
@@ -0,0 +1,24 @@
1# The Nikchi's keymap for frosty_flake
2
3### FEATURING
4-SPACE CADET
5-Caps Lock is now LCTRL
6-LCTRL is Tap(LCTRL, Caps Lock)
7
8### LEADER KEY - RALT
9COMBOS
10-a,a => Select All, Copy
11
12
13
14### FN REBINDS for Windows
15```
16 [W] [New Desktop]
17[A][S][D] [Left Desk][Delete Desk][Right Desk]
18
19[Ins][Hom][PUp] [RW][PP][FF]
20[Del][End][PDn] [MU][VD][VU]
21
22Arrows are Mouskeys, left three mods are clicks
23
24``` \ No newline at end of file
diff --git a/keyboards/frosty_flake/rules.mk b/keyboards/frosty_flake/rules.mk
index dd2f4b6ee..f878533fe 100644
--- a/keyboards/frosty_flake/rules.mk
+++ b/keyboards/frosty_flake/rules.mk
@@ -54,8 +54,8 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) 54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
55MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) 55MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) 56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
57CONSOLE_ENABLE ?= yes # Console for debug(+400) 57CONSOLE_ENABLE ?= no # Console for debug(+400)
58COMMAND_ENABLE ?= yes # Commands for debug and configuration 58COMMAND_ENABLE ?= no # Commands for debug and configuration
59# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 59# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
60SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 60SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
61# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 61# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
diff --git a/keyboards/handwired/trackpoint/Makefile b/keyboards/handwired/trackpoint/Makefile
new file mode 100644
index 000000000..191c6bb66
--- /dev/null
+++ b/keyboards/handwired/trackpoint/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/handwired/trackpoint/README.md b/keyboards/handwired/trackpoint/README.md
new file mode 100644
index 000000000..a22fca295
--- /dev/null
+++ b/keyboards/handwired/trackpoint/README.md
@@ -0,0 +1,10 @@
1# IBM Trackpoint demonstration
2
3This is just a simple demo to show how to integrate IBM Trackpoint in QMK.
4
5Wiring used in the demonstration:
6![Wiring example](./wiring.png)
7
8Some documentation:
9* [How to wire IBM Trackpoint](https://github.com/alonswartz/trackpoint)
10* [QMK documentation](https://docs.qmk.fm/)
diff --git a/keyboards/handwired/trackpoint/config.h b/keyboards/handwired/trackpoint/config.h
new file mode 100644
index 000000000..7558c03bf
--- /dev/null
+++ b/keyboards/handwired/trackpoint/config.h
@@ -0,0 +1,75 @@
1#ifndef CONFIG_H
2 #define CONFIG_H
3
4 #include "config_common.h"
5
6 #define VENDOR_ID 0x1234
7 #define PRODUCT_ID 0x5678
8 #define DEVICE_VER 0x0001
9 #define MANUFACTURER QMK
10 #define PRODUCT TRACKPOINT-DEMO
11 #define DESCRIPTION Simple demonstration for IBM Trackpoint integration
12
13 #define MATRIX_ROWS 1
14 #define MATRIX_COLS 3
15
16 #ifdef PS2_USE_USART
17 #define PS2_CLOCK_PORT PORTD
18 #define PS2_CLOCK_PIN PIND
19 #define PS2_CLOCK_DDR DDRD
20 #define PS2_CLOCK_BIT 5
21 #define PS2_DATA_PORT PORTD
22 #define PS2_DATA_PIN PIND
23 #define PS2_DATA_DDR DDRD
24 #define PS2_DATA_BIT 2
25
26 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
27 /* set DDR of CLOCK as input to be slave */
28 #define PS2_USART_INIT() do { \
29 PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
30 PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
31 UCSR1C = ((1 << UMSEL10) | \
32 (3 << UPM10) | \
33 (0 << USBS1) | \
34 (3 << UCSZ10) | \
35 (0 << UCPOL1)); \
36 UCSR1A = 0; \
37 UBRR1H = 0; \
38 UBRR1L = 0; \
39 } while (0)
40 #define PS2_USART_RX_INT_ON() do { \
41 UCSR1B = ((1 << RXCIE1) | \
42 (1 << RXEN1)); \
43 } while (0)
44 #define PS2_USART_RX_POLL_ON() do { \
45 UCSR1B = (1 << RXEN1); \
46 } while (0)
47 #define PS2_USART_OFF() do { \
48 UCSR1C = 0; \
49 UCSR1B &= ~((1 << RXEN1) | \
50 (1 << TXEN1)); \
51 } while (0)
52 #define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
53 #define PS2_USART_RX_DATA UDR1
54 #define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
55 #define PS2_USART_RX_VECT USART1_RX_vect
56 #endif
57
58 #define MATRIX_COL_PINS { F1, F4, F5 }
59 #define MATRIX_ROW_PINS { F0 }
60 #define UNUSED_PINS
61
62 /* COL2ROW or ROW2COL */
63 #define DIODE_DIRECTION COL2ROW
64
65 #define DEBOUNCING_DELAY 5
66
67 #define LOCKING_SUPPORT_ENABLE
68 #define LOCKING_RESYNC_ENABLE
69
70 /* key combination for command */
71 #define IS_COMMAND() ( \
72 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
73 )
74
75#endif
diff --git a/keyboards/handwired/trackpoint/keymaps/default/keymap.c b/keyboards/handwired/trackpoint/keymaps/default/keymap.c
new file mode 100644
index 000000000..22e46d98a
--- /dev/null
+++ b/keyboards/handwired/trackpoint/keymaps/default/keymap.c
@@ -0,0 +1,7 @@
1#include "trackpoint.h"
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 [0] = KEYMAP(
5 KC_BTN1, KC_BTN3, KC_BTN2 \
6 )
7};
diff --git a/keyboards/handwired/trackpoint/rules.mk b/keyboards/handwired/trackpoint/rules.mk
new file mode 100644
index 000000000..0609dd304
--- /dev/null
+++ b/keyboards/handwired/trackpoint/rules.mk
@@ -0,0 +1,25 @@
1MCU = atmega32u4
2F_CPU = 16000000
3ARCH = AVR8
4F_USB = $(F_CPU)
5OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
6OPT_DEFS += -DBOOTLOADER_SIZE=512
7BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
10CONSOLE_ENABLE ?= yes # Console for debug(+400)
11COMMAND_ENABLE ?= yes # Commands for debug and configuration
12SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
13NKRO_ENABLE ?= no # USB Nkey Rollover
14BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
15MIDI_ENABLE ?= no # MIDI controls
16UNICODE_ENABLE ?= no # Unicode
17BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
18AUDIO_ENABLE ?= no # Audio output on port C6
19
20PS2_MOUSE_ENABLE ?= yes
21PS2_USE_USART ?= yes
22
23ifndef QUANTUM_DIR
24 include ../../Makefile
25endif
diff --git a/keyboards/handwired/trackpoint/trackpoint.c b/keyboards/handwired/trackpoint/trackpoint.c
new file mode 100644
index 000000000..124995a64
--- /dev/null
+++ b/keyboards/handwired/trackpoint/trackpoint.c
@@ -0,0 +1,5 @@
1#include "trackpoint.h"
2
3void matrix_init_kb(void) {
4
5}
diff --git a/keyboards/handwired/trackpoint/trackpoint.h b/keyboards/handwired/trackpoint/trackpoint.h
new file mode 100644
index 000000000..b5d73d7db
--- /dev/null
+++ b/keyboards/handwired/trackpoint/trackpoint.h
@@ -0,0 +1,13 @@
1#ifndef TRACKPOINT_H
2#define TRACKPOINT_H
3
4#include "quantum.h"
5
6#define KEYMAP( \
7 k00, k01, k02 \
8) \
9{ \
10 { k00, k01, k02} \
11}
12
13#endif
diff --git a/keyboards/handwired/trackpoint/wiring.png b/keyboards/handwired/trackpoint/wiring.png
new file mode 100644
index 000000000..45806e007
--- /dev/null
+++ b/keyboards/handwired/trackpoint/wiring.png
Binary files differ
diff --git a/keyboards/preonic/keymaps/nikchi/Makefile b/keyboards/preonic/keymaps/nikchi/Makefile
new file mode 100644
index 000000000..3d4659ceb
--- /dev/null
+++ b/keyboards/preonic/keymaps/nikchi/Makefile
@@ -0,0 +1,3 @@
1ifndef QUANTUM_DIR
2 include ../../../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/nikchi/config.h b/keyboards/preonic/keymaps/nikchi/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/preonic/keymaps/nikchi/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/nikchi/keymap.c b/keyboards/preonic/keymaps/nikchi/keymap.c
new file mode 100644
index 000000000..249dd1e64
--- /dev/null
+++ b/keyboards/preonic/keymaps/nikchi/keymap.c
@@ -0,0 +1,221 @@
1#include "preonic.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4#ifdef AUDIO_ENABLE
5 #include "audio.h"
6#endif
7
8// Each layer gets a name for readability, which is then used in the keymap matrix below.
9// The underscores don't mean anything - you can have a layer called STUFF or any other name.
10// Layer names don't all need to be of the same length, obviously, and you can also skip them
11// entirely and just use numbers.
12
13enum preonic_layers {
14 _QWERTY,
15 _COLEMAK,
16 _DVORAK,
17 _LOWER,
18 _RAISE,
19 _ADJUST
20};
21
22enum preonic_keycodes {
23 QWERTY = SAFE_RANGE,
24 LOWER,
25 RAISE,
26 BACKLIT
27};
28
29// Fillers to make layering more clear
30#define _______ KC_TRNS
31#define XXXXXXX KC_NO
32
33const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34
35/* Qwerty
36 * ,-----------------------------------------------------------------------------------.
37 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
38 * |------+------+------+------+------+------+------+------+------+------+------+------|
39 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
40 * |------+------+------+------+------+-------------+------+------+------+------+------|
41 * | CTRL | A | S | D | F | G | H | J | K | L | ; | " |
42 * |------+------+------+------+------+------|------+------+------+------+------+------|
43 * | Lower| Z | X | C | V | B | N | M | , | . | / |Raise |
44 * |------+------+------+------+------+------+------+------+------+------+------+------|
45 * | Brite| Ctrl | Alt | GUI |BKSP |SHIFT |ENTER |SPC | Left | Down | Up |Right |
46 * `-----------------------------------------------------------------------------------'
47 */
48[_QWERTY] = {
49 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
50 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL},
51 {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
52 {LOWER , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RAISE },
53 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, KC_LSFT, KC_ENT, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
54},
55
56/* Lower
57 * ,-----------------------------------------------------------------------------------.
58 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
59 * |------+------+------+------+------+-------------+------+------+------+------+------|
60 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
61 * |------+------+------+------+------+-------------+------+------+------+------+------|
62 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
63 * |------+------+------+------+------+------|------+------+------+------+------+------|
64 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | |
65 * |------+------+------+------+------+------+------+------+------+------+------+------|
66 * | | | | | | | | Next | Vol- | Vol+ | Play |
67 * `-----------------------------------------------------------------------------------'
68 */
69[_LOWER] = {
70 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
71 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
72 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
73 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______},
74 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
75},
76
77/* Raise
78 * ,-----------------------------------------------------------------------------------.
79 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
80 * |------+------+------+------+------+------+------+------+------+------+------+------|
81 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
82 * |------+------+------+------+------+-------------+------+------+------+------+------|
83 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
84 * |------+------+------+------+------+------|------+------+------+------+------+------|
85 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | | | | | | | | Next | Vol- | Vol+ | Play |
88 * `-----------------------------------------------------------------------------------'
89 */
90[_RAISE] = {
91 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
92 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL},
93 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
94 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______},
95 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
96},
97
98/* Adjust (Lower + Raise)
99 * ,-----------------------------------------------------------------------------------.
100 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
101 * |------+------+------+------+------+------+------+------+------+------+------+------|
102 * | | Reset| | | | | | | | | | Del |
103 * |------+------+------+------+------+-------------+------+------+------+------+------|
104 * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
105 * |------+------+------+------+------+------|------+------+------+------+------+------|
106 * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
107 * |------+------+------+------+------+------+------+------+------+------+------+------|
108 * | | | | | | | | | | | |
109 * `-----------------------------------------------------------------------------------'
110 */
111[_ADJUST] = {
112 {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
113 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
114 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______},
115 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
116 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
117}
118
119
120};
121
122#ifdef AUDIO_ENABLE
123float tone_startup[][2] = {
124 {NOTE_B5, 20},
125 {NOTE_B6, 8},
126 {NOTE_DS6, 20},
127 {NOTE_B6, 8}
128};
129
130float tone_qwerty[][2] = SONG(QWERTY_SOUND);
131float tone_dvorak[][2] = SONG(DVORAK_SOUND);
132float tone_colemak[][2] = SONG(COLEMAK_SOUND);
133
134float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
135
136float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
137#endif
138
139void persistent_default_layer_set(uint16_t default_layer) {
140 eeconfig_update_default_layer(default_layer);
141 default_layer_set(default_layer);
142}
143
144bool process_record_user(uint16_t keycode, keyrecord_t *record) {
145 switch (keycode) {
146 case QWERTY:
147 if (record->event.pressed) {
148 #ifdef AUDIO_ENABLE
149 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
150 #endif
151 persistent_default_layer_set(1UL<<_QWERTY);
152 }
153 return false;
154 break;
155 case LOWER:
156 if (record->event.pressed) {
157 layer_on(_LOWER);
158 update_tri_layer(_LOWER, _RAISE, _ADJUST);
159 } else {
160 layer_off(_LOWER);
161 update_tri_layer(_LOWER, _RAISE, _ADJUST);
162 }
163 return false;
164 break;
165 case RAISE:
166 if (record->event.pressed) {
167 layer_on(_RAISE);
168 update_tri_layer(_LOWER, _RAISE, _ADJUST);
169 } else {
170 layer_off(_RAISE);
171 update_tri_layer(_LOWER, _RAISE, _ADJUST);
172 }
173 return false;
174 break;
175 case BACKLIT:
176 if (record->event.pressed) {
177 register_code(KC_RSFT);
178 #ifdef BACKLIGHT_ENABLE
179 backlight_step();
180 #endif
181 } else {
182 unregister_code(KC_RSFT);
183 }
184 return false;
185 break;
186 }
187 return true;
188};
189
190void matrix_init_user(void) {
191 #ifdef AUDIO_ENABLE
192 startup_user();
193 #endif
194}
195
196#ifdef AUDIO_ENABLE
197
198void startup_user()
199{
200 _delay_ms(20); // gets rid of tick
201 PLAY_NOTE_ARRAY(tone_startup, false, 0);
202}
203
204void shutdown_user()
205{
206 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
207 _delay_ms(150);
208 stop_all_notes();
209}
210
211void music_on_user(void)
212{
213 music_scale_user();
214}
215
216void music_scale_user(void)
217{
218 PLAY_NOTE_ARRAY(music_scale, false, 0);
219}
220
221#endif
diff --git a/keyboards/preonic/keymaps/nikchi/readme.md b/keyboards/preonic/keymaps/nikchi/readme.md
new file mode 100644
index 000000000..e911968dd
--- /dev/null
+++ b/keyboards/preonic/keymaps/nikchi/readme.md
@@ -0,0 +1 @@
# The default Preonic layout - largely based on the Planck's \ No newline at end of file
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
index 0227fbdd7..75f35112b 100644
--- a/quantum/process_keycode/process_unicodemap.c
+++ b/quantum/process_keycode/process_unicodemap.c
@@ -49,7 +49,7 @@ bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
49 if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { 49 if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) {
50 const uint32_t* map = unicode_map; 50 const uint32_t* map = unicode_map;
51 uint16_t index = keycode - QK_UNICODE_MAP; 51 uint16_t index = keycode - QK_UNICODE_MAP;
52 uint32_t code = pgm_read_dword_far(&map[index]); 52 uint32_t code = pgm_read_dword(&map[index]);
53 if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) { 53 if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) {
54 // Convert to UTF-16 surrogate pair 54 // Convert to UTF-16 surrogate pair
55 code -= 0x10000; 55 code -= 0x10000;
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index 3e0bd7dbc..edec2acb4 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -95,27 +95,35 @@ endif
95 95
96ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) 96ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
97 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE 97 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
98 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
98endif 99endif
99 100
100ifeq ($(strip $(BLUETOOTH)), AdafruitBLE) 101ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
101 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE 102 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
102 TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_BLE 103 TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_BLE
104 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
103endif 105endif
104 106
105ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey) 107ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
106 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE 108 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
107 TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_EZKEY 109 TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_EZKEY
110 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
108endif 111endif
109 112
110ifeq ($(strip $(BLUETOOTH)), RN42) 113ifeq ($(strip $(BLUETOOTH)), RN42)
111 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE 114 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
112 TMK_COMMON_DEFS += -DMODULE_RN42 115 TMK_COMMON_DEFS += -DMODULE_RN42
116 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
113endif 117endif
114 118
115ifeq ($(strip $(ONEHAND_ENABLE)), yes) 119ifeq ($(strip $(ONEHAND_ENABLE)), yes)
116 TMK_COMMON_DEFS += -DONEHAND_ENABLE 120 TMK_COMMON_DEFS += -DONEHAND_ENABLE
117endif 121endif
118 122
123ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes)
124 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
125endif
126
119ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes) 127ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
120 TMK_COMMON_DEFS += -DKEYMAP_SECTION_ENABLE 128 TMK_COMMON_DEFS += -DKEYMAP_SECTION_ENABLE
121 129
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index a534f818e..f73b0fe80 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -34,6 +34,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
34#include "nodebug.h" 34#include "nodebug.h"
35#endif 35#endif
36 36
37int tp_buttons;
38
37#ifdef FAUXCLICKY_ENABLE 39#ifdef FAUXCLICKY_ENABLE
38#include <fauxclicky.h> 40#include <fauxclicky.h>
39#endif 41#endif
@@ -311,11 +313,35 @@ void process_action(keyrecord_t *record, action_t action)
311 /* Mouse key */ 313 /* Mouse key */
312 case ACT_MOUSEKEY: 314 case ACT_MOUSEKEY:
313 if (event.pressed) { 315 if (event.pressed) {
314 mousekey_on(action.key.code); 316 switch (action.key.code) {
315 mousekey_send(); 317 case KC_MS_BTN1:
318 tp_buttons |= (1<<0);
319 break;
320 case KC_MS_BTN2:
321 tp_buttons |= (1<<1);
322 break;
323 case KC_MS_BTN3:
324 tp_buttons |= (1<<2);
325 break;
326 default:
327 mousekey_on(action.key.code);
328 mousekey_send();
329 }
316 } else { 330 } else {
317 mousekey_off(action.key.code); 331 switch (action.key.code) {
318 mousekey_send(); 332 case KC_MS_BTN1:
333 tp_buttons &= ~(1<<0);
334 break;
335 case KC_MS_BTN2:
336 tp_buttons &= ~(1<<1);
337 break;
338 case KC_MS_BTN3:
339 tp_buttons &= ~(1<<2);
340 break;
341 default:
342 mousekey_off(action.key.code);
343 mousekey_send();
344 }
319 } 345 }
320 break; 346 break;
321#endif 347#endif
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index ae6129d1a..3c4ad4b4d 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -1180,7 +1180,7 @@ int main(void)
1180 1180
1181 print("Keyboard start.\n"); 1181 print("Keyboard start.\n");
1182 while (1) { 1182 while (1) {
1183 #if !defined(BLUETOOTH_ENABLE) 1183 #if !defined(NO_USB_STARTUP_CHECK)
1184 while (USB_DeviceState == DEVICE_STATE_Suspended) { 1184 while (USB_DeviceState == DEVICE_STATE_Suspended) {
1185 print("[s]"); 1185 print("[s]");
1186 suspend_power_down(); 1186 suspend_power_down();
diff --git a/tmk_core/protocol/ps2_mouse.c b/tmk_core/protocol/ps2_mouse.c
index d9ccbecb4..4ed3cae1f 100644
--- a/tmk_core/protocol/ps2_mouse.c
+++ b/tmk_core/protocol/ps2_mouse.c
@@ -72,12 +72,13 @@ void ps2_mouse_init_user(void) {
72 72
73void ps2_mouse_task(void) { 73void ps2_mouse_task(void) {
74 static uint8_t buttons_prev = 0; 74 static uint8_t buttons_prev = 0;
75 extern int tp_buttons;
75 76
76 /* receives packet from mouse */ 77 /* receives packet from mouse */
77 uint8_t rcv; 78 uint8_t rcv;
78 rcv = ps2_host_send(PS2_MOUSE_READ_DATA); 79 rcv = ps2_host_send(PS2_MOUSE_READ_DATA);
79 if (rcv == PS2_ACK) { 80 if (rcv == PS2_ACK) {
80 mouse_report.buttons = ps2_host_recv_response(); 81 mouse_report.buttons = ps2_host_recv_response() | tp_buttons;
81 mouse_report.x = ps2_host_recv_response() * PS2_MOUSE_X_MULTIPLIER; 82 mouse_report.x = ps2_host_recv_response() * PS2_MOUSE_X_MULTIPLIER;
82 mouse_report.y = ps2_host_recv_response() * PS2_MOUSE_Y_MULTIPLIER; 83 mouse_report.y = ps2_host_recv_response() * PS2_MOUSE_Y_MULTIPLIER;
83#ifdef PS2_MOUSE_ENABLE_SCROLLING 84#ifdef PS2_MOUSE_ENABLE_SCROLLING
@@ -106,34 +107,34 @@ void ps2_mouse_task(void) {
106#endif 107#endif
107 host_mouse_send(&mouse_report); 108 host_mouse_send(&mouse_report);
108 } 109 }
109 110
110 ps2_mouse_clear_report(&mouse_report); 111 ps2_mouse_clear_report(&mouse_report);
111} 112}
112 113
113void ps2_mouse_disable_data_reporting(void) { 114void ps2_mouse_disable_data_reporting(void) {
114 PS2_MOUSE_SEND(PS2_MOUSE_DISABLE_DATA_REPORTING, "ps2 mouse disable data reporting"); 115 PS2_MOUSE_SEND(PS2_MOUSE_DISABLE_DATA_REPORTING, "ps2 mouse disable data reporting");
115} 116}
116 117
117void ps2_mouse_enable_data_reporting(void) { 118void ps2_mouse_enable_data_reporting(void) {
118 PS2_MOUSE_SEND(PS2_MOUSE_ENABLE_DATA_REPORTING, "ps2 mouse enable data reporting"); 119 PS2_MOUSE_SEND(PS2_MOUSE_ENABLE_DATA_REPORTING, "ps2 mouse enable data reporting");
119} 120}
120 121
121void ps2_mouse_set_remote_mode(void) { 122void ps2_mouse_set_remote_mode(void) {
122 PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_REMOTE_MODE, "ps2 mouse set remote mode"); 123 PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_REMOTE_MODE, "ps2 mouse set remote mode");
123 ps2_mouse_mode = PS2_MOUSE_REMOTE_MODE; 124 ps2_mouse_mode = PS2_MOUSE_REMOTE_MODE;
124} 125}
125 126
126void ps2_mouse_set_stream_mode(void) { 127void ps2_mouse_set_stream_mode(void) {
127 PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_STREAM_MODE, "ps2 mouse set stream mode"); 128 PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_STREAM_MODE, "ps2 mouse set stream mode");
128 ps2_mouse_mode = PS2_MOUSE_STREAM_MODE; 129 ps2_mouse_mode = PS2_MOUSE_STREAM_MODE;
129} 130}
130 131
131void ps2_mouse_set_scaling_2_1(void) { 132void ps2_mouse_set_scaling_2_1(void) {
132 PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_SCALING_2_1, "ps2 mouse set scaling 2:1"); 133 PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_SCALING_2_1, "ps2 mouse set scaling 2:1");
133} 134}
134 135
135void ps2_mouse_set_scaling_1_1(void) { 136void ps2_mouse_set_scaling_1_1(void) {
136 PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_SCALING_1_1, "ps2 mouse set scaling 1:1"); 137 PS2_MOUSE_SEND_SAFE(PS2_MOUSE_SET_SCALING_1_1, "ps2 mouse set scaling 1:1");
137} 138}
138 139
139void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution) { 140void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution) {
@@ -204,9 +205,9 @@ static inline void ps2_mouse_enable_scrolling(void) {
204#define PRESS_SCROLL_BUTTONS mouse_report->buttons |= (PS2_MOUSE_SCROLL_BTN_MASK) 205#define PRESS_SCROLL_BUTTONS mouse_report->buttons |= (PS2_MOUSE_SCROLL_BTN_MASK)
205#define RELEASE_SCROLL_BUTTONS mouse_report->buttons &= ~(PS2_MOUSE_SCROLL_BTN_MASK) 206#define RELEASE_SCROLL_BUTTONS mouse_report->buttons &= ~(PS2_MOUSE_SCROLL_BTN_MASK)
206static inline void ps2_mouse_scroll_button_task(report_mouse_t *mouse_report) { 207static inline void ps2_mouse_scroll_button_task(report_mouse_t *mouse_report) {
207 static enum { 208 static enum {
208 SCROLL_NONE, 209 SCROLL_NONE,
209 SCROLL_BTN, 210 SCROLL_BTN,
210 SCROLL_SENT, 211 SCROLL_SENT,
211 } scroll_state = SCROLL_NONE; 212 } scroll_state = SCROLL_NONE;
212 static uint16_t scroll_button_time = 0; 213 static uint16_t scroll_button_time = 0;
@@ -228,10 +229,10 @@ static inline void ps2_mouse_scroll_button_task(report_mouse_t *mouse_report) {
228 mouse_report->y = 0; 229 mouse_report->y = 0;
229 } 230 }
230 } else if (0 == (PS2_MOUSE_SCROLL_BTN_MASK & mouse_report->buttons)) { 231 } else if (0 == (PS2_MOUSE_SCROLL_BTN_MASK & mouse_report->buttons)) {
231 // None of the scroll buttons are pressed 232 // None of the scroll buttons are pressed
232 233
233#if PS2_MOUSE_SCROLL_BTN_SEND 234#if PS2_MOUSE_SCROLL_BTN_SEND
234 if (scroll_state == SCROLL_BTN 235 if (scroll_state == SCROLL_BTN
235 && timer_elapsed(scroll_button_time) < PS2_MOUSE_SCROLL_BTN_SEND) { 236 && timer_elapsed(scroll_button_time) < PS2_MOUSE_SCROLL_BTN_SEND) {
236 PRESS_SCROLL_BUTTONS; 237 PRESS_SCROLL_BUTTONS;
237 host_mouse_send(mouse_report); 238 host_mouse_send(mouse_report);