blob: 8212e6378ca45feb2920a549081f37d6404c6a20 [file] [log] [blame]
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -07001/*
2 * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#ifndef INPUT_H
8#define INPUT_H
9
10#include <linux/input.h>
David Sodman8ef20062015-01-06 09:23:40 -080011
David Sodmanbf3f2842014-11-12 08:26:58 -080012#include "term.h"
13#include "video.h"
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -070014
15struct input_key_event {
16 uint16_t code;
17 unsigned char value;
18};
19
20int input_init();
David Sodmanbf3f2842014-11-12 08:26:58 -080021int input_run(bool standalone);
22void input_set_terminal(terminal_t*);
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -070023void input_close();
Stéphane Marchesin00ff1872015-12-14 13:40:09 -080024int input_setfds(fd_set* read_set, fd_set* exception_set);
25struct input_key_event* input_get_event(fd_set* read_fds, fd_set* exception_set);
26void input_put_event(struct input_key_event* event);
David Sodman8ef20062015-01-06 09:23:40 -080027terminal_t* input_create_term(int vt);
Stéphane Marchesine38b8e72016-01-07 19:20:28 -080028terminal_t* input_get_current_term();
David Sodman8ef20062015-01-06 09:23:40 -080029void input_set_current(terminal_t* terminal);
David Sodmanf0a925a2015-05-04 11:19:19 -070030int input_process(terminal_t* terminal, uint32_t delay);
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -070031
32#endif