RetroDECK / RetroDECK

RetroDECK brings you an all-in-one sandboxed application to play your retro games (and even not-so-retro games) on Linux/SteamOS.
https://retrodeck.net
GNU General Public License v3.0
791 stars 36 forks source link

External Controllers - Radial Menus and hotkeys #425

Open Lazorne opened 1 year ago

Lazorne commented 1 year ago

With the launch of 0.7b we implemented part one of the CUP Project. I have heard the community wants us to look into if we can do some kind of radial system and hotkeys for big famous controllers.

Information:

Challenges:

XargonWan commented 1 year ago

We need to find out if there is a way to call the radial menu from a third party controller without the trackpad. In every controller we should find a "hotkey" button and a "radial activator" button.

NOTE: radial menu can be called with whatever button, however usually the ps/xb controllet don't have any additional buttons to be used as a hotkey, maybe we can do that via button combination?

Lazorne commented 1 year ago

We can ship smaller templates with just button bound configs without the radials. We don't have to do anything advanced with them and we can just ship them out in 0.8b and put them all under templates. Then let the users choose from the templates manually as a first version.

From the Discord:

So: Then we could port the Button bound controllers to various external later: PS3, XBOX360, Generic

Changes:

Increase Emulation Speed - D-UP Decrease Emulation Speed - D-DOWN Open Menu - Y Remove Open Menu from Select Add Select press and hold as a hotkey button and release back to normal Remove Fullscreen OFF from Y and Radials

Map A button to R5 as well

With A to R5 you could use the touchpad for Wii Games and press R5. It's quite hard to press A and the touchpad at the same time

Remove R4 and L4 and just use Select? Yay or Nay?

Rename

RetroDECK: Steam Deck 0.7b RetroDECK: PS3 0.7b

And we change the file names: RetroDECK_Cont_SteamDeck.vdi RetroDECK_Cont_PS3.vdi

Lazorne commented 1 year ago

As a first step we should at least add the hotkeys without the radial menus.

XargonWan commented 1 year ago

Given Lazorne's example controller config I have to find a common pattern and create an automation tool to generate automated controllers from neptune (Steam Deck) to the supported ones, such as xbox, ps3, switch pro. Joycons left and right need a more advanced aproach.

XargonWan commented 1 year ago

This is beng worked here: https://github.com/XargonWan/RetroDECK/tree/feat/controller-generator

XargonWan commented 1 year ago

The controller VDF file follows a pattern like this:

radial {
  // Stuff related to radial
}

something not related to radial {
  stuff {
    // Other stuff
  }
}

radial preset 1 {
  // Stuff related to radial preset 1
}

something not related to radial {
  stuff {
    // Other stuff
  }
}

something not related to radial {
  stuff {
    // Other stuff
  }
}

radial preset 2 {
  // Stuff related to radial preset 2
}

Now, here's where it gets interesting. Each item in this file is assigned an ID, but the meaning of these IDs can be a bit mysterious. You might be wondering if these IDs remain unique when you switch to a different controller type.

It appears that these IDs are generated as you create actions, essentially functioning as counters. For example:

And so on...

The first ~25 IDs (one per button minus one) are typically generated by Steam when the profile is created. After that, it's up to the user.

Let's say you create a radial button, it gets assigned ID 26. If you delete it and create another one, it becomes ID 27 because the counter never decreases. This is why you've seen IDs go up to 208.

As ID I am referring to "group" ids, then we got even "presets" id that it's a totally different counter.

So, if you're thinking about moving a radial into a new controller, you'll need a VDF parser that can manage groups and presets. You'll also need to instruct this parser on which sections to add.

Considering the complexity of the task, it's a good idea to seek the help of a skilled programmer. Unfortunately my scripting skills are not enough for the job, a proper programming language such as Python might be a more suitable.