Log In  

Is it possible to pause using controllers other than controller 1? Is it possible to navigate the pause menu using controllers other than controller 1?

I'm making a multi-player game and would like any player to be able to pause and control the menu.

(Laptop is hookup up to the tv with players sitting in chairs away from it. I don't want players having to run up and smash the P key like some sort of American Ninja Warrior contest. I also don't want everyone yelling at player 1 to hit pause.)

If the answer is no, can support for this be added? Maybe opt-in by poking a value somewhere.

P#123854 2023-01-07 02:16 ( Edited 2023-01-07 07:55)

Hi @McLeopold.

You can easily set it so by pressing both (A) and (B) on either controller will force a pause.

Here for instance is example code, if you press (TAB) and "Q" which are 🅾️ and ❎ for player 2, the system will bring up the pause menu.

function _init()
  cls()
end
function _update()
  pset(rnd(128),rnd(128),rnd(16))
  if btn(🅾️,1) and btn(❎,1) then
    extcmd("pause")
  end
end
P#123861 2023-01-07 04:40

I didn't know about extcmd, that's what I needed. Thanks!

I wrote a test program and it turns out I can call btn(6, player_id) to check for the pause button on all my controllers.

P#123865 2023-01-07 05:28

> Is it possible to navigate the pause menu using controllers other than controller 1?

yes, nothing in the docs say that it’s only player 1 controller that has Pause. have you tried using multiple controller and pressing Start on each of them?

P#123901 2023-01-07 18:21

@merwok, Yes I have, with 4 controllers. Only controller 1 pauses and only controller 1 can navigate the menu.

They are all the same type of controller. Using the btn function I can detect the pause button on all 4, so I don't think my sdl_controllers.txt is incorrect.

P#123922 2023-01-08 03:08

[Please log in to post a comment]