schellingb / dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
GNU General Public License v2.0
731 stars 61 forks source link

Mouse Mapper? And Gamepad Mapper "on hold" option #477

Open PoloniumRain opened 4 months ago

PoloniumRain commented 4 months ago

Would it be possible to add a "Mouse Mapper"? Where any key can be mapped to the mouse buttons. Preferably with support for mice with tons of buttons, like my Razer Naga V2 Pro which has 12 side buttons. It would take DBP to another level (for me anyway). But i'd still be happy if only the left/middle/right buttons could be remapped to any key.

And i love the Gamepad Mapper but many games have too many keys to be mapped to a standard gamepad and i don't know of any way to get around this (without 3rd party software, which is a pain).

So could you add an option that allows a button to be held down, which then enables secondary functions for all the exiting buttons? For example, pressing A would be the "use" key in a game, but holding down R2 and pressing A will then select a specific weapon.

I know it's possible to map multiple inputs to a single button with the 'Additional Binding' feature, but this isn't what is needed in most cases. I hope these features are possible and aren't yet another RA limitation...

schellingb commented 4 months ago

You can map mouse buttons to RetroPad buttons in RetroArch. With that in mind, adding a secondary mapper for just the mouse might be a bit too much. Also a Libretro core can only access the first 5 mouse buttons so even with a full new mapper interface for the mouse it wouldn't be able to support a mouse with 12 side buttons.

An action wheel (sometimes called "weapon wheel" in first person shooters) is planned for the next version but I can't say when that will be finished just yet. Each controller port can define a list of actions which can then be brought up by holding down a button, then an action can be selected via the analog stick or dpad or mouse movement. It should be very useful :-)

PoloniumRain commented 4 months ago

Liking the sound of that action wheel! Hope it's not too far away ;)

I didn't know that about RetroPad, but i much prefer using your Gamepad Mapper, it's far better, and more convenient having everything in one place. Maybe you could just add those 5 mouse buttons somewhere in the existing Gamepad Mapper? Even just the right and middle mouse buttons would be nice!

PoloniumRain commented 4 months ago

I've been thinking you could simply add a mouse butting remapping option to Core Options > Input, and underneath 'Bind Mouse Wheel to Key' you could also have 'Bind Mouse Buttons'. It can then allow any key to be bind to the first 5 mouse buttons.

schellingb commented 1 month ago

Here's the new action wheel that was added in 1c7ad4f image

PoloniumRain commented 1 month ago

Here's the new action wheel that was added in 1c7ad4f image

Just tried it out for a couple of hours and love it! :D It works well overall but i encountered some issues:

  1. When selecting a weapon the text flashes yellow and the wheel remains on screen while this happens. It's only for one second or less but during this time period you have no control in the game. In something like Doom or Quake it causes me to take damage while i'm standing still. Could you make it so that when a weapon is selected the wheel immediately disappears so you can immediately gain control? But the selected weapon text could remain on-screen for a second and then disappear (or fade out would look nice).

  2. At high resolutions like 1600x1200 the wheel font is small. Could it scale with res? I think the font is a great size at 800x600 so if it could remain roughly that size at higher resolutions that would look great.

  3. Would it be possible to rename wheel options? Often an input doesn't have a defined name like "Shotgun" or "Inventory" so it can just be the letter V or something like that. When there's lots of these single characters on the wheel it can get a bit confusing. Or alternative you could let the user select a colour for each section of the wheel. That might be even quicker to use because you could quickly glance over at the colour instead of having to read anything.

schellingb commented 1 month ago

Thank you for trying it out and writing this fantastic feedback! 1) We need for sure, I'll look into that first. 2) I'll see what can be done, it's just the DOS text font (same as the start menu and gamepad mapper) but maybe we can double it at very high resolutions 3) Might be difficult, though I agree it would be very nice. Maybe in a future version :-)

PoloniumRain commented 1 month ago

I've played with the wheel more and found that multiple inputs interfere with the wheel controls (no idea how i missed this before!). So for example, when moving forwards in Quake by holding the left analog stick up, if you then try to use the right stick to select a weapon on the wheel, it wont select the weapon you'd like and will instead select the top weapon because the left stick is already being held upwards. Right stick input wont work correctly until you let go of the left stick. Mouse input also has the same issue while either stick is held down.

So i think by default the wheel should only use right stick input being as that's the standard in modern games, and then in Options > Input there could be a setting to change this to left stick or mouse input.

This is such a cool feature btw it has so much potential :)

schellingb commented 1 month ago

Thanks for the additional testing and again for the great feedback!

The wheel uses either left stick, right stick or d-pad depending on which one is pressed the most, so you can try moving a stick half-way and the other stick all the way it should use the stick that is tilted all the way. Though you're probably right that an option would be better for selecting which stick. Do you think mouse or d-pad needs to be an option? There's plenty of input methods that don't have analog sticks, so I feel like always reacting to d-pad should be fine so users with such controllers (or touch input configurations) don't need to change the settings. Mouse is somewhat similar, I think it can always be on, the only real case where it makes sense to use the "mouse" would be on a touch screen device where touching the game view is treated as mouse inputs. Otherwise a user probably won't use a controller together with a mouse.

So maybe we just have 3 choices? "Right Stick (default)", "Left Stick", "Both Sticks". Then with the default the left stick can still control the game while the right stick operates the action wheel.

PoloniumRain commented 1 month ago

so I feel like always reacting to d-pad should be fine

Hmm this may work out... One of the few examples where it can be a problem would be if someone used the D-pad for movement in a Doom-like game and used the right stick for wheel operation. The D-pad would always override any right stick inputs because you can't ease off the D-pad like you can with a analog stick. I suppose you could have an on/off toggle option like "Always Use D-pad For Wheel Operation" and have it set to 'on' by default.

Otherwise a user probably won't use a controller together with a mouse.

Lol i actually use this setup when gaming on my TV because my keyboard cable isn't long enough. So in FPS games i'll use the left stick for movement and a wireless mouse for everything else. It works very well though. So maybe have:

Right Stick (default) Left Stick Both Sticks Mouse Only

schellingb commented 1 month ago

Added the core option to define which inputs (left stick, right stick, d-pad, mouse) control the action wheel. And as you said, right out of the gate, it now feels much better with the left stick not affecting the wheel! :-)

PoloniumRain commented 1 month ago

Been playing with it and yeah it's way better now! I'll definitely being using this a lot :)

Controllers work extremely well, it feels great, but mouse input doesn't work while the wheel is fading out. So it still has a delay before you can gain control, but only with the mouse.

One minor thing is that some times it's hard to see the direction on the wheel when selecting a weapon very quickly. So i end up selecting the wrong weapon because the wheel might appear for just a split second while i'm changing weapons as quickly as possible. If it had a clear directional indication it would help a lot.

So instead of this:

Wheel

Maybe have something like this:

WheelColoured