isKeyPressed

  • #1, by andy-rinaldiWednesday, 08. October 2014, 23:06 10 years ago
    Hi, I need to write a character as * or < and I'm not able to find it in Key Actions. I was thinking to use lua:

    if isKeyPressed(z) then
        add("Z")
    end
    


    but it's no works.

    Also I tried with isKeyDown but nothing happened.

    Thanks.

    Forum Fan

    160 Posts


  • #2, by afrlmeThursday, 09. October 2014, 00:31 10 years ago
    Lua key input support was only recently added to 4.1. You need to create a keyboard event handler to check key pressed/released & special keys.

    http://wiki.visionaire-tracker.net/wiki/RegisterEventHandler -- check example 3.

    Keydown will constantly trigger code if character == x
    keyup will only trigger once on release
    textkeyinput is for unicode characters...

    there are also some special keys that have their own eKey access, which I will add to the _(CMS) page version I will get around to typing up at some point.

    Imperator

    7278 Posts