djhackersdev / segatools

Loaders and hardware emulators for SEGA games that run on the Nu and ALLS platforms
The Unlicense
60 stars 7 forks source link

[Proposal]Add joystick input support for maimai #25

Open icex2 opened 1 year ago

icex2 commented 1 year ago

In GitLab by @MikiraSora on Oct 29, 2022, 18:16

Issue Summary


It is well known that segatools does not support joystick and has been using GetAsyncKeyState() in the mai2 module to get global keyboard input, which means that other devices will be forced to use as Keyboard device and send keyboard input to the segatools, which will affect input handlers for other applications as well.

Proposal


So I want segatools to support joystick input and apply it to mai2.

Some F&Q:


Q: Currently what problems?
A: For some games (e.g. mai2 and mu3), segatools only listens on global keyboard input , but these input will be handled by other programs.

Q: How can we solve the problem?
A: In my opinion, segatools should implements a new input listener for a specified device

Q: Is there a implementation? What are the advantages?
A: Implement input listener for joystick through RawInput. Not only it can read the input when the game/segatools window are not in focus, but also segatools handle joystick input for the specified VID/PID joystick device through the raw input API.

Q: Is there a possible problem with this implementation?
A:

Q: Had you implemented? where is your code?
A: I had implemented them and it's usable, you could pull my forked repo and check config in dist/mai2/segatools.ini. WARNING : my work is done but git commits maybe break changes (e.g. rebase/combine/amend) before I actually post MR.

At End


Parts of content is translated by Google Translate, I am not good at English :slight_smile: