AlisterT / openjazz

OpenJazz
GNU General Public License v2.0
275 stars 49 forks source link

Impossible to map joystick #85

Open laxdragon opened 2 years ago

laxdragon commented 2 years ago

Windows 10: Mapping joystick axis and buttons are too fast. If I hit up on my Xbox One joystick it maps more than one to the same axis. Either slow this down, or make it so it does not map each input until you hit enter on it.

fabiangreffrath commented 2 years ago

Doom source ports usually only acept joystick events that are a certain amount of miliseconds apart, e.g.

https://github.com/chocolate-doom/chocolate-doom/blob/9546b2f0392a606bb6220671741525ba40480685/src/i_video.c#L488

and

https://github.com/chocolate-doom/chocolate-doom/blob/9546b2f0392a606bb6220671741525ba40480685/src/doom/m_menu.c#L1407

Here, I_GetTime() returns time in steps of GAMETIC, i.e. 35 fps:

https://github.com/chocolate-doom/chocolate-doom/blob/9546b2f0392a606bb6220671741525ba40480685/src/i_timer.c#L31

alternistom commented 1 year ago

Any solution for this? Would love to use my Xbox controller, but I have this very same issue. Any way we could store the settings in a cfg file or something that could be edited via Notepad?

Willlux commented 1 year ago

Please?

fabiangreffrath commented 1 year ago

Can't reproduce this with a gamepad. 🤷

fabiangreffrath commented 1 year ago

I guess the joystick on a XBox One controller is detected as a "hat", whereas my gamepad is detected as "axis". That's where the problem might reside.