game not register 'space' while held lshift+w

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
prostokiriuha
Prole
Posts: 5
Joined: Mon Jan 29, 2024 5:10 am

game not register 'space' while held lshift+w

Post by prostokiriuha »

i have some weird bug witn input processing
if i held lshift+w and press space key event will just not fire
it does not relater to my project, i tried in new one and have same issue
here is a simple code to reproduce this bug
on screenshot i marked what keys i pressed together, and love.keypressed just not executing if i hold lshift+w
my game is 3d and this key combination maybe the most classical and crucial - held left shift to sprint and w to go forward and press space to - and it doesn't work
lshift + any other key + space works fine

Code: Select all

local FONT = love.graphics.newFont (18, 'mono')
local FONT_LIHE_H = FONT:getHeight ()
local LINES = {}

love.keypressed = function (key, code)
    if key == 'escape' then
        love.event.push ('quit')
        return
    end
    table.insert (LINES, string.format ('%06d\t\t%s\t\t%s', love.timer.getTime () * 1000, key, code))
end

love.update = function (dt)
    if #LINES > 25 then
        table.remove (LINES, 1)
    end
end

love.draw = function ()
    love.graphics.setFont (FONT)
    local line_h = FONT:getLineHeight ()
    local n = #LINES
    for i = 0, n - 1 do
        love.graphics.print (LINES [n - i], 20, 20 + FONT_LIHE_H * i)
    end
end
Attachments
love2d bug lshift w space.png
love2d bug lshift w space.png (12.07 KiB) Viewed 1499 times
User avatar
BrotSagtMist
Party member
Posts: 614
Joined: Fri Aug 06, 2021 10:30 pm

Re: game not register 'space' while held lshift+w

Post by BrotSagtMist »

Your keyboard has a limit on how much keys it can use at once.
This is a hardware thing, just buy a better computer.
obey
prostokiriuha
Prole
Posts: 5
Joined: Mon Jan 29, 2024 5:10 am

Post by prostokiriuha »

hello
thx for reply
yes, us i found later its a keyboard issue
but it s not a amount of keys, but only this one specific conbination not works, and not only by mine instance, but on this specific keyboard model - i managed to test it on 2 more same keyboards
on keyboard of another model it works
sry for bothering
prostokiriuha
Prole
Posts: 5
Joined: Mon Jan 29, 2024 5:10 am

Re: game not register 'space' while held lshift+w

Post by prostokiriuha »

"just buy a better computer."
salty, dude
User avatar
BrotSagtMist
Party member
Posts: 614
Joined: Fri Aug 06, 2021 10:30 pm

Re: game not register 'space' while held lshift+w

Post by BrotSagtMist »

I am bread, i need salt.
German humor, there where wars over it.

In anycase this is called key rollover and you keyboard has a 2 key limit meaning they only guarantee up to 2 keys working.
Some 3 ones may work, but not all.
Usually modern keyboards have a 3 key guarantee. Good ones have no limit.
Thus: Its just cheap hardware.
Also dont rely on this working for anyone else either.
obey
prostokiriuha
Prole
Posts: 5
Joined: Mon Jan 29, 2024 5:10 am

Re: game not register 'space' while held lshift+w

Post by prostokiriuha »

yes, as i found now, there r few more combinations where 'w' key present and some other key not working.
but i never before played with this keyboard, this one for typing only, so i only now noticed ths issue.
so yeah, maybe i need a better one.
also good to know this is not an annoing unfixable bug.
Post Reply

Who is online

Users browsing this forum: No registered users and 60 guests