Add more dummy events to make not only the kernel, but also SDL happy (not a great fix, as some games might get confused)
This commit is contained in:
parent
aaa39f00c9
commit
3b6f0d8185
1 changed files with 14 additions and 11 deletions
|
@ -199,18 +199,21 @@ LinuxUinput::finish()
|
|||
break;
|
||||
|
||||
case kJoystickDevice:
|
||||
if (!key_lst[BTN_JOYSTICK] &&
|
||||
!key_lst[BTN_GAMEPAD] &&
|
||||
!key_lst[BTN_TRIGGER_HAPPY] &&
|
||||
|
||||
!abs_lst[ABS_THROTTLE] &&
|
||||
!abs_lst[ABS_WHEEL] &&
|
||||
!abs_lst[ABS_X])
|
||||
// FIXME: the kernel and SDL have different rules for joystick
|
||||
// detection, so this is more a hack then a proper solution
|
||||
if (!key_lst[BTN_A])
|
||||
{
|
||||
// using BTN_TRIGGER_HAPPY instead of more common BTN_JOYSTICK
|
||||
// as it should end up as last joystick button instead of
|
||||
// first
|
||||
add_key(BTN_TRIGGER_HAPPY);
|
||||
add_key(BTN_A);
|
||||
}
|
||||
|
||||
if (!abs_lst[ABS_X])
|
||||
{
|
||||
add_abs(ABS_X, -1, 1, 0, 0);
|
||||
}
|
||||
|
||||
if (!abs_lst[ABS_Y])
|
||||
{
|
||||
add_abs(ABS_Y, -1, 1, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue