Going back to Kodi's menu with the gamepad while playing a game?

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Ferk Offline
Junior Member
Posts: 16
Joined: Nov 2014
Reputation: 0
Question  Going back to Kodi's menu with the gamepad while playing a game?
Post: #1
I'm using LibreELEC nightly with nothing but a bluetooth gamepad to control my Kodi box

In Retroarch/Lakka, while I'm playing I can press a particular combination of buttons to go back to the Retroarch interface.
Like for example Start+Select or L3+R3.

How can I switch from playing a game in Retroplayer back to the Kodi controls/interface while using my gamepad?
I couldn't find an option, and it doesn't look like changing joystick.xml would allow me to define a button combination for it.

Other than this detail, the experience is already quite nice in Kodi 18 nightlies.
I miss a "Recently played" list in the Games section of Estuary but I understand that this is still very early for Kodi 18 and only recently was Retroplayer merged.
(This post was last modified: 2017-03-11 01:08 by Ferk.)
find quote
Steveb Offline
Fan
Posts: 437
Joined: Oct 2009
Reputation: 19
Location: Sagittarius A*
Post: #2
I don't think button combinations are possible at the moment, but I think I read at least long press is on the cards for the future development.
You could make a custom joystick.xml and place it in userdata/keymaps folder.
Something like this..
PHP Code:
<keymap>
  <
FullscreenGame>
    <
joystick>
      <
leftthumb>Stop</leftthumb>
    </
joystick>
  </
FullscreenGame>
</
keymap
Obviously is up to you which button/action you use, most retro games would never use the thumb stick button. Wink
find quote
garbear Offline
Team-Kodi Developer
Posts: 1,695
Joined: Dec 2010
Reputation: 109
Location: city of angels
Post: #3
See the article HOW-TO:Modify joystick.xml at the Game controllers wiki page. @Steveb is right, you can modify the <FullscreenGame> section to choose actions during gameplay. Currently these actions are all set to noop (no-operation) so that Kodi doesn't interfere with gameplay. Simply change a noop to the action you want. Note that if a game uses that button (e.g. PS games use all buttons except for Guide), then the button will be sent to the game instead of Kodi.

Button combos and button holding are planned features for v18. If you'd like it help out, it would be immensely useful if you could link to any combos that other emulator systems use. I'd rather adopt an existing schema than reinvent the wheel.

BTC: 1JtXwJdGdE9YnYgThWBT2StFCU5sEYkbVD (personal), https://kodi.tv/contribute/donate-bitcoin (foundation). Donations in the form of controllers, especially ones that don't work in Kodi, are also appreciated.
(This post was last modified: 2017-03-13 00:14 by garbear.)
find quote
Julipo Offline
Junior Member
Posts: 45
Joined: Mar 2015
Reputation: 0
Post: #4
Typical solution is have a hot-key that enables second function for all keys. Usually this key is bind to "select in some systems (retropie), but is configurable.

So when you press "select + start" you do second action for start (normally open menu, or exit emulator in retropie).
(This post was last modified: 2017-03-14 14:08 by Julipo.)
find quote
Ferk Offline
Junior Member
Posts: 16
Joined: Nov 2014
Reputation: 0
Post: #5
Thank you very much Smile
I've been testing with this joystick.xml:
Code:
<keymap>
  <FullscreenGame>
    <joystick>
      <leftthumb>OSD</leftthumb>
      <rightthumb>ActivateWindow(gamesavestates)</rightthumb>
    </joystick>
  </FullscreenGame>
</keymap>

I prefer to use the OSD instead of Stop. This allows me to do other things without closing the game, like changing the volume. And I still can stop the game using it, without being afraid of accidentally pressing it.

Too bad that it seems "ActivateWindow(gamesavestates)" doesn't really work in LibreELEC nightly for some reason (nor do I have in the OSD the new savestate menu...). I though that was merged long ago? The Kodi build is from last Saturday (4912f8f8).

I still think a button combination will be the best. Although it's true that at the moment there are not many games playable in my raspberry pi that would use the L3/R3 thumstick clicks.

The RetroPie gamepad hotkeys Julipo mentioned are documented in their wiki, though they are not really default in Retroarch (they are from EmulationStation).

I don't think there are many other emulators using gamepad combos, though. Most are designed to run on a computer so they typically use F1,F2, etc. I've heard people using autohotkeys or joy2key to map them, but I doubt there's an established standard.

The EmulationStation ones are ok. Although imho it's a bit dangerous to have a gamepad combination to completely stop the game, or reset it. Maybe they could be used with slight changes.. like "Select+Start" could be "PreviousMenu", while "Select+X" be "OSD" and "Select+B" "Pause".

Or if you feel that's too many default combinations (maybe it could conflict with some games?) just go the official Retroarch way and have only one combination that pauses the game and opens the OSD menu (in Retroarch you can choose for that a combination out of 4 possible, "Start+Select" being one of them.. default is "None").
As long as all the other functions are easily reachable from the OSD, that would be fine. And if the joystick.xml can be customized to add extra ones, that would be awesome. Sane default yet extended possibilities.
(This post was last modified: 2017-03-20 23:08 by Ferk.)
find quote
Mettbrot Offline
Senior Member
Posts: 280
Joined: Jan 2011
Reputation: 4
Location: Aachen
Post: #6
I like the idea of opening gamesavestates and not directly close the emulator. I think we need sort of a global pause menu, like RetroArch has. If I press the playstation button I get there where I can save, resume, close, reset. It would be great if this could be kodi itsself with the save/resume/stop/close/reset options added to the game menu. Once you go back to the emulator, input is again tranmitted to the game, not kodi.
find quote
nmcaullay Offline
Member
Posts: 93
Joined: Aug 2010
Reputation: 1
Post: #7
Hi all, i've made a joystick.xml (from the above code) and placed it in the keymaps folder, rebooted... but it doesnt seem to have any effect. I'm guessing that the FullscreenGame node in the XML isnt yet in the builds? Or perhaps i've got something else wrong?
I'm using a recent LibreElec build from here
http://forum.kodi.tv/showthread.php?tid=298461
find quote
garbear Offline
Team-Kodi Developer
Posts: 1,695
Joined: Dec 2010
Reputation: 109
Location: city of angels
Post: #8
(2017-04-18 13:39)nmcaullay Wrote:  Hi all, i've made a joystick.xml (from the above code) and placed it in the keymaps folder, rebooted... but it doesnt seem to have any effect. I'm guessing that the FullscreenGame node in the XML isnt yet in the builds? Or perhaps i've got something else wrong?
I'm using a recent LibreElec build from here
http://forum.kodi.tv/showthread.php?tid=298461

Can you point a debug log? If there's an XML syntax error, it should show here. Otherwise, upload your joystick.xml to a pastebin site and I'll take a look at it.

BTC: 1JtXwJdGdE9YnYgThWBT2StFCU5sEYkbVD (personal), https://kodi.tv/contribute/donate-bitcoin (foundation). Donations in the form of controllers, especially ones that don't work in Kodi, are also appreciated.
find quote
nmcaullay Offline
Member
Posts: 93
Joined: Aug 2010
Reputation: 1
Post: #9
Hi there, a debug log is posted here
https://pastebin.com/RcQABTDq

I have the following code in the /storage/.kodi/userdata/keymaps/joystick.xml file

Code:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
  <FullscreenGame>
    <joystick>
      <leftthumb>OSD</leftthumb>
      <rightthumb>ActivateWindow(gamesavestates)</rightthumb>
    </joystick>
  </FullscreenGame>
</keymap>

Hitting the left/right thumb shows up in the log as being recieved by kodi (i pushed each 5-10 times at the tail of the log), but it doesn't seem to be interpreted as anything special.

The other buttons do things in the game itself (i.e. the game works fine), just the left/right thumbs don't seem to be activated as detailed in the XML file.
It would seem that my XML file is wrong, or in the wrong place, or just not being used?

Ideas?

NAthan
(This post was last modified: 2017-04-20 20:40 by garbear.)
find quote
garbear Offline
Team-Kodi Developer
Posts: 1,695
Joined: Dec 2010
Reputation: 109
Location: city of angels
Post: #10
OK, I found the problem. Buttons are only sent to Kodi if they're not used by the game's controller. NES, for example, only capture A/B/Start/Select/Directions, so the stick thumb buttons can be used in Kodi's gui during a game.

MAME, on the other hand, captures all buttons, so the thumb sticks can't be used inside MAME (or PS, etc.) games.

To solve this, I'm planning on adding "meta" buttons that let you control a new game-based OSD. I haven't decided what the new OSD will have. What OSD options do you need access to during gameplay?

BTC: 1JtXwJdGdE9YnYgThWBT2StFCU5sEYkbVD (personal), https://kodi.tv/contribute/donate-bitcoin (foundation). Donations in the form of controllers, especially ones that don't work in Kodi, are also appreciated.
find quote
MrTarantula Offline
Junior Member
Posts: 48
Joined: Jan 2016
Reputation: 2
Post: #11
Not saying we need all of these, but here are some options. A lot of these will be in other menus too, but it would be nice to have quick access to them while in-game.
  • Reset game
  • Save state
  • Load state
  • Load savegame
  • Enable/disable cheats
  • Change shader (if it can be done on-the-fly)
  • Netplay settings
  • Controller assignment (maybe)
find quote
FoxForceFive Offline
Member
Posts: 67
Joined: Dec 2009
Reputation: 0
Post: #12
(2017-04-20 22:01)MrTarantula Wrote:  Not saying we need all of these, but here are some options. A lot of these will be in other menus too, but it would be nice to have quick access to them while in-game.
  • Reset game
  • Save state
  • Load state
  • Load savegame
  • Enable/disable cheats
  • Change shader (if it can be done on-the-fly)
  • Netplay settings
  • Controller assignment (maybe)

I would argue that

Reset game
Save State
Load State
Load Savegame
Exit Game

Are all essential.

If you could access these from a dedicated pause button (the xbox360 guide, PS button, or Start & Select together, for example) or from an overlay OSD in the normal pause menu (although I'm sure that would get in the way of some pause menu options in later games like PS1 etc).

The lack of these options easily are what keeps me using an old Wii with emulators on hooked up to the TV, just cos I can do these things from the gamepad, despite me having a much more powerful HTPC sitting right next to it! I've tried autohotkey, windows ds4 & even logitech harmony remote shortcuts, but they're different between the various systems & it's just never as easy to remember or even implement when playing.
find quote
natethomas Offline
XBMC Chief and Kodi Project Manager
Posts: 6,151
Joined: Apr 2008
Reputation: 124
Location: Kansas
Post: #13
A dedicated pause button that opens the OSD is a pretty neat idea, actually. Instead of all these button press combos, you just use what ever game already gives you. Start pauses. Long press Start opens the OSD.
(This post was last modified: 2017-04-24 17:28 by natethomas.)
find quote
MrTarantula Offline
Junior Member
Posts: 48
Joined: Jan 2016
Reputation: 2
Post: #14
(2017-04-24 17:28)natethomas Wrote:  A dedicated pause button that opens the OSD is a pretty neat idea, actually. Instead of all these button press combos, you just use what ever game already gives you. Start pauses. Long press Start opens the OSD.

I really like the long pause idea. So simple yet I never would have thought of it. Nearly every controller has a pause button. I can't think of any games that would conflict with this.

I'd love for it to be configurable as well. My DualShock 3's PS button just goes to Home by default.
find quote
FoxForceFive Offline
Member
Posts: 67
Joined: Dec 2009
Reputation: 0
Post: #15
(2017-04-24 17:28)natethomas Wrote:  A dedicated pause button that opens the OSD is a pretty neat idea, actually. Instead of all these button press combos, you just use what ever game already gives you. Start pauses. Long press Start opens the OSD.

Yep, there's a note on the wiki about future support for long press on controller buttons so it would make sense.
find quote