📄 input.h
字号:
#define KEY_TV 0x179#define KEY_TV2 0x17a#define KEY_VCR 0x17b#define KEY_VCR2 0x17c#define KEY_SAT 0x17d#define KEY_SAT2 0x17e#define KEY_CD 0x17f#define KEY_TAPE 0x180#define KEY_RADIO 0x181#define KEY_TUNER 0x182#define KEY_PLAYER 0x183#define KEY_TEXT 0x184#define KEY_DVD 0x185#define KEY_AUX 0x186#define KEY_MP3 0x187#define KEY_AUDIO 0x188#define KEY_VIDEO 0x189#define KEY_DIRECTORY 0x18a#define KEY_LIST 0x18b#define KEY_MEMO 0x18c#define KEY_CALENDAR 0x18d#define KEY_RED 0x18e#define KEY_GREEN 0x18f#define KEY_YELLOW 0x190#define KEY_BLUE 0x191#define KEY_CHANNELUP 0x192#define KEY_CHANNELDOWN 0x193#define KEY_FIRST 0x194#define KEY_LAST 0x195#define KEY_AB 0x196#define KEY_NEXT 0x197#define KEY_RESTART 0x198#define KEY_SLOW 0x199#define KEY_SHUFFLE 0x19a#define KEY_BREAK 0x19b#define KEY_PREVIOUS 0x19c#define KEY_DIGITS 0x19d#define KEY_TEEN 0x19e#define KEY_TWEN 0x19f#define KEY_VIDEOPHONE 0x1a0#define KEY_GAMES 0x1a1#define KEY_ZOOMIN 0x1a2#define KEY_ZOOMOUT 0x1a3#define KEY_ZOOMRESET 0x1a4#define KEY_WORDPROCESSOR 0x1a5#define KEY_EDITOR 0x1a6#define KEY_SPREADSHEET 0x1a7#define KEY_GRAPHICSEDITOR 0x1a8#define KEY_PRESENTATION 0x1a9#define KEY_DATABASE 0x1aa#define KEY_NEWS 0x1ab#define KEY_VOICEMAIL 0x1ac#define KEY_ADDRESSBOOK 0x1ad#define KEY_MESSENGER 0x1ae#define KEY_DEL_EOL 0x1c0#define KEY_DEL_EOS 0x1c1#define KEY_INS_LINE 0x1c2#define KEY_DEL_LINE 0x1c3#define KEY_FN 0x1d0#define KEY_FN_ESC 0x1d1#define KEY_FN_F1 0x1d2#define KEY_FN_F2 0x1d3#define KEY_FN_F3 0x1d4#define KEY_FN_F4 0x1d5#define KEY_FN_F5 0x1d6#define KEY_FN_F6 0x1d7#define KEY_FN_F7 0x1d8#define KEY_FN_F8 0x1d9#define KEY_FN_F9 0x1da#define KEY_FN_F10 0x1db#define KEY_FN_F11 0x1dc#define KEY_FN_F12 0x1dd#define KEY_FN_1 0x1de#define KEY_FN_2 0x1df#define KEY_FN_D 0x1e0#define KEY_FN_E 0x1e1#define KEY_FN_F 0x1e2#define KEY_FN_S 0x1e3#define KEY_FN_B 0x1e4#define KEY_BRL_DOT1 0x1f1#define KEY_BRL_DOT2 0x1f2#define KEY_BRL_DOT3 0x1f3#define KEY_BRL_DOT4 0x1f4#define KEY_BRL_DOT5 0x1f5#define KEY_BRL_DOT6 0x1f6#define KEY_BRL_DOT7 0x1f7#define KEY_BRL_DOT8 0x1f8/* We avoid low common keys in module aliases so they don't get huge. */#define KEY_MIN_INTERESTING KEY_MUTE#define KEY_MAX 0x1ff/* * Relative axes */#define REL_X 0x00#define REL_Y 0x01#define REL_Z 0x02#define REL_RX 0x03#define REL_RY 0x04#define REL_RZ 0x05#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_TOOL_WIDTH 0x1c#define ABS_VOLUME 0x20#define ABS_MISC 0x28#define ABS_MAX 0x3f/* * Switch events */#define SW_LID 0x00 /* set = lid shut */#define SW_TABLET_MODE 0x01 /* set = tablet mode */#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */#define SW_MAX 0x0f/* * Misc events */#define MSC_SERIAL 0x00#define MSC_PULSELED 0x01#define MSC_GESTURE 0x02#define MSC_RAW 0x03#define MSC_SCAN 0x04#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_MAIL 0x09#define LED_CHARGING 0x0a#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_TONE 0x02#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_BLUETOOTH 0x05#define BUS_VIRTUAL 0x06#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_HOST 0x19#define BUS_GSC 0x1A/* * Values describing the status of a force-feedback effect */#define FF_STATUS_STOPPED 0x00#define FF_STATUS_PLAYING 0x01#define FF_STATUS_MAX 0x01/* * Structures used in ioctls to upload effects to a device * They are pieces of a bigger structure (called ff_effect) *//* * All duration values are expressed in ms. Values above 32767 ms (0x7fff) * should not be used and have unspecified results. *//** * struct ff_replay - defines scheduling of the force-feedback effect * @length: duration of the effect * @delay: delay before effect should start playing */struct ff_replay { __u16 length; __u16 delay;};/** * struct ff_trigger - defines what triggers the force-feedback effect * @button: number of the button triggering the effect * @interval: controls how soon the effect can be re-triggered */struct ff_trigger { __u16 button; __u16 interval;};/** * struct ff_envelope - generic force-feedback effect envelope * @attack_length: duration of the attack (ms) * @attack_level: level at the beginning of the attack * @fade_length: duration of fade (ms) * @fade_level: level at the end of fade * * The @attack_level and @fade_level are absolute values; when applying * envelope force-feedback core will convert to positive/negative * value based on polarity of the default level of the effect. * Valid range for the attack and fade levels is 0x0000 - 0x7fff */struct ff_envelope { __u16 attack_length; __u16 attack_level; __u16 fade_length; __u16 fade_level;};/** * struct ff_constant_effect - defines parameters of a constant force-feedback effect * @level: strength of the effect; may be negative * @envelope: envelope data */struct ff_constant_effect { __s16 level; struct ff_envelope envelope;};/** * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect * @start_level: beginning strength of the effect; may be negative * @end_level: final strength of the effect; may be negative * @envelope: envelope data */struct ff_ramp_effect { __s16 start_level; __s16 end_level; struct ff_envelope envelope;};/** * struct ff_condition_effect - defines a spring or friction force-feedback effect * @right_saturation: maximum level when joystick moved all way to the right * @left_saturation: same for the left side * @right_coeff: controls how fast the force grows when the joystick moves * to the right * @left_coeff: same for the left side * @deadband: size of the dead zone, where no force is produced * @center: position of the dead zone */struct ff_condition_effect { __u16 right_saturation; __u16 left_saturation; __s16 right_coeff; __s16 left_coeff; __u16 deadband; __s16 center;};/** * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect * @waveform: kind of the effect (wave) * @period: period of the wave (ms) * @magnitude: peak value * @offset: mean value of the wave (roughly) * @phase: 'horizontal' shift * @envelope: envelope data * @custom_len: number of samples (FF_CUSTOM only) * @custom_data: buffer of samples (FF_CUSTOM only) * * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP, * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined * for the time being as no driver supports it yet. * * Note: the data pointed by custom_data is copied by the driver. * You can therefore dispose of the memory after the upload/update. */struct ff_periodic_effect { __u16 waveform; __u16 period; __s16 magnitude; __s16 offset; __u16 phase; struct ff_envelope envelope; __u32 custom_len; __s16 *custom_data;};/** * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect * @strong_magnitude: magnitude of the heavy motor * @weak_magnitude: magnitude of the light one * * Some rumble pads have two motors of different weight. Strong_magnitude * represents the magnitude of the vibration generated by the heavy one. */struct ff_rumble_effect { __u16 strong_magnitude; __u16 weak_magnitude;};/** * struct ff_effect - defines force feedback effect * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING, * FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM) * @id: an unique id assigned to an effect * @direction: direction of the effect * @trigger: trigger conditions (struct ff_trigger) * @replay: scheduling of the effect (struct ff_replay) * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect, * ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further * defining effect parameters * * This structure is sent through ioctl from the application to the driver. * To create a new effect aplication should set its @id to -1; the kernel * will return assigned @id which can later be used to update or delete * this effect. * * Direction of the effect is encoded as follows: * 0 deg -> 0x0000 (down) * 90 deg -> 0x4000 (left) * 180 deg -> 0x8000 (up) * 270 deg -> 0xC000 (right) */struct ff_effect { __u16 type; __s16 id; __u16 direction; struct ff_trigger trigger; struct ff_replay replay; union { struct ff_constant_effect constant; struct ff_ramp_effect ramp; struct ff_periodic_effect periodic; struct ff_condition_effect condition[2]; /* One for each axis */ struct ff_rumble_effect rumble; } u;};/* * Force feedback effect types */#define FF_RUMBLE 0x50#define FF_PERIODIC 0x51#define FF_CONSTANT 0x52#define FF_SPRING 0x53#define FF_FRICTION 0x54#define FF_DAMPER 0x55#define FF_INERTIA 0x56#define FF_RAMP 0x57#define FF_EFFECT_MIN FF_RUMBLE#define FF_EFFECT_MAX FF_RAMP/* * 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#define FF_WAVEFORM_MIN FF_SQUARE#define FF_WAVEFORM_MAX FF_CUSTOM/* * Set ff device properties */#define FF_GAIN 0x60#define FF_AUTOCENTER 0x61#define FF_MAX 0x7f#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -