Jump to content

is key has been pressed ..


WiBox

Recommended Posts

I need to check if a key has been pressed.. Example I need to check if the key " space " has been pressed then it's like..;

function theBinds()
    if ( is the key space has been pressed.. ) then           -- 
        bindKey( "arrow_u", "down", a)
        bindKey( "arrow_d", "down", b)
        bindKey( "arrow_l", "down", c)
        bindKey( "arrow_r", "down", d)
    else
        unBindKey( "arrow_u", "down", a)
        unBindKey( "arrow_d", "down", b)
        unBindKey( "arrow_l", "down", c)
        unBindKey( "arrow_r", "down", d)
    end
end
addEvent("setBinds", true)
addEventHandler("setBinds", root, theBinds)
        

Is there a way that will make me check if a key has been pressed?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...