love.keypressed not working as expected.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
DPS2004
Prole
Posts: 10
Joined: Thu Jan 23, 2020 8:05 pm

love.keypressed not working as expected.

Post by DPS2004 »

Hello, I am coming here for help with a project.

I am porting my Ludum Dare 45 game, Buzzsaw Cat to love2d. I wrote it in PICO-8.

One reason for the port is to use it with LovePotion on my 3DS.

LovePotion uses love.gamepadpressed and love.gamepadreleased to check for input, so for the computer version, I am using keypressed and keyreleased.

I am trying to convert the inputs to PICO-8's BTN() format. The game opens with a title screen that waits for the user to press button 5. Button 5 is mapped to the space bar under my current system. The game does not detect that the space bar is being pressed, and therefore does not activate Button 5 in the PICO-8 code. The console window is monitoring the state of button 5, and as you can see, it is returning a stream of false's.

I do not know if this is helpful, but I noticed that keyreleased is working. If you start all buttons as pressed, upon releasing space, it unpresses the button.

Any sort of help would be appreciated.
Attachments
ld45.love
the .love file
(36.39 KiB) Downloaded 117 times
User avatar
steVeRoll
Party member
Posts: 131
Joined: Sun Feb 14, 2016 1:13 pm

Re: love.keypressed not working as expected.

Post by steVeRoll »

Hi and welcome to the forums!
The love.keypressed which is at line 90 seems to work correctly, but you are overwriting it with an empty love.keypressed on line 189. Removing it seems to have fixed the issue.
DPS2004
Prole
Posts: 10
Joined: Thu Jan 23, 2020 8:05 pm

Re: love.keypressed not working as expected.

Post by DPS2004 »

Amazing! Thank you so much for the help.
Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests