Sign in to follow this  
Followers 0
Rad

_IsPressed !?

15 posts in this topic

I was searching the forums trying to find a condition for if your still holding down a key, I already have my hotkey set up so when you press down it has msgbox that says "Down" so that works. Now I want my "ship" to fly down when I press down, I can manage making it move on my own, but how would i make it keep moving untill you stop pressing down?

I can just make it change when you press left/right/up so you cant stop, but then I cant make it fly at angles!

How do you get the _IsPressed(xx) functions? It crashes when I use it :lmao:

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

could u please explain exactly what your doing

nvm from the many posts on the forum i see your making a game

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I made a little drawing program a long time ago that let me move lines and stuff (for various reasons). If you have a hotkey function, holding the key should repeatedly call the function. At least it did when I used it.

As for _IsPressed(), you need misc.au3 (beta is useful too). If you couldn't tell that from what you were doing, you most likely don't have Scite either. If that was a correct assumption, get Scite. It's damn useful.

P.S. @Oxin8: Fast posting for the win!

Edited by greenmachine

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

OH Nevermind I wasnt putting the little ' marks around my number hehe

fyi all you need is:

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

 Return $bRv
EndFunc;==>_IsPressed

I had a big example and stripped this down, now it works pretty good...

And what is Scite? :lmao:

Edited by Rad

Share this post


Link to post
Share on other sites

the help file is great.... learning on the fly...

#Include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
If _IsPressed("25",$dll) Then;move left
If _IsPressed("26",$dll) Then;move up
If _IsPressed("27",$dll) Then;move right
If _IsPressed("28",$dll) Then;move down
Wend
DllClose($dll)

That help?

Share this post


Link to post
Share on other sites

Err where do I download the beta?.... Theres a beta?

Share this post


Link to post
Share on other sites

Should I uninstall v3? or.... does it update everything automatically? Your answered leave alot to be questioned you should provide more information in everything you say, especially to a newb

Share this post


Link to post
Share on other sites

Right, will do. Although you'd probably find out if you ran it or read about it a bit more, beta will install in your autoit dir, in the folder called "beta". Every new beta will then update in that beta folder. No uninstallation necessary.

Share this post


Link to post
Share on other sites

Ah ty, sorry if i sounded rude there but everyone on this forum puts the info out there but doesnt explain what to do, and it bugs me... Its working though thanks :lmao:

Share this post


Link to post
Share on other sites

sciTE is a thousand times better to program with than the normal notebook :lmao:


[~FuZi0h~]ScriptRipping? = ┴¬┴¬┴┴¬ (My word for sucks.)'FuZi0h, Liope and Rambo3889 4-EvaHelp me by pressin This!all clicks appreciated :)

Share this post


Link to post
Share on other sites

sciTE is a thousand times better to program with than the normal notebook :lmao:

More.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Im using crimson editor... It looks almost EXACTLY the same except Im on XP which makes that look like an ancient program xD

http://www.crimsoneditor.com/

Err with the dark grey menus etc

Edited by Rad

Share this post


Link to post
Share on other sites

Im using crimson editor... It looks almost EXACTLY the same except Im on XP which makes that look like an ancient program xD

http://www.crimsoneditor.com/

Err with the dark grey menus etc

What's the deal with those menus... it's like that in Java, is that just some sort of Java-specific window appearance? Or is it built in and just used for certain things that don't like the XP feel. I'm not a big fan of Java windows, they don't look right to me after a couple years of WinXP.

Share this post


Link to post
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
Sign in to follow this  
Followers 0