📄 input.h.bak
字号:
#define BTN_DIGI 0x140#define BTN_TOOL_PEN 0x140#define BTN_TOOL_RUBBER 0x141#define BTN_TOOL_BRUSH 0x142#define BTN_TOOL_PENCIL 0x143#define BTN_TOOL_AIRBRUSH 0x144#define BTN_TOOL_FINGER 0x145#define BTN_TOOL_MOUSE 0x146#define BTN_TOOL_LENS 0x147#define BTN_TOUCH 0x14a#define BTN_STYLUS 0x14b#define BTN_STYLUS2 0x14c#define KEY_MAX 0x1ff/* * Relative axes */#define REL_X 0x00#define REL_Y 0x01#define REL_Z 0x02#define REL_HWHEEL 0x06#define REL_DIAL 0x07#define REL_WHEEL 0x08#define REL_MISC 0x09#define REL_MAX 0x0f/* * Absolute axes */#define ABS_X 0x00#define ABS_Y 0x01#define ABS_Z 0x02#define ABS_RX 0x03#define ABS_RY 0x04#define ABS_RZ 0x05#define ABS_THROTTLE 0x06#define ABS_RUDDER 0x07#define ABS_WHEEL 0x08#define ABS_GAS 0x09#define ABS_BRAKE 0x0a#define ABS_HAT0X 0x10#define ABS_HAT0Y 0x11#define ABS_HAT1X 0x12#define ABS_HAT1Y 0x13#define ABS_HAT2X 0x14#define ABS_HAT2Y 0x15#define ABS_HAT3X 0x16#define ABS_HAT3Y 0x17#define ABS_PRESSURE 0x18#define ABS_DISTANCE 0x19#define ABS_TILT_X 0x1a#define ABS_TILT_Y 0x1b#define ABS_MISC 0x1c#define ABS_MAX 0x1f/* * Misc events */#define MSC_SERIAL 0x00#define MSC_KEYPAD 0x01#define MSC_MAX 0x07/* * LEDs */#define LED_NUML 0x00#define LED_CAPSL 0x01#define LED_SCROLLL 0x02#define LED_COMPOSE 0x03#define LED_KANA 0x04#define LED_SLEEP 0x05#define LED_SUSPEND 0x06#define LED_MUTE 0x07#define LED_MISC 0x08#define LED_MAX 0x0f/* * Autorepeat values */#define REP_DELAY 0x00#define REP_PERIOD 0x01#define REP_MAX 0x01/* * Sounds */#define SND_CLICK 0x00#define SND_BELL 0x01#define SND_MAX 0x07/* * IDs. */#define ID_BUS 0#define ID_VENDOR 1#define ID_PRODUCT 2#define ID_VERSION 3#define BUS_PCI 0x01#define BUS_ISAPNP 0x02#define BUS_USB 0x03#define BUS_HIL 0x04#define BUS_ISA 0x10#define BUS_I8042 0x11#define BUS_XTKBD 0x12#define BUS_RS232 0x13#define BUS_GAMEPORT 0x14#define BUS_PARPORT 0x15#define BUS_AMIGA 0x16#define BUS_ADB 0x17#define BUS_I2C 0x18#define BUS_MAPLE 0x19#define BUS_ONCHIP 0x1a/* * Structures used in ioctls to upload effects to a device * The first structures are not passed directly by using ioctls. * They are sub-structures of the actually sent structure (called ff_effect) */struct ff_replay { __u16 length; /* Duration of an effect */ __u16 delay; /* Time to wait before to start playing an effect */};struct ff_trigger { __u16 button; /* Number of button triggering an effect */ __u16 interval; /* Time to wait before an effect can be re-triggered */};struct ff_shape { __u16 attack_length; /* Duration of attack */ __s16 attack_level; /* Level at beginning of attack */ __u16 fade_length; /* Duration of fade */ __s16 fade_level; /* Level at end of fade */};/* FF_CONSTANT */struct ff_constant_effect { __s16 level; /* Strength of effect */ __u16 direction; /* Direction of effect (see periodic effects) */ struct ff_shape shape;};/* FF_SPRING of FF_FRICTION */struct ff_interactive_effect {/* Axis along which effect must be created. If null, the field named direction * is used * It is a bit array (ie to enable axes X and Y, use BIT(ABS_X) | BIT(ABS_Y) */ __u16 axis; __u16 direction; __s16 right_saturation; /* Max level when joystick is on the right */ __s16 left_saturation; /* Max level when joystick in on the left */ __s16 right_coeff; /* Indicates how fast the force grows when the joystick moves to the right */ __s16 left_coeff; /* Same for left side */ __u16 deadband; /* Size of area where no force is produced */ __s16 center; /* Position of dead dead zone */};/* FF_PERIODIC */struct ff_periodic_effect { __u16 waveform; /* Kind of wave (sine, square...) */ __u16 period; __s16 magnitude; /* Peak value */ __s16 offset; /* Mean value of wave (roughly) */ __u16 phase; /* 'Horizontal' shift */ __u16 direction; /* Direction. 0 deg -> 0x0000 90 deg -> 0x4000 */ struct ff_shape shape;};/* * Structure sent through ioctl from the application to the driver */struct ff_effect { __u16 type;/* Following field denotes the unique id assigned to an effect. * It is set by the driver. */ __s16 id; struct ff_trigger trigger; struct ff_replay replay; union { struct ff_constant_effect constant; struct ff_periodic_effect periodic; struct ff_interactive_effect interactive; } u;};/* * Buttons that can trigger effects. Use for example FF_BTN(BTN_TRIGGER) to * access the bitmap. */#define FF_BTN(x) ((x) - BTN_MISC + FF_BTN_OFFSET)#define FF_BTN_OFFSET 0x00/* * Force feedback axis mappings. Use FF_ABS() to access the bitmap. */#define FF_ABS(x) ((x) + FF_ABS_OFFSET)#define FF_ABS_OFFSET 0x40/* * Force feedback effect types */#define FF_RUMBLE 0x50#define FF_PERIODIC 0x51#define FF_CONSTANT 0x52#define FF_SPRING 0x53#define FF_FRICTION 0x54/* * Force feedback periodic effect types */#define FF_SQUARE 0x58#define FF_TRIANGLE 0x59#define FF_SINE 0x5a#define FF_SAW_UP 0x5b#define FF_SAW_DOWN 0x5c#define FF_CUSTOM 0x5d/* * Set ff device properties */#define FF_GAIN 0x60#define FF_AUTOCENTER 0x61#define FF_MAX 0x7f#ifdef __KERNEL__/* * In-kernel definitions. */#include <linux/sched.h>#include <linux/devfs_fs_kernel.h>#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)#define BIT(x) (1UL<<((x)%BITS_PER_LONG))#define LONG(x) ((x)/BITS_PER_LONG)struct input_dev { void *private; int number; char *name; unsigned short idbus; unsigned short idvendor; unsigned short idproduct; unsigned short idversion; unsigned long evbit[NBITS(EV_MAX)]; unsigned long keybit[NBITS(KEY_MAX)]; unsigned long relbit[NBITS(REL_MAX)]; unsigned long absbit[NBITS(ABS_MAX)]; unsigned long mscbit[NBITS(MSC_MAX)]; unsigned long ledbit[NBITS(LED_MAX)]; unsigned long sndbit[NBITS(SND_MAX)]; unsigned long ffbit[NBITS(FF_MAX)]; int ff_effects_max; unsigned int keycodemax; unsigned int keycodesize; void *keycode; unsigned int repeat_key; struct timer_list timer; int abs[ABS_MAX + 1]; int rep[REP_MAX + 1]; unsigned long key[NBITS(KEY_MAX)]; unsigned long led[NBITS(LED_MAX)]; unsigned long snd[NBITS(SND_MAX)]; int absmax[ABS_MAX + 1]; int absmin[ABS_MAX + 1]; int absfuzz[ABS_MAX + 1]; int absflat[ABS_MAX + 1]; int (*open)(struct input_dev *dev); void (*close)(struct input_dev *dev); int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value); int (*upload_effect)(struct input_dev *dev, struct ff_effect *effect); int (*erase_effect)(struct input_dev *dev, int effect_id); struct input_handle *handle; struct input_dev *next;};struct input_handler { void *private; void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev); void (*disconnect)(struct input_handle *handle); struct file_operations *fops; int minor; struct input_handle *handle; struct input_handler *next;};struct input_handle { void *private; int open; struct input_dev *dev; struct input_handler *handler; struct input_handle *dnext; struct input_handle *hnext;};void input_register_device(struct input_dev *);void input_unregister_device(struct input_dev *);void input_register_handler(struct input_handler *);void input_unregister_handler(struct input_handler *);int input_open_device(struct input_handle *);void input_close_device(struct input_handle *);devfs_handle_t input_register_minor(char *name, int minor, int minor_base);void input_unregister_minor(devfs_handle_t handle);void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);#define input_report_key(a,b,c) input_event(a, EV_KEY, b, !!(c))#define input_report_rel(a,b,c) input_event(a, EV_REL, b, c)#define input_report_abs(a,b,c) input_event(a, EV_ABS, b, c)#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -