I've stripped out everything not strictly required for mouse button HID support. This include dropping the worker thread completely, shaving down the USB HID descriptor. Flattening the mouse/ source directory structure and removing a bunch of event handling. I have kept the mouse event handling separate from the other HID event handling since I figured that was a pretty neat split. If that's a bad idea, do tell. I've also added a test case for mouse button emulation, since that was untested before. The changes have been tested on a corne (split) in usb mode. Bindings on both the left and the right side works (with the left side as master).
29 lines
396 B
C
29 lines
396 B
C
/*
|
|
* Copyright (c) 2020 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
#pragma once
|
|
|
|
/* Mouse press behavior */
|
|
/* Left click */
|
|
#define MB1 (0x01)
|
|
#define LCLK (MB1)
|
|
|
|
/* Right click */
|
|
#define MB2 (0x02)
|
|
#define RCLK (MB2)
|
|
|
|
/* Middle click */
|
|
#define MB3 (0x04)
|
|
#define MCLK (MB3)
|
|
|
|
#define MB4 (0x08)
|
|
|
|
#define MB5 (0x10)
|
|
|
|
#define MB6 (0x20)
|
|
|
|
#define MB7 (0x40)
|
|
|
|
#define MB8 (0x80)
|