tiberiusbrown / Ardens

A simulator for the Arduboy FX that can be used for profiling and debugging.
https://tiberiusbrown.github.io/Ardens/
MIT License
35 stars 3 forks source link

Flexible button mapping #2

Open ace-dent opened 10 months ago

ace-dent commented 10 months ago

With different keyboard layouts and left / right-handed players, it might be nice to add custom button mapping. Perhaps at least add a toggle option to support:

Any key mapping options should be stored in a cookie, so it can be kept as the user's default and available when using the embedded player.

... I'm actually thinking of getting the 8bitdo Micro... is it possible to support controllers? 🙏🏻

tiberiusbrown commented 9 months ago

I believe all of that is possible but not simple, and I'll consider them.

As an immediate alternative, Ardens has a working RetroArch core, so for more serious Arduboy gaming, you can use RetroArch, which will support keyboard mapping, controllers, custom shaders and filters, etc. and will work on pretty much any platform. Currently you have to build the core yourself but I can add it to the build actions for each platform if you'd like, so it'd be included in releases.

Pharap commented 9 months ago

@tiberiusbrown If you do end up going down the SDL route and find you need any help or information, I may be able to assist with that since I have a reasonable amount of experience with SDL.

tiberiusbrown commented 9 months ago

Thanks -- back in the beginning of the project I did use SDL but found that it added ~1MB to the web build. I also struggled to get high DPI working correctly with it, so if I do go back I'd definitely accept any help.

tiberiusbrown commented 9 months ago

@ace-dent The latest release includes the libretro cores for each platform except web.

Pharap commented 9 months ago

I also struggled to get high DPI working correctly with it

Unfortunately all I know about high DPI is that there's a window flag called SDL_WINDOW_ALLOW_HIGHDPI that you can pass to SDL_CreateWindow as part of the flags parameter. I've never had access to a high DPI monitor so I've never actually dealt with that sort of thing.

it added ~1MB to the web build

I suppose one other possibility would be to try to extend Sokol using the parts of SDL relevant to dealing with joysticks and game controllers.

One of the issues on Sokol also mentioned this library, though given how minimalist it seems I'm not sure it'll cover many devices.

tiberiusbrown commented 8 months ago

Added a branch to experiment with using SDL as a backend. Builds here

tiberiusbrown commented 8 months ago

Basic controller support added in v0.21.0 (tested with wireless Xbox controller on Windows 10).

Not closing this issue yet because bindings are still not customizable.

tiberiusbrown commented 3 weeks ago

@ace-dent Due to Ardens being available as a libretro core, would you consider this issue obsolete? Controller support isn't really on the roadmap for the debugger/player apps atm but is well supported in libretro frontends like RetroArch.

ace-dent commented 3 weeks ago

@tiberiusbrown - feel free to close as a valid 'WONTFIX'. The controller support would have been nice, but the original issue was:

With different keyboard layouts and left / right-handed players, it might be nice to add custom button mapping.

Fair enough if that's not on the roadmap, or reasonably outside the scope. I agree, it's hard to imagine how that could be integrated nicely into the Player. Perhaps to provide minimal left/right handed support, you could add a non-persistent toggle by pressing tab (or a more hidden key combination!) to switch modes?

tiberiusbrown commented 3 weeks ago

Ah I forgot, keyboard adjustments! :+1:

That should be possible to add to the player, and I can work on adding customizable rebinds to the debugger.

For the player, maybe something less prone to accidental press than a sole tab (pretty close to the 'a' key for A button).. a shift+tab? Do you have a preference for this?

ace-dent commented 3 weeks ago

@tiberiusbrown - I like the idea of shift + tab. 👍 Not sure whether the left/ right handed key choice should be persistent between session?

tiberiusbrown commented 3 weeks ago

:+1: And I think it's reasonable to make it persistent in the player.