diff --git a/engine/client/menu.c b/engine/client/menu.c index 486c3589b..ccf7ac745 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -1032,7 +1032,7 @@ void M_UnbindCommand (const char *command) l = strlen(command); - for (j=0 ; j<256 ; j++) + for (j=0 ; j= 0 && axis < countof(standardmapping)) + { + pos = standardmapping[axis].poskey; + neg = standardmapping[axis].negkey; + qaxis = standardmapping[axis].axis; + } + else + qaxis = axis; } else return; //random mappings? erk? - if (joydevid < countof(gamepaddeviceids)) + if (joydevid < countof(gamepaddevices)) { - joydevid = gamepaddeviceids[joydevid]; - if (joydevid == DEVID_UNSET) + qdevid = gamepaddevices[joydevid].id; + if (qdevid == DEVID_UNSET) + { + if (value < -0.9 || value > 0.9) + gamepaddevices[joydevid].id = J_AllocateDevID(); return; //don't send axis events until its enabled. + } + + if (value > 0.5 && pos) + { + if (!(gamepaddevices[joydevid].axistobuttonp & (1u<