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>
12 #include <l4/input/libinput.h>
15 using Mag_server::Input_driver;
16 using Mag_server::Input_source;
17 using Mag_server::Core_api;
18 using Mag_server::User_state;
19 using Mag_server::Motion_fwd;
24 Emit(User_state *u) : u(u) {}
25 void operator () (L4Re::Event_buffer::Event const &e) const
26 { u->handle_event(e); }
29 class Input_driver_libinput : public Input_driver, public Input_source
32 Input_driver_libinput() : Input_driver("libinput") {}
33 void start(Core_api *core)
35 if (l4input_init(0xff, 0) == 0)
38 core->add_input_source(this);
44 if (!l4input_ispending())
48 L4Re::Event_buffer::Event _evb[N];
50 int max = l4input_flush(_evb, N);
51 //Motion_merger<10> mm;
53 mm.process/*<L4Re::Event_buffer::Event>*/(&_evb[0], _evb + max, Emit(_core->user_state()));
57 static Input_driver_libinput _libinput;