annotate input/input.h @ 4418:8141d2c399e4

A new configurable input system and joystick support for this system
author albeu
date Wed, 30 Jan 2002 12:46:03 +0000
parents
children 44c23fd75005
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
1
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
2 #ifdef HAVE_NEW_INPUT
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
3
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
4 #define MP_CMD_SEEK 0
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
5 #define MP_CMD_AUDIO_DELAY 1
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
6 #define MP_CMD_QUIT 2
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
7 #define MP_CMD_PAUSE 3
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
8 #define MP_CMD_GRAB_FRAMES 4
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
9 #define MP_CMD_PLAY_TREE_STEP 5
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
10 #define MP_CMD_PLAY_TREE_UP_STEP 6
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
11 #define MP_CMD_PLAY_ALT_SRC_STEP 7
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
12 #define MP_CMD_SUB_DELAY 8
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
13 #define MP_CMD_OSD 9
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
14 #define MP_CMD_VOLUME 10
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
15 #define MP_CMD_MIXER_USEMASTER 11
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
16 #define MP_CMD_CONTRAST 12
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
17 #define MP_CMD_BRIGHTNESS 13
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
18 #define MP_CMD_HUE 14
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
19 #define MP_CMD_SATURATION 15
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
20 #define MP_CMD_FRAMEDROPPING 16
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
21 #define MP_CMD_TV_STEP_CHANNEL 17
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
22 #define MP_CMD_TV_STEP_NORM 18
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
23 #define MP_CMD_TV_STEP_CHANNEL_LIST 19
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
24
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
25 #define MP_CMD_ARG_INT 0
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
26 #define MP_CMD_ARG_FLOAT 1
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
27 #define MP_CMD_ARG_STRING 2
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
28
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
29 #define MP_CMD_MAX_ARGS 10
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
30
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
31 #define MP_INPUT_ERROR -1
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
32 #define MP_INPUT_DEAD -2
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
33 #define MP_INPUT_NOTHING -3
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
34
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
35 typedef union mp_cmd_arg_value {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
36 int i;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
37 float f;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
38 char* s;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
39 } mp_cmd_arg_value_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
40
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
41 typedef struct mp_cmd_arg {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
42 int type;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
43 mp_cmd_arg_value_t v;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
44 } mp_cmd_arg_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
45
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
46 typedef struct mp_cmd {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
47 int id;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
48 char* name;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
49 int nargs;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
50 mp_cmd_arg_t args[MP_CMD_MAX_ARGS];
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
51 } mp_cmd_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
52
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
53
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
54 typedef struct mp_cmd_bind {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
55 int input;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
56 char* cmd;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
57 } mp_cmd_bind_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
58
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
59 typedef int (*mp_key_func_t)(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
60 typedef int (*mp_cmd_func_t)(int fd,char* dest,int size);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
61 typedef void (*mp_close_func_t)(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
62
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
63 int
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
64 mp_input_add_cmd_fd(int fd, int select, mp_cmd_func_t read_func, mp_close_func_t close_func);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
65
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
66 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
67 mp_input_rm_cmd_fd(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
68
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
69 int
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
70 mp_input_add_key_fd(int fd, int select, mp_key_func_t read_func, mp_close_func_t close_func);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
71
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
72 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
73 mp_input_rm_key_fd(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
74
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
75 mp_cmd_t*
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
76 mp_input_get_cmd(int time, int paused);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
77
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
78 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
79 mp_cmd_free(mp_cmd_t* cmd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
80
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
81 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
82 mp_input_init(void);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
83
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
84 #endif /* HAVE_NEW_INPUT */