5e596efecf
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 <waddlesplash@gmail.com>
75 lines
1.8 KiB
C++
75 lines
1.8 KiB
C++
/*
|
|
* Copyright 2008, Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _INPUTSERVERDEVICE_H
|
|
#define _INPUTSERVERDEVICE_H
|
|
|
|
|
|
#include <Input.h>
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
// Register your actual devices using this one - you can subclass
|
|
// this to suit your needs
|
|
struct input_device_ref {
|
|
char* name;
|
|
input_device_type type; // see Input.h
|
|
void* cookie;
|
|
};
|
|
|
|
// BInputServerDevice::Control() codes
|
|
enum {
|
|
// B_KEYBOARD_DEVICE notifications
|
|
B_KEY_MAP_CHANGED = 1,
|
|
B_KEY_LOCKS_CHANGED,
|
|
B_KEY_REPEAT_DELAY_CHANGED,
|
|
B_KEY_REPEAT_RATE_CHANGED,
|
|
|
|
// B_POINTING_DEVICE notifications
|
|
B_MOUSE_TYPE_CHANGED,
|
|
B_MOUSE_MAP_CHANGED,
|
|
B_MOUSE_SPEED_CHANGED,
|
|
B_CLICK_SPEED_CHANGED,
|
|
B_MOUSE_ACCELERATION_CHANGED,
|
|
B_SET_TOUCHPAD_SETTINGS,
|
|
};
|
|
|
|
namespace BPrivate {
|
|
class DeviceAddOn;
|
|
}
|
|
|
|
class BInputServerDevice {
|
|
public:
|
|
BInputServerDevice();
|
|
virtual ~BInputServerDevice();
|
|
|
|
virtual status_t InitCheck();
|
|
virtual status_t SystemShuttingDown();
|
|
|
|
virtual status_t Start(const char* device, void* cookie);
|
|
virtual status_t Stop(const char* device, void* cookie);
|
|
virtual status_t Control(const char* device, void* cookie, uint32 code,
|
|
BMessage* message);
|
|
|
|
status_t RegisterDevices(input_device_ref** devices);
|
|
status_t UnregisterDevices(input_device_ref** devices);
|
|
|
|
status_t EnqueueMessage(BMessage* message);
|
|
|
|
status_t StartMonitoringDevice(const char* device);
|
|
status_t StopMonitoringDevice(const char* device);
|
|
status_t AddDevices(const char* path);
|
|
|
|
private:
|
|
virtual void _ReservedInputServerDevice1();
|
|
virtual void _ReservedInputServerDevice2();
|
|
virtual void _ReservedInputServerDevice3();
|
|
virtual void _ReservedInputServerDevice4();
|
|
|
|
BPrivate::DeviceAddOn* fOwner;
|
|
uint32 _reserved[4];
|
|
};
|
|
|
|
#endif // _INPUTSERVERDEVICE_H
|