Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Key Press Script


  • Please log in to reply
19 replies to this topic

#1 XxSunxX

XxSunxX

    Seeker

  • Active Members
  • 33 posts

Posted 30 January 2007 - 01:01 AM

Its me again, I can't get the key macro to work. Could someone please give me a full example script instead of telling to look myself, I found the help file but its not what I want because the example is mixed up with a GUI window create, and isn't the kind of key press I want, its just a hotkey for pause script or something. So could someone please give me an example script that does the following:

Press key "1" to activate the loop of Z.
Key Z is looped (pressed over and over till otherwise..)
Press key "1" a second time to stop the loop of Z








#2 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,730 posts

Posted 30 January 2007 - 01:08 AM

Its me again, I can't get the key macro to work. Could someone please give me a full example script instead of telling to look myself, I found the help file but its not what I want because the example is mixed up with a GUI window create, and isn't the kind of key press I want, its just a hotkey for pause script or something. So could someone please give me an example script that does the following:

Press key "1" to activate the loop of Z.
Key Z is looped (pressed over and over till otherwise..)
Press key "1" a second time to stop the loop of Z

http://www.autoitscript.com/autoit3/docs/f...s/HotKeySet.htm

Has the only example you need.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#3 Helge

Helge

    Yup

  • Active Members
  • PipPipPipPipPipPip
  • 2,049 posts

Posted 30 January 2007 - 01:29 AM

Its me again, I can't get the key macro to work. Could someone please give me a full example script instead of telling to look myself, I found the help file but its not what I want because the example is mixed up with a GUI window create, and isn't the kind of key press I want, its just a hotkey for pause script or something. So could someone please give me an example script that does the following:

Press key "1" to activate the loop of Z.
Key Z is looped (pressed over and over till otherwise..)
Press key "1" a second time to stop the loop of Z

http://www.autoitscript.com/forum/index.php?showtopic=40326

Is the only topic you need for this subject.

#4 XxSunxX

XxSunxX

    Seeker

  • Active Members
  • 33 posts

Posted 30 January 2007 - 01:41 AM

....
.....
......

..........*Ignores the posts above seeming they didn't read*....

Can someone post an example script?

#5 BALA

BALA

    I'm a pirate! :)

  • Active Members
  • PipPipPipPipPipPip
  • 504 posts

Posted 30 January 2007 - 01:58 AM

....
.....
......

..........*Ignores the posts above seeming they didn't read*....

Can someone post an example script?

Not to sound insulting but you only need to add two example scripts together that were provided in that previous thread.

HotKeySet("1", "Main") Func Main()     while 1         If _IsPressed(31) Then ; If 1 key is pressed             ExitLoop ; Exit Loop         EndIf         send("z")         Sleep(5)     Wend EndFunc

Edited by BALA, 30 January 2007 - 02:01 AM.

BA-LAhttp://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

#6 XxSunxX

XxSunxX

    Seeker

  • Active Members
  • 33 posts

Posted 30 January 2007 - 02:06 AM

Not to sound insulting but you only need to add two example scripts together that were provided in that previous thread.

HotKeySet("1", "Main") Func Main()     while 1         If _IsPressed(31) Then ; If 1 key is pressed             ExitLoop ; Exit Loop         EndIf         send("z")         Sleep(5)     Wend EndFunc

If_IsPressed(31)<-----How is that 1?
Oh, and what would the keys be for numpad 1-9, insert, home, page up, delete, end, page down

#7 BALA

BALA

    I'm a pirate! :)

  • Active Members
  • PipPipPipPipPipPip
  • 504 posts

Posted 30 January 2007 - 02:08 AM

the 31 is a hexkey for the key "1"

From help file under _IsPressed:

60 Numeric keypad 0 key 61 Numeric keypad 1 key 62 Numeric keypad 2 key 63 Numeric keypad 3 key 64 Numeric keypad 4 key 65 Numeric keypad 5 key 66 Numeric keypad 6 key 67 Numeric keypad 7 key 68 Numeric keypad 8 key 69 Numeric keypad 9 key

Edited by BALA, 30 January 2007 - 02:11 AM.

BA-LAhttp://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

#8 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,730 posts

Posted 30 January 2007 - 02:18 AM

....
.....
......

..........*Ignores the posts above seeming they didn't read*....

Can someone post an example script?

You resemble that remark.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#9 XxSunxX

XxSunxX

    Seeker

  • Active Members
  • 33 posts

Posted 30 January 2007 - 02:22 AM

HotKeySet("1", "Main") Func Main()     while 1         If _IsPressed(31) Then ; If 1 key is pressed             ExitLoop ; Exit Loop         EndIf         send("z")         Sleep(5)     Wend EndFunc


At the HotKeySet("1","Main" and at While 1, how would I go setting it as the numpad key I wish to use? :)

#10 BALA

BALA

    I'm a pirate! :)

  • Active Members
  • PipPipPipPipPipPip
  • 504 posts

Posted 30 January 2007 - 02:24 AM

the 31 is a hexkey for the key "1"

From help file under _IsPressed:

60 Numeric keypad 0 key 61 Numeric keypad 1 key 62 Numeric keypad 2 key 63 Numeric keypad 3 key 64 Numeric keypad 4 key 65 Numeric keypad 5 key 66 Numeric keypad 6 key 67 Numeric keypad 7 key 68 Numeric keypad 8 key 69 Numeric keypad 9 key

Did you even read my post....

If you want numerical 0 for example, you would replace 31 with 60. 61 if you want numerical 1, 62 for numerical 2, etc.

Edited by BALA, 30 January 2007 - 02:25 AM.

BA-LAhttp://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

#11 Helge

Helge

    Yup

  • Active Members
  • PipPipPipPipPipPip
  • 2,049 posts

Posted 30 January 2007 - 02:27 AM

*Ignores the posts above seeming they didn't read*....

Oh, damn...you're totally right. Me referring you to your previous topic makes it perfectly clear that I didn't read...
Eehm, I don't see the logic in that. Also, please do explain how it's needed to create another topic one hour after
the last post in your previous topic on the very same subject.

#12 XxSunxX

XxSunxX

    Seeker

  • Active Members
  • 33 posts

Posted 30 January 2007 - 02:29 AM

Did you even read my post? Re-read it... :)

#13 _Kurt

_Kurt

    been a while hasn't it

  • Active Members
  • PipPipPipPipPipPip
  • 865 posts

Posted 30 January 2007 - 03:31 AM

Did you even read my post? Re-read it... :)

Stop getting people to work for you. All the necessary information has been given to you, they referred IsPressed and HotkeySet, which are the two functions you are looking for. Open up the damn helpfile, read the information, attempt a "test", experiment, then, if all fails, come back for a little more advice.

Kurt
Awaiting Diablo III..

#14 Paulie

Paulie

    Waiting for Misaki Nakahara

  • Active Members
  • PipPipPipPipPipPip
  • 5,114 posts

Posted 30 January 2007 - 03:32 AM

Where do you think you get off? XxSunxX

You reject the statements of 2 regulars(Smoke_N and Helge) on the forum without reading their posts? And then have the intestinal fortitude to actually accuse them of not reading?

Do you have a brain defect?

And why would you used "_IsPressed" for this script? This problem is much quicker and easier to solve with "Hotkeyset" as mentioned above.

Copied straight from smokes link with minor alterations:

AutoIt         
; Press Esc to terminate script Global $UnPaused HotKeySet("1", "TogglePause") HotKeySet("{ESC}", "Terminate") While 1     Sleep(100)     ToolTip("Script is Paused",0,0) WEnd Func TogglePause()     $UnPaused = NOT $UnPaused     While $UnPaused         ToolTip("Sending...",0,0)         Send("z")     WEnd EndFunc Func Terminate()     Exit 0 EndFunc


I wanna hear some apologies from you mouth.

Edited by Paulie, 30 January 2007 - 03:34 AM.

I'm still looking for my heart song.

Posted Image


#15 Krankios

Krankios

    Wayfarer

  • Banned (NOT IN USE)
  • 61 posts

Posted 12 December 2011 - 10:35 PM

owned :)

#16 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,850 posts

Posted 12 December 2011 - 10:51 PM

Krankios, do you realize you posted in a 4 year old thread?

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.


#17 IanN1990

IanN1990

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 532 posts

Posted 12 December 2011 - 11:06 PM

That explains why a topic with 15 posts, have 20,000 views ^^ I was scratching my head trying to figure it out lol

Edited by IanN1990, 13 December 2011 - 07:24 AM.


#18 Krankios

Krankios

    Wayfarer

  • Banned (NOT IN USE)
  • 61 posts

Posted 17 December 2011 - 10:39 PM

Krankios, do you realize you posted in a 4 year old thread?

Yeah i do and i must be pretty "interesting" to you considering you are watching what i post :)

#19 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,850 posts

Posted 18 December 2011 - 01:28 AM

Yeah i do and i must be pretty "interesting" to you considering you are watching what i post ;)

Well I do read most new posts, but when they're from you, I just can't click fast enough.. :)

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.


#20 Jos

Jos

    ...

  • Developers
  • 23,223 posts

Posted 18 December 2011 - 09:27 AM

Yeah i do and i must be pretty "interesting" to you considering you are watching what i post :)

Not interesting and please don't do this unless there is a real use for it.

Jos

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users