Refactor touchpad movement generation by migrating MovementMaker to userland.

This considerably overhauls touchpad event generation, simplifying and
cleaning it up considerably:

 * Return the touchpad specifications through the MS_IS_TOUCHPAD ioctl.

 * There is now a dedicated MS_READ_TOUCHPAD ioctl, as touchpads
   can either return touchpad_movement structures or mouse_movement
   ones depending on what mode they are operating in.

 * Event repeating on timeouts is now handled in MovementMaker and
   the input_server control thread, so MS_READ_TOUCHPAD takes
   a timeout value. This means we can drop all the EventProducers.

 * Use the real floating-point math functions in MovementMaker now
   that we are running in userland.

 * Drop unused structures, constants, headers, and other things
   related to touchpad support.

Change-Id: I28cdb28e4100393a9338a8ebb865573cec13fc1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5455
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2022-07-18 16:00:29 +00:00
committed by waddlesplash
parent 1f26a521ac
commit 5e596efecf
16 changed files with 363 additions and 725 deletions
@@ -32,6 +32,7 @@ enum {
B_MOUSE_SPEED_CHANGED,
B_CLICK_SPEED_CHANGED,
B_MOUSE_ACCELERATION_CHANGED,
B_SET_TOUCHPAD_SETTINGS,
};
namespace BPrivate {
+30 -3
View File
@@ -62,9 +62,10 @@ enum {
MS_GET_CLICKSPEED,
MS_SET_CLICKSPEED,
MS_NUM_SERIAL_MICE,
MS_IS_TOUCHPAD,
MS_SET_TOUCHPAD_SETTINGS,
MS_READ_TOUCHPAD,
IIC_WRITE = B_DEVICE_OP_CODES_END + 200,
RESTART_SYSTEM,
SHUTDOWN_SYSTEM
@@ -127,6 +128,22 @@ typedef struct {
#define B_PEN 0x08
typedef struct {
uint16 edgeMotionWidth;
uint16 width;
uint16 areaStartX;
uint16 areaEndX;
uint16 areaStartY;
uint16 areaEndY;
uint16 minPressure;
// the value you reach when you hammer really hard on the touchpad
uint16 realMaxPressure;
uint16 maxPressure;
} touchpad_specs;
typedef struct {
uint8 buttons;
uint32 xPosition;
@@ -137,8 +154,18 @@ typedef struct {
uint8 fingerWidth;
// 1 - 4 normal width
// 5 - 11 very wide finger or palm
// 12 maximum reportable width; extrem wide contact
// 12 maximum reportable width; extreme wide contact
} touchpad_movement;
typedef struct {
bigtime_t timeout;
int32 event;
union {
touchpad_movement touchpad;
mouse_movement mouse;
} u;
} touchpad_read;
#endif // _KB_MOUSE_DRIVER_H
-38
View File
@@ -1,38 +0,0 @@
//
// kb_mouse_driver.h
//
#ifndef _TOUCHPAD_DRIVER_H
#define _TOUCHPAD_DRIVER_H
#include <SupportDefs.h>
#include <Drivers.h>
#ifdef __cplusplus
extern "C" {
#endif
#define B_ONE_FINGER 0x01
#define B_TWO_FINGER 0x02
#define B_MULTI_FINGER 0x04
#define B_PEN 0x08
typedef struct {
uint8 buttons;
uint32 xPosition;
uint32 yPosition;
uint8 zPressure;
uint8 fingers;
bool gesture;
uint8 fingerWidth;
// 1 - 4 normal width
// 5 - 11 very wide finger or palm
// 12 maximum reportable width; extrem wide contact
} touchpad_movement;
#ifdef __cplusplus
}
#endif
#endif