00001 /****************************************************************************** 00002 * This file is part of the Gluon Development Platform 00003 * Copyright (C) 2008 Sacha Schutz <istdasklar@free.fr> 00004 * Copyright (C) 2010 Kim Jung Nissen <jungnissen@gmail.com> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 #ifndef GLUONDEVICES_H 00021 #define GLUONDEVICES_H 00022 00023 #include <QtCore/QFlags> 00024 #include <QtCore/QEvent> 00025 00026 #include <linux/input.h> 00027 00028 namespace GluonInput 00029 { 00030 enum DeviceFlag 00031 { 00032 UnknownDevice = 0, 00033 KeyboardDevice = 1, 00034 MouseDevice = 1 << 1, 00035 JoystickDevice = 1 << 2, 00036 TouchDevice = 1 << 3, 00037 TouchpadDevice = 1 << 4 00038 }; 00039 Q_DECLARE_FLAGS( Devices, DeviceFlag ) 00040 00041 enum InputTypeFlag 00042 { 00043 Button = QEvent::Type( QEvent::User + EV_KEY ), 00044 RelativeAxis = QEvent::Type( QEvent::User + EV_REL ), 00045 AbsoluteAxis = QEvent::Type( QEvent::User + EV_ABS ) 00046 }; 00047 }; 00048 00049 Q_DECLARE_OPERATORS_FOR_FLAGS( GluonInput::Devices ); 00050 00051 #endif