From 51498c3469573203bb81db6e44a3e571cc8995a5 Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Sat, 9 Feb 2013 13:31:58 +0100 Subject: [PATCH] Add mouse -> keyboard mapping example. --- confs/key.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 confs/key.h diff --git a/confs/key.h b/confs/key.h new file mode 100644 index 0000000..04b259b --- /dev/null +++ b/confs/key.h @@ -0,0 +1,47 @@ +#include "config_functions.h" + +#ifndef H_GLOBAL_MAP +#define H_GLOBAL_MAP + +/* Set up amount of joysticks here */ +#define JOYCOUNT 1 + +/* Set up event to read from */ +#define INPUT_PATH "/dev/input/event9" + +#endif + +/* -------------------------------------------------------------------------- */ +/* ----------------------------- SECOND SECTION ----------------------------- */ +/* -------------------------------------------------------------------------- */ + +#ifdef H_CONFIGURE_JOYSTICKS +#ifndef H_CONFIGURE_JOYSTICKS_SEEN +#define H_CONFIGURE_JOYSTICKS_SEEN + +/* Configure first joystick. + * + * Here we just tell the program what keys event we will expose and what + * keys we want to use. + * + * If a key is not enabled here, it will never be passed. + */ + +/* Keyboard */ +JOYSTICK_SET_OPT(EV_KEY, UI_SET_EVBIT, 0) +JOYSTICK_ADD_KEY(KEY_A, UI_SET_KEYBIT, 0) +#endif +#endif + +/* -------------------------------------------------------------------------- */ +/* ----------------------------- THIRD SECTION ----------------------------- */ +/* -------------------------------------------------------------------------- */ + +#ifdef H_JOYMAP +#ifndef H_JOYMAP_SEEN +#define H_JOYMAP_SEEN + +KEYMAP(EV_KEY, BTN_LEFT, KEY_A, EV_KEY, 0, +) + +#endif +#endif