(udev_input.c) Cleanups

This commit is contained in:
twinaphex 2015-06-03 17:11:32 +02:00
parent 1532f35376
commit 17ca5a074c

View File

@ -13,14 +13,9 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "../input_common.h"
#include "../input_joypad.h"
#include "../input_keymaps.h"
#include "../../general.h"
#include <file/file_path.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <sys/types.h>
@ -35,16 +30,23 @@
#include <termios.h>
#include <signal.h>
#include <file/file_path.h>
#include "../input_joypad.h"
#include "../input_keymaps.h"
#include "../../general.h"
#ifdef HAVE_CONFIG_H
#include "../../config.h"
#endif
/* Need libxkbcommon to translate raw evdev events to characters
* which can be passed to keyboard callback in a sensible way. */
#ifdef HAVE_XKBCOMMON
/* We need libxkbcommon to translate raw evdev events to characters
* which can be passed to keyboard callback in a sensible way. */
#include <xkbcommon/xkbcommon.h>
#define MOD_MAP_SIZE 5
#endif
typedef struct udev_input udev_input_t;
@ -145,7 +147,6 @@ static void udev_handle_touchpad(udev_input_t *udev,
int range = dev->state.touchpad.info_x.maximum -
dev->state.touchpad.info_x.minimum;
float x_norm = (float)x / range;
float rel_x = x_norm - dev->state.touchpad.x;
if (dev->state.touchpad.touch)
@ -164,7 +165,6 @@ static void udev_handle_touchpad(udev_input_t *udev,
int range = dev->state.touchpad.info_y.maximum -
dev->state.touchpad.info_y.minimum;
float y_norm = (float)y / range;
float rel_y = y_norm - dev->state.touchpad.y;
if (dev->state.touchpad.touch)
@ -272,8 +272,8 @@ static bool add_device(udev_input_t *udev,
const char *devnode, device_handle_cb cb)
{
int fd;
struct stat st;
struct input_device **tmp;
struct stat st = {0};
struct input_device *device = NULL;
struct epoll_event event = {0};