2010-04-14 23:19:14 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2002-2010, Haiku. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _KEYBOARD_MOUSE_DRIVER_H
|
|
|
|
#define _KEYBOARD_MOUSE_DRIVER_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2010-04-14 16:30:23 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
#include <Drivers.h>
|
|
|
|
|
2010-04-14 16:30:23 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#define KEY_Scroll 0x0f
|
|
|
|
#define KEY_Pause 0x10
|
|
|
|
#define KEY_Num 0x22
|
|
|
|
#define KEY_CapsLock 0x3b
|
|
|
|
#define KEY_ShiftL 0x4b
|
|
|
|
#define KEY_ShiftR 0x56
|
|
|
|
#define KEY_ControlL 0x5c
|
|
|
|
#define KEY_CmdL 0x5d
|
|
|
|
#define KEY_AltL 0x5d
|
|
|
|
#define KEY_CmdR 0x5f
|
|
|
|
#define KEY_AltR 0x5f
|
|
|
|
#define KEY_ControlR 0x60
|
|
|
|
#define KEY_OptL 0x66
|
|
|
|
#define KEY_WinL 0x66
|
|
|
|
#define KEY_OptR 0x67
|
|
|
|
#define KEY_WinR 0x67
|
|
|
|
#define KEY_Menu 0x68
|
|
|
|
#define KEY_NumEqual 0x6a
|
|
|
|
#define KEY_Power 0x6b
|
|
|
|
#define KEY_SysRq 0x7e
|
|
|
|
#define KEY_Break 0x7f
|
2005-01-11 03:36:41 +03:00
|
|
|
#define KEY_Spacebar 0x5e
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#define KB_DEFAULT_CONTROL_ALT_DEL_TIMEOUT 4000000
|
|
|
|
|
|
|
|
enum {
|
|
|
|
KB_READ = B_DEVICE_OP_CODES_END,
|
|
|
|
KB_GET_KEYBOARD_ID,
|
|
|
|
KB_SET_LEDS,
|
|
|
|
KB_SET_KEY_REPEATING,
|
|
|
|
KB_SET_KEY_NONREPEATING,
|
|
|
|
KB_SET_KEY_REPEAT_RATE,
|
|
|
|
KB_GET_KEY_REPEAT_RATE,
|
|
|
|
KB_SET_KEY_REPEAT_DELAY,
|
|
|
|
KB_GET_KEY_REPEAT_DELAY,
|
|
|
|
KB_SET_CONTROL_ALT_DEL_TIMEOUT,
|
2005-03-14 13:32:10 +03:00
|
|
|
KB_RESERVED_1,
|
2002-07-09 16:24:59 +04:00
|
|
|
KB_CANCEL_CONTROL_ALT_DEL,
|
|
|
|
KB_DELAY_CONTROL_ALT_DEL,
|
2010-04-14 16:30:23 +04:00
|
|
|
KB_SET_DEBUG_READER,
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
MS_READ = B_DEVICE_OP_CODES_END + 100,
|
|
|
|
MS_NUM_EVENTS,
|
2004-10-05 20:01:12 +04:00
|
|
|
MS_GET_ACCEL,
|
|
|
|
MS_SET_ACCEL,
|
|
|
|
MS_GET_TYPE,
|
|
|
|
MS_SET_TYPE,
|
|
|
|
MS_GET_MAP,
|
|
|
|
MS_SET_MAP,
|
|
|
|
MS_GET_CLICKSPEED,
|
|
|
|
MS_SET_CLICKSPEED,
|
2002-07-09 16:24:59 +04:00
|
|
|
MS_NUM_SERIAL_MICE,
|
2008-11-01 13:48:35 +03:00
|
|
|
MS_IS_TOUCHPAD,
|
|
|
|
MS_SET_TOUCHPAD_SETTINGS,
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
IIC_WRITE = B_DEVICE_OP_CODES_END + 200,
|
|
|
|
RESTART_SYSTEM,
|
|
|
|
SHUTDOWN_SYSTEM
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-03-14 13:32:10 +03:00
|
|
|
typedef struct {
|
2010-04-14 23:19:14 +04:00
|
|
|
bigtime_t timestamp;
|
|
|
|
uint32 keycode;
|
|
|
|
bool is_keydown;
|
2002-07-09 16:24:59 +04:00
|
|
|
} raw_key_info;
|
|
|
|
|
2005-03-14 13:32:10 +03:00
|
|
|
|
|
|
|
typedef struct {
|
2010-04-14 23:19:14 +04:00
|
|
|
bool num_lock;
|
|
|
|
bool caps_lock;
|
|
|
|
bool scroll_lock;
|
2002-07-09 16:24:59 +04:00
|
|
|
} led_info;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2010-04-14 23:19:14 +04:00
|
|
|
int32 cookie;
|
|
|
|
uint32 buttons;
|
|
|
|
int32 xdelta;
|
|
|
|
int32 ydelta;
|
|
|
|
int32 clicks;
|
|
|
|
int32 modifiers;
|
|
|
|
bigtime_t timestamp;
|
|
|
|
int32 wheel_ydelta;
|
|
|
|
int32 wheel_xdelta;
|
2004-09-27 02:34:57 +04:00
|
|
|
} mouse_movement;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2010-04-14 23:19:14 +04:00
|
|
|
|
2020-05-12 00:58:16 +03:00
|
|
|
#define B_TIP_SWITCH 0x01
|
|
|
|
#define B_SECONDARY_TIP_SWITCH 0x02
|
|
|
|
#define B_BARREL_SWITCH 0x04
|
|
|
|
#define B_ERASER 0x08
|
|
|
|
#define B_TABLET_PICK 0x0F
|
|
|
|
|
|
|
|
|
2005-04-21 01:53:21 +04:00
|
|
|
typedef struct {
|
2010-04-14 23:19:14 +04:00
|
|
|
uint32 buttons;
|
2020-05-12 00:58:16 +03:00
|
|
|
uint32 switches;
|
2010-04-14 23:19:14 +04:00
|
|
|
float xpos;
|
|
|
|
float ypos;
|
|
|
|
bool has_contact;
|
|
|
|
float pressure;
|
|
|
|
int32 clicks;
|
|
|
|
bigtime_t timestamp;
|
|
|
|
int32 wheel_ydelta;
|
|
|
|
int32 wheel_xdelta;
|
|
|
|
float tilt_x;
|
|
|
|
float tilt_y;
|
2005-04-21 01:53:21 +04:00
|
|
|
} tablet_movement;
|
|
|
|
|
2010-04-14 23:19:14 +04:00
|
|
|
|
2008-11-01 13:48:35 +03:00
|
|
|
#define B_ONE_FINGER 0x01
|
|
|
|
#define B_TWO_FINGER 0x02
|
|
|
|
#define B_MULTI_FINGER 0x04
|
|
|
|
#define B_PEN 0x08
|
|
|
|
|
2010-04-14 23:19:14 +04:00
|
|
|
|
|
|
|
typedef struct {
|
2008-11-01 13:48:35 +03:00
|
|
|
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;
|
|
|
|
|
2004-09-24 16:46:01 +04:00
|
|
|
|
2010-04-14 23:19:14 +04:00
|
|
|
#endif // _KB_MOUSE_DRIVER_H
|