Jump to content

Know if a key is pressed?


Recommended Posts

OK...I wanna make a game and I wanna know when a key is pressed so that the character moves...

How??

Thanx!! :lmao:

<{POST_SNAPBACK}>

UDF:

_IsPressed or something like that.

Search the forum for the keylogger script that's been floating around.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

I tried this and it didnt work:

#include <string.au3>

While 1
    If _IsPressed(_StringToHex("n")) Then
        MsgBox(64, "See", "n was pressed")
    EndIf
WEnd

Func _IsPressed($hexKey)
    Local $aR, $bRv
    $hexKey = '0x' & $hexKey
    $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
    If $aR[0] <> 0 Then
        $bRv = 1
    Else    
        $bRv = 0
    EndIf
      Return $bRv
EndFunc

I pressed "n" and it didnt work...why??

Thanx!! :lmao:

El-Truchahttp://www.truchasoft.tk[url="ftp://tsfc.homeftp.net"]ftp://tsfc.homeftp.net[/url]hotline://tsfc.ath.cx

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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