QoLBar icon indicating copy to clipboard operation
QoLBar copied to clipboard

[Feature Request] Add gamepad/controller support for navigating QoLBar HUD elements

Open ryankhart opened this issue 2 years ago • 7 comments

I assume that this isn't a high priority for anyone currently using or contributing to QoLBar development, but I've recently got into FFXIV plugin development and would be willing to submit pull requests for optional gamepad support if that is welcome here. Originally, I was just going to try and develop my own plugin, but more and more, I can't help but feel like I'd be reinventing the wheel when this plugin already does so much right for mouse users.

The reason I want gamepad support is because, while the stock game's cross-hotbar does provide plenty of space across all 8 cross-hotbars, I'm not a fan of manually choosing cross-hotbars using the gamepad, so I usually just stick with the 3 cross-hotbars I have access to using gamepad trigger modifiers.

I would want to place a macro that triggers a QoLBar HUD element to pop up and have that grid of icons be navigatable using the gamepad d-pad.

ryankhart avatar Apr 14 '22 22:04 ryankhart

I think it might just be a simple focus issue. I believe someone had a workaround at some point where they simulated a mouse click on the bar and then it would allow them to navigate it (or at least on categories).

Unfortunately, the code is awful and I've been slowly trying to rewrite it all, but, if you would like to try adding support, I would be open to a PR. I did have some plans to add controller support to pies at least (since it should be simple enough), but it is rather far back on my todo list.

UnknownX7 avatar Apr 16 '22 00:04 UnknownX7

That's understandable. If I work on it, I'll probably try to pinpoint the most difficult issue and try to see if the whole idea is feasible first before I dig myself into a whole picking all the low-hanging fruit developing the easier stuff.

ryankhart avatar Apr 16 '22 00:04 ryankhart

The way that I'd envision the workflow for how gamepad menu navigation could work is to allow the user to set a slash command for a particular QoLBar bar, the user makes a one-line macro with that new slash command and put that macro on their cross-hotbar. Then, when they use the gamepad to run the macro, QoLBar expands the appropriate bar and captures all d-pad and face button controls without game passthrough until the user presses the East button (B or Circle) to back out of the QoLBar menu and collapse it, returning full control to the game again.

I haven't looked at the code much yet, but I do notice from the user's perspective that there are mouse hover effects over the buttons for changing the visual state of the background of each button. I don't know if that is all handed further upstream in Imgui or something, but maybe we could leverage that functionality to indicate to the gamepad user which menu item is currently being selected, and if they press South (A for Xbox or X for PS), it'll run that command.

Anyway, this is mainly just me making notes to myself if I end up working with the code to try to implement this myself.

ryankhart avatar Apr 22 '22 11:04 ryankhart

This is hopeful. I just realized that the actual menu navigation part of controller support is already implemented in all Dalamud UI elements. The user just needs to enable "Control plugins via gamepad" option in the Dalamud Settings -> Look & Feel tab.

Then, on controller, press L1+L3 to enable gamepad navigation.

Hold the West button (square for PS, X for Xbox) and navigate to the Dalamud window to control, then release the West button.

Voila! Controller support!

Animation


There are still just a few issues to work out though. The QoLBar element has to be set to "Always Visible" or else it won't show up when the user holds the West button on controller. Solution: Allow the user the option to set a custom command for each QoLBar element. Then, they can create a macro that includes that command and place it on their XHB. But let's not put the cart before the carriage just yet. Implementing this doesn't feel like it serves a real need until other features have been implemented first.

Next, since it can be a bit cumbersome to have to trigger a macro, then press L1+L3, then hold/long press the West button, just to be able to navigate a QoLBar menu, perhaps there is some way that there could be an option (disabled by default) for custom commands to also hook into Dalamud's built in gamepad/controller support and enable it and switch to the appropriate Dalamud window. A problem with this idea is that gamepad/controller mode is a Dalamud feature, not a QoLBar feature, so providing a convenient way into the mode is fine, in theory, but providing a convenient way out of it seems out of the scope of what any individual plugin should modify. Maybe I should create a feature request issue for Dalamud to add an option to back out of L1+L3 mode by simply pressing the East button on the controller if no Dalamud window is currently in focus.

ryankhart avatar Apr 27 '22 11:04 ryankhart

I would like controller support for pie menus as this would fix a lot of things for me. While I do have a KB/M, it would be nice to change classes on the fly while I am in controller mode, without having to assign a bunch of macros or hotkeys to my crossbar.

For now I have found a work around by using LB + R3. Like @ryankhart mentioned you can also use LB + L3 to use Dalamud's controller support but I found it tedious. So using the game's virtual mouse mode (LB + R3) I found it easier to use that.

Osmone avatar Jun 07 '22 03:06 Osmone

I am working on controller support for pie menus, but there are currently some issues due to Dalamud limitations. I've done similar work on TPie and mostly agree with his assessment that my current implementation is not feature compete. For what it's worth, I've created a pull request of the work I've completed.

I have been using a local build of it in game to great effect by having my primary ring be set to L1+L3, which Dalamud internally uses to turn on and off controller input to the game(I wish they let plugins use that functionality, but they do not currently)

TomNCatz avatar Nov 11 '22 01:11 TomNCatz

Oh, this also works for hotkeys, I forgot to mention that since I don't really use that feature yet. It will be more useful once I figure out input blocking.

TomNCatz avatar Nov 11 '22 01:11 TomNCatz