123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- #ifndef _INPUT_H
- #define _INPUT_H
- enum {
- INPUT_MAX_MODIFIERS = 4,
- INPUT_BUFFER_LEN = 16,
- };
- enum {
-
- INPUT_LED_SCROLL = 1 << 0,
- INPUT_LED_NUM = 1 << 1,
- INPUT_LED_CAPS = 1 << 2,
- };
- struct input_key_xlate {
-
- int left_keycode;
- int right_keycode;
- const uchar *xlate;
- int num_entries;
- };
- struct input_config {
- struct udevice *dev;
- uchar fifo[INPUT_BUFFER_LEN];
- int fifo_in, fifo_out;
-
- uchar modifiers;
- uchar flags;
- uchar leds;
- uchar leds_changed;
- uchar num_tables;
- int prev_keycodes[INPUT_BUFFER_LEN];
- int num_prev_keycodes;
- struct input_key_xlate table[INPUT_MAX_MODIFIERS];
-
- int (*read_keys)(struct input_config *config);
- bool allow_repeats;
- unsigned int next_repeat_ms;
- unsigned int repeat_delay_ms;
- unsigned int repeat_rate_ms;
- };
- struct stdio_dev;
- int input_send_keycodes(struct input_config *config, int keycode[], int count);
- int input_add_keycode(struct input_config *config, int new_keycode,
- bool release);
- int input_add_table(struct input_config *config, int left_keycode,
- int right_keycode, const uchar *xlate, int num_entries);
- int input_tstc(struct input_config *config);
- int input_getc(struct input_config *config);
- int input_stdio_register(struct stdio_dev *dev);
- void input_set_delays(struct input_config *config, int repeat_delay_ms,
- int repeat_rate_ms);
- void input_allow_repeats(struct input_config *config, bool allow_repeats);
- int input_leds_changed(struct input_config *config);
- int input_add_tables(struct input_config *config, bool german);
- int input_init(struct input_config *config, int leds);
- #ifdef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
- extern int overwrite_console(void);
- #define OVERWRITE_CONSOLE overwrite_console()
- #else
- #define OVERWRITE_CONSOLE 0
- #endif
- #endif
|