Revert "Add support for 8 buttons to mouse report (#10807)"
This reverts commit 99f3df2893.
This commit is contained in:
@@ -410,18 +410,52 @@ void process_action(keyrecord_t *record, action_t action) {
|
||||
case ACT_MOUSEKEY:
|
||||
if (event.pressed) {
|
||||
mousekey_on(action.key.code);
|
||||
switch (action.key.code) {
|
||||
# if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE)
|
||||
case KC_MS_BTN1:
|
||||
register_button(true, MOUSE_BTN1);
|
||||
break;
|
||||
case KC_MS_BTN2:
|
||||
register_button(true, MOUSE_BTN2);
|
||||
break;
|
||||
case KC_MS_BTN3:
|
||||
register_button(true, MOUSE_BTN3);
|
||||
break;
|
||||
# endif
|
||||
# ifdef POINTING_DEVICE_ENABLE
|
||||
case KC_MS_BTN4:
|
||||
register_button(true, MOUSE_BTN4);
|
||||
break;
|
||||
case KC_MS_BTN5:
|
||||
register_button(true, MOUSE_BTN5);
|
||||
break;
|
||||
# endif
|
||||
default:
|
||||
mousekey_send();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
mousekey_off(action.key.code);
|
||||
}
|
||||
switch (action.key.code) {
|
||||
# if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE)
|
||||
# ifdef POINTING_DEVICE_ENABLE
|
||||
case KC_MS_BTN1 ... KC_MS_BTN8:
|
||||
# else
|
||||
case KC_MS_BTN1 ... KC_MS_BTN3:
|
||||
# endif
|
||||
register_button(event.pressed, MOUSE_BTN_MASK(action.key.code - KC_MS_BTN1));
|
||||
break;
|
||||
case KC_MS_BTN1:
|
||||
register_button(false, MOUSE_BTN1);
|
||||
break;
|
||||
case KC_MS_BTN2:
|
||||
register_button(false, MOUSE_BTN2);
|
||||
break;
|
||||
case KC_MS_BTN3:
|
||||
register_button(false, MOUSE_BTN3);
|
||||
break;
|
||||
# endif
|
||||
# ifdef POINTING_DEVICE_ENABLE
|
||||
case KC_MS_BTN4:
|
||||
register_button(false, MOUSE_BTN4);
|
||||
break;
|
||||
case KC_MS_BTN5:
|
||||
register_button(false, MOUSE_BTN5);
|
||||
break;
|
||||
# endif
|
||||
default:
|
||||
mousekey_send();
|
||||
|
||||
@@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define IS_MOUSEKEY(code) (KC_MS_UP <= (code) && (code) <= KC_MS_ACCEL2)
|
||||
#define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT)
|
||||
#define IS_MOUSEKEY_BUTTON(code) (KC_MS_BTN1 <= (code) && (code) <= KC_MS_BTN8)
|
||||
#define IS_MOUSEKEY_BUTTON(code) (KC_MS_BTN1 <= (code) && (code) <= KC_MS_BTN5)
|
||||
#define IS_MOUSEKEY_WHEEL(code) (KC_MS_WH_UP <= (code) && (code) <= KC_MS_WH_RIGHT)
|
||||
#define IS_MOUSEKEY_ACCEL(code) (KC_MS_ACCEL0 <= (code) && (code) <= KC_MS_ACCEL2)
|
||||
|
||||
@@ -205,9 +205,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define KC_BTN3 KC_MS_BTN3
|
||||
#define KC_BTN4 KC_MS_BTN4
|
||||
#define KC_BTN5 KC_MS_BTN5
|
||||
#define KC_BTN6 KC_MS_BTN6
|
||||
#define KC_BTN7 KC_MS_BTN7
|
||||
#define KC_BTN8 KC_MS_BTN8
|
||||
#define KC_WH_U KC_MS_WH_UP
|
||||
#define KC_WH_D KC_MS_WH_DOWN
|
||||
#define KC_WH_L KC_MS_WH_LEFT
|
||||
@@ -524,18 +521,15 @@ enum internal_special_keycodes {
|
||||
|
||||
enum mouse_keys {
|
||||
/* Mouse Buttons */
|
||||
KC_MS_UP = 0xED,
|
||||
KC_MS_UP = 0xF0,
|
||||
KC_MS_DOWN,
|
||||
KC_MS_LEFT,
|
||||
KC_MS_RIGHT, // 0xF0
|
||||
KC_MS_RIGHT,
|
||||
KC_MS_BTN1,
|
||||
KC_MS_BTN2,
|
||||
KC_MS_BTN3,
|
||||
KC_MS_BTN4,
|
||||
KC_MS_BTN5,
|
||||
KC_MS_BTN6,
|
||||
KC_MS_BTN7,
|
||||
KC_MS_BTN8,
|
||||
|
||||
/* Mouse Wheel */
|
||||
KC_MS_WH_UP,
|
||||
@@ -546,5 +540,5 @@ enum mouse_keys {
|
||||
/* Acceleration */
|
||||
KC_MS_ACCEL0,
|
||||
KC_MS_ACCEL1,
|
||||
KC_MS_ACCEL2 // 0xFF
|
||||
KC_MS_ACCEL2
|
||||
};
|
||||
|
||||
@@ -36,14 +36,11 @@ enum hid_report_ids {
|
||||
/* Mouse buttons */
|
||||
#define MOUSE_BTN_MASK(n) (1 << (n))
|
||||
enum mouse_buttons {
|
||||
MOUSE_BTN1 = MOUSE_BTN_MASK(0),
|
||||
MOUSE_BTN2 = MOUSE_BTN_MASK(1),
|
||||
MOUSE_BTN3 = MOUSE_BTN_MASK(2),
|
||||
MOUSE_BTN4 = MOUSE_BTN_MASK(3),
|
||||
MOUSE_BTN5 = MOUSE_BTN_MASK(4),
|
||||
MOUSE_BTN6 = MOUSE_BTN_MASK(5),
|
||||
MOUSE_BTN7 = MOUSE_BTN_MASK(6),
|
||||
MOUSE_BTN8 = MOUSE_BTN_MASK(7)
|
||||
MOUSE_BTN1 = (1 << 0),
|
||||
MOUSE_BTN2 = (1 << 1),
|
||||
MOUSE_BTN3 = (1 << 2),
|
||||
MOUSE_BTN4 = (1 << 3),
|
||||
MOUSE_BTN5 = (1 << 4)
|
||||
};
|
||||
|
||||
/* Consumer Page (0x0C)
|
||||
|
||||
Reference in New Issue
Block a user