1 /*****************************************************************************/
3 * \file input/include/libinput.h
4 * \brief Input event library (L4INPUT) API
7 * \author Christian Helmuth <ch12@os.inf.tu-dresden.de>
8 * \author Frank Mehnert <fm3@os.inf.tu-dresden.de>
11 /* (c) 2003 Technische Universitaet Dresden
12 * This file is part of DROPS, which is distributed under the terms of the
13 * GNU General Public License 2.
14 * Please see the COPYING-GPL-2 file for details.
16 * Original copyright notice from include/linux/input.h follows...
19 * Copyright (c) 1999-2002 Vojtech Pavlik
21 * This program is free software; you can redistribute it and/or modify it
22 * under the terms of the GNU General Public License version 2 as published by
23 * the Free Software Foundation.
26 #ifndef __INPUT_INCLUDE_LIBINPUT_H_
27 #define __INPUT_INCLUDE_LIBINPUT_H_
29 #include <l4/sys/compiler.h>
30 #include <l4/input/macros.h>
31 #include <l4/re/event.h>
36 long long time; ///< unused on bare hardware, used in Fiasco-UX
40 unsigned long stream_id;
43 /** Initialize input driver library.
45 * \param prio if != L4THREAD_DEFAULT_PRIO use as prio for irq threads
46 * \param handler if !NULL use this function on event occurence as
49 * libinput works in 2 different modes:
51 * -# input events are stored in library local ring buffers until
52 * l4input_flush() is called.
54 * -# on each event occurrence \a handler is called and no local event
57 L4_CV int l4input_init(int prio, L4_CV void (*handler)(struct l4input *));
59 /** Query event status.
61 * \return 0 if there are no pending events; !0 otherwise
63 L4_CV int l4input_ispending(void);
67 * \param buffer event return buffer
68 * \param count max number of events to return
70 * \return number of flushed events
72 * Returns up to \a count events into buffer.
74 L4_CV int l4input_flush(void *buffer, int count);
76 /** Program PC speaker
78 * \param tone tone value (0 switches off)
80 L4_CV int l4input_pcspkr(int tone);
82 L4_CV int l4evdev_stream_info_for_id(l4_umword_t id, l4re_event_stream_info_t *si);
83 L4_CV int l4evdev_absinfo(l4_umword_t id, unsigned naxes, const unsigned *axes, l4re_event_absinfo_t *infos);