Javascript Code to Pause And Start New Scene?

Still working on my previous problem.

https://forum.gdevelop.io/t/capture-button-presses-on-a-fire-tv-remote/41515

I think I’ve figured out how to capture the button presses from the Fire tv remote, I found this in the examples.

const LEFTKEY = 37;
const RIGHTKEY = 39;
if (runtimeScene.getGame().getInputManager().isKeyPressed(LEFTKEY)) {
  player.flipX(true);
} else if (runtimeScene.getGame().getInputManager().isKeyPressed(RIGHTKEY)) {
  player.flipX(false);
}

If I turn it into something like this:

const PAUSEKEY = 179;
const FFKEY = 228;
if (runtimeScene.getGame().getInputManager().isKeyPressed(PAUSEKEY)) {
  player.flipX(true);
} else if (runtimeScene.getGame().getInputManager().isKeyPressed(FFKEY)) {
  player.flipX(false);
}

It should work, I just need to figure out the rest of the If/Then. I would like to invoke “Pause And Start New Scene” with one button, and SimulateJumpKey with the other.

I normally would figure something like this out by trial and error, but with only 2 apk builds per day, It’s difficult.

If anyone knows, or could point me toward a resource I could learn from, that would be awesome.

Thanks,
Jared

1 Like

any luck on this Jared? please reach out to me we have similar issues.

Unfortunately Tony, I never figured this out. I completed the game with simplified controls using the D-pad and center button only.

In fact I wasn’t going to come back and say this, because it seemed petty, But I’m here, so…

I was really disappointed by the complete lack of response to my threads asking for help here.

First of all, I get it. Nobody owes me anything, Nobody has to answer my question. But, I took the time to try to solve the problem myself, I did my own research, and I carefully asked an informed question. And it really bummed me out to not be worthy of a response.

I kept coming back to the forum and watching moderators bend over backwards to answer low effort questions, hoping someone would toss me something as simple as “Read this piece of source.” or “Forget it, it can’t be done.” Eventually I quit coming back.

The only reason I’m here now, is because I got an email notification that Tony here asked a question on my other thread. I knew the answer, so despite my disappointment with this place, I decided to come back and help. You know, “Do onto others…” and all that.