Davidobot / love.js

LÖVE ported to the web using Emscripten, updated to the latest Emscripten and LÖVE (v11.5)
MIT License
624 stars 28 forks source link

keyboard input not working on itch.io #67

Closed lilmike closed 2 years ago

lilmike commented 2 years ago

Hiya,

I'm using makelove to export my love2d game to html5, and I've put it on itch.io. However, after pressing enter or clicking the button to launch the game, keyboard input does not work. I've read that you need to click outside the canvas to make keyboard input work. Is there a way to automatically do this? I saw the window.focus calls, and have tried doing everything from focusing the iframe on itch.io, focusing the iframe's contentWindow, and more, none of which seems to work. Any thoughts on this? It's also worth noting that this game is targetted mostly at blind people, so using the mouse to enable keyboard input would just not be an option easily for this group.

If you'd like to look at the game, go to https://2mb.itch.io/run-and-chomp-trijam. It would be great if we could figure out a way to get keyboard input working automatically, especially without using the mouse! :-).

-Michael.

Davidobot commented 2 years ago

Is this the case with other love.js games on itch?

I'm away atm so can't test, but just off the top of my head - https://ioribranford.itch.io/honey-guardian

lilmike commented 2 years ago

Hiya,

That game's keys seem to work. Now upon further investigation, I get the following error in the javascript console in chromium:

Uncaught TypeError: Cannot read properties of undefined (reading 'length')

That seems to be in reference to _alSourceStopv or some such.

-Michael.

On Sun, Sep 18, 2022 at 02:50:37PM -0700, David Khachaturov wrote:

Is this the case with other love.js games on itch?

I'm away atm so can't test, but just off the top of my head - https://ioribranford.itch.io/honey-guardian

-- Reply to this email directly or view it on GitHub: https://github.com/Davidobot/love.js/issues/67#issuecomment-1250393281 You are receiving this because you authored the thread.

Message ID: @.***>

-- Sorry about the test, it's just a me thing. Michael Taboada, Creator of Games. Does that make me a god, well, sorta. My pgp key: 79BC390E8864CD71305D4DD606CD2197A6EE5ED7 My website: https://michaels.world 2MB website: https://2mb.games Don't believe everything you read on the internet. I might not be real, you might not be real, and this email certainly isn't real. Sent from my breakfast... carnival machine

lilmike commented 2 years ago

Hiya, It looks like this is to do with love.audio.stop() with no arguments causing a crash. I will work around it for now.

-Michael.

On Sun, Sep 18, 2022 at 02:50:37PM -0700, David Khachaturov wrote:

Is this the case with other love.js games on itch?

I'm away atm so can't test, but just off the top of my head - https://ioribranford.itch.io/honey-guardian

-- Reply to this email directly or view it on GitHub: https://github.com/Davidobot/love.js/issues/67#issuecomment-1250393281 You are receiving this because you authored the thread.

Message ID: @.***>

-- Sorry about the test, it's just a me thing. Michael Taboada, Creator of Games. Does that make me a god, well, sorta. My pgp key: 79BC390E8864CD71305D4DD606CD2197A6EE5ED7 My website: https://michaels.world 2MB website: https://2mb.games Don't believe everything you read on the internet. I might not be real, you might not be real, and this email certainly isn't real. Sent from my supernatural... plastic dresser

lilmike commented 2 years ago

Yeah, after working around love.audio.stop crashing the game, everything works as expected. Closing this, since this is no longer a valid issue.

-Michael.