From 5ca44cb4aed142e46eb5a55838ec01068e631a85 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 6 Jul 2018 22:19:01 +0100 Subject: [PATCH] input: add user space include file --- Library/include/sys/input.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Library/include/sys/input.h diff --git a/Library/include/sys/input.h b/Library/include/sys/input.h new file mode 100644 index 00000000..b7f1f637 --- /dev/null +++ b/Library/include/sys/input.h @@ -0,0 +1,36 @@ +#ifndef _SYS_INPUT_H +#define _SYS_INPUT_H + +/* Low four bits indicate device number usually */ + +#define MOUSE_REL 0x00 /* 8bit deltas - may need 16 ? */ +#define MOUSE_ABS 0x10 /* 16bit x 16bit virtual coords */ +#define STICK_DIGITAL 0x20 /* UDLR + buttons byte */ +#define STICK_DIGITAL_U 0x80 +#define STICK_DIGITAL_D 0x40 +#define STICK_DIGITAL_L 0x20 +#define STICK_DIGITAL_R 0x10 +#define STICK_ANALOG 0x30 /* 16bit signed X / Y, sign */ + +/* No device number - but 3 bits reserved if needed */ +#define KEYPRESS_CODE 0x40 /* Followed by keycode byte. Number + bits show u/d and modifiers */ +#define KEYPRESS_DOWN 0x00 +#define KEYPRESS_UP 0x01 +#define KEYPRESS_SHIFT 0x02 +#define KEYPRESS_CTRL 0x04 +#define kEYPRESS_ALT 0x08 + +#define LIGHTPEN_ABS 0x50 /* Light pen or similar, 16 x 16bit virtual coords */ + +#define BUTTON(x) (1 << (x)) /* Button 1-7 (top bit never used) */ +#define BUTTONS(x) ((x)&0x07) /* 0-7 buttons */ + + +#define INPUT_GRABKB 0x0520 +#define INPUT_GRAB_NONE 0 /* No grab */ +#define INPUT_GRAB_META 1 /* Special keys only */ +#define INPUT_GRAB_TYPED 2 /* Typed input */ +#define INPUT_GRAB_ALL 3 /* Up and down events */ + +#endif \ No newline at end of file -- 2.34.1