2 * (c) 2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3 * Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
6 * This file is part of TUD:OS and distributed under the terms of the
7 * GNU General Public License 2.
8 * Please see the COPYING-GPL-2 file for details.
10 #include <l4/mag/server/input_driver>
11 #include <l4/mag/server/input_source>
13 #include <l4/input/libinput.h>
16 using Mag_server::Input_driver;
17 using Mag_server::Input_source;
18 using Mag_server::Core_api;
19 using Mag_server::User_state;
21 class Input_driver_libinput : public Input_driver, public Input_source
24 Input_driver_libinput() : Input_driver("libinput") {}
25 void start(Core_api *core)
27 if (l4input_init(0xff, 0) == 0)
30 core->add_input_source(this);
37 L4Re::Event_buffer::Event _evb[N];
38 while (l4input_ispending())
40 L4Re::Event_buffer::Event *e = _evb;
41 for (int max = l4input_flush(_evb, N); max; --max, ++e)
46 int get_stream_info(l4_umword_t stream_id, L4Re::Event_stream_info *info)
47 { return l4evdev_stream_info_for_id(stream_id, info); }
48 int get_axis_info(l4_umword_t stream_id, unsigned naxes, unsigned *axes,
49 L4Re::Event_absinfo *info)
50 { return l4evdev_absinfo(stream_id, naxes, axes, info); }
53 static Input_driver_libinput _libinput;