You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NB: Thanks so much for this incredible project! I'm happy to take a stab at fixing this if anyone can point me in the right direction :)
Steps to Reproduce
Create two scenes that toggle back and forth with two different key presses:
import*asexfrom"excalibur";consta=newex.Scene();a.on("initialize",()=>{a.input.keyboard.on("press",(e)=>{if(e.key===ex.Keys.Key1){a.engine.goToScene("b");}});});constb=newex.Scene();b.backgroundColor=ex.Color.DarkGray;b.on("initialize",()=>{b.input.keyboard.on("press",(e)=>{if(e.key===ex.Keys.Key2){b.engine.goToScene("a");}});});constgame=newex.Engine({scenes: { a, b },});game.goToScene("a");game.start();
The issue does not appear if you target the same key code in both scenes.
Expected Result
Pressing "1" always transitions scene A to scene B
Pressing "2" always transitions scene B to scene A
Actual Result
Pressing "1" always transitions scene A to scene B ✅
Pressing "2" always transitions scene B to scene A ❌
It works once. On subsequent attempts, you have to press "2" twice.
It seems like the key gets "stuck" in the down state due to the scene changes, and the first press "releases" it.
Not sure why it doesn't happen to the initial scene.
Environment
browsers and versions: Firefox (128.0, 64-bit), Chrome (126.0.6478.127, arm64)
operating system: macOS 14.5 (Sonoma) - MacBook Air (M1, 2020)
NB: Thanks so much for this incredible project! I'm happy to take a stab at fixing this if anyone can point me in the right direction :)
Steps to Reproduce
Create two scenes that toggle back and forth with two different key presses:
The issue does not appear if you target the same key code in both scenes.
Expected Result
Actual Result
Environment
Current Workaround
Haven't found one 😞
The text was updated successfully, but these errors were encountered: