Commit 3b247276 authored by Jan Holthuis's avatar Jan Holthuis
Browse files

linux-dist: Add evdev keyboard support & option to disable x11 keyboard

parent a2b2b4fd
......@@ -39,6 +39,11 @@
{
controller->mapping = &controller_mapping_xbox360;
}
else if (strstr(name, "keyboard") != NULL ||
strstr(name, "Keyboard") != NULL)
{
controller->mapping = &controller_mapping_keyboard;
}
else
{
controller->mapping = &controller_mapping_generic;
......
......@@ -33,6 +33,29 @@
ABS_RZ,
};
ControllerMapping controller_mapping_keyboard = {
"Generic Keyboard",
KEY_A,
KEY_B,
KEY_C,
KEY_D,
KEY_X,
KEY_Y,
KEY_Z,
KEY_ENTER,
KEY_ESC,
KEY_LEFT,
KEY_RIGHT,
KEY_UP,
KEY_DOWN,
-1,
-1,
-1,
-1,
KEY_LEFTCTRL,
KEY_RIGHTCTRL
};
ControllerMapping controller_mapping_xbox360 = {
"XBox360 Controller",
BTN_A,
......
......@@ -35,6 +35,7 @@ struct s_evdev_controller_mapping
typedef struct s_evdev_controller_mapping ControllerMapping;
extern ControllerMapping controller_mapping_generic;
extern ControllerMapping controller_mapping_keyboard;
extern ControllerMapping controller_mapping_xbox360;
extern ControllerMapping controller_mapping_gcwz;
extern ControllerMapping controller_mapping_pandora;
\ No newline at end of file
......@@ -23,6 +23,7 @@
map<int, int> x11_keymap;
int x11_dc_buttons = 0xFFFF;
int x11_keyboard_input = 0;
int ndcid = 0;
void* x11_glc;
......@@ -51,7 +52,7 @@ void* x11_glc;
#endif
void input_x11_handle() {
if (x11_win)
if (x11_win && x11_keyboard_input)
{
//Handle X11
XEvent e;
......@@ -108,6 +109,8 @@ void input_x11_init()
*/
x11_keymap[36] = DC_BTN_START;
x11_keyboard_input = cfgLoadInt("input", "enable_x11_keyboard", 1);
}
void x11_window_create()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment