Page 1 of 1

love.keyboard.isDown() error [SOLVED]

Posted: Mon Nov 19, 2018 6:12 am
by agargara
The following code:

Code: Select all

function love.update(dt)
    if love.keyboard.isDown('h') then
        print('h')
    end
end
Gives me the error:

Code: Select all

attempt to index field 'keyboard' (a nil value)
What am I missing? I couldn't find anything in the documentation about love.keyboard being deprecated.

EDIT: Of course I figured it out one minute after I posted this...
I had

Code: Select all

t.modules.keyboard = false
in my conf.lua. Setting it to true solved the problem.

Oops.... :oops: :oops: :oops: :oops:

I guess I'll leave this thread up for anybody who repeats my mistake.