Sign in to follow this  
Followers 0
Dev

While Keydown?

22 posts in this topic

can i create some while loop which is active only when i hold a key down?

thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hold a key down? or press a key. You could make something like L starts a loop and E stops a loop (not tested)

$endloop = HotKeySet("e")
HotKeySet("l", "loop")
Do
Func loop()
STATEMENTS
EndFunc
Until $endloop = 1
Edited by the_lord_mephy

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

can i create some while loop which is active only when i hold a key down?

thanks

<{POST_SNAPBACK}>

if the question is to activate the while when any key is pressed then...nope..

you can activate a function with hotkeyset() when a specific key is presses.

Edited by JdeB

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

Share this post


Link to post
Share on other sites

i wanna do eg. MouseClick-loop while eg. TAB is hold down.

im noob so a little code would not hurt :ph34r:

Share this post


Link to post
Share on other sites

Tab can be hooked.

HotKeySet ( '{tab}' , '_MouseClick-loop' )

While 1
Sleep(100)
WEnd

Exit
Func _MouseClick-loop()
  ; What you want
EndFunc

Share this post


Link to post
Share on other sites

Ezzetabi, is there a particular reason u put the _ infront of ur function, just curious if it does something i dont know about


My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

Ezzetabi, is there a particular reason u put the _ infront of ur function, just curious if it does something i dont know about

<{POST_SNAPBACK}>

it's tradition/custom to do so, helps differentiate your udf's from real functions

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

it's tradition/custom to do so, helps differentiate your udf's from real functions

<{POST_SNAPBACK}>

.. and allows clever editors like TextPad ( :ph34r: ) to highlight them differently to the way that regular functions are highlighted :(

Share this post


Link to post
Share on other sites

.. and allows clever editors like TextPad ( :ph34r: ) to highlight them differently to the way that regular functions are highlighted  :(

<{POST_SNAPBACK}>

Hey, JdeB, why doesn't SciTE do that?

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

it's tradition/custom to do so, helps differentiate your udf's from real functions

<{POST_SNAPBACK}>

Yep. This is the point. Also I dislike the #include command. I prefere copying the code of UDFs in the botton of the script, so when I see _* I know that I need the code.

Also, sometime I script using a TopDown procedure so, sometime I use UDF that I have still to develop saying 'I'll do later, lets finish the main script'.

So, when the moment arrive, I just look for _s for finding every UDF I have to develop.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Hey, JdeB, why doesn't SciTE do that?

<{POST_SNAPBACK}>

anything is possible...... only cost more.... :ph34r:

Seriously... it can be done if thats what we all want... but there is no way to verify that the function really exists.

how/what does textpad do with this?

Edited by JdeB

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

Share this post


Link to post
Share on other sites

anything is possible......  only cost more....  :ph34r:

Seriously...  it can be done if thats what we all want...  but there is no way to verify that the function really exists.

how/what does textpad do with this?

<{POST_SNAPBACK}>

that's fine with me, AU3check does that...

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

Yep. This is the point. Also I dislike the #include command. I prefere copying the code of UDFs in the botton of the script, so when I see _* I know that I need the code.

Also, sometime I script using a TopDown procedure so, sometime I use UDF that I have still to develop saying 'I'll do later, lets finish the main script'.

So, when the moment arrive, I just look for _s for finding every UDF I have to develop.

<{POST_SNAPBACK}>

You dislike a feature that makes writing scripts easier because instead of cluttering your code with commonly used functions, you'd rather copy/paste them all over the place and have a copy in every single script so that you have to manually re-copy them if you make a significant change? :: shrugs :: To each his own, I suppose.

Share this post


Link to post
Share on other sites

Small point.... Every bit of text that I can think of is styled with the current lexer. The only text that uses the default color is user function names in either the declaration or use of a function. So... why not change the default color to something besides black (Which I'm assuming most people have as default) and be done with it? Isn't that close enough?

Share this post


Link to post
Share on other sites

Common or not, you may add Function you do not use.

But as you said 'to each his own'. Who care?

Share this post


Link to post
Share on other sites

Small point....  Every bit of text that I can think of is styled with the current lexer.  The only text that uses the default color is user function names in either the declaration or use of a function.  So... why not change the default color to something besides black (Which I'm assuming most people have as default) and be done with it?  Isn't that close enough?

<{POST_SNAPBACK}>

True....

I was just wondering what TextPad is doing extra here ??.. is it just giving a piece of text a color when it starts with _ and ends with ( or does it something really intelligent ??


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

Share this post


Link to post
Share on other sites

Maybe it changes color for everything starts with _ and ' ' OR ( that is not already something other. But at this point I may not work with Func names like: _WinActivate()

But, once in a while, I agree with Valik. Black is already a different color from most of the script. Why bother?

Share this post


Link to post
Share on other sites

[..]how/what does textpad do with this?

<{POST_SNAPBACK}>

:lol: I'm happy (eager even) to share this .. but it will cost you all 5 nice things to say about Textpad :ph34r: ...

; AutoIt v3 Syntax File
; Created by Jonathan Bennett <jon@hiddensoft.com>
;

C=1

[Syntax]
Namespace1 = 3
IgnoreCase = Yes
KeyWordLength =
BracketChars = ()[]
OperatorChars = +-*/&
PreprocStart = #
HexPrefix = 0x
SyntaxStart =
SyntaxEnd =
CommentStart = #cs
CommentEnd = #ce
CommentStartAlt = _
CommentEndAlt = (
SingleComment =;
SingleCommentCol =
SingleCommentAlt =
SingleCommentColAlt =
SingleCommentEsc =
StringsSpanLines = Yes
StringStart = "
StringEnd = "
StringAlt = '
StringEsc =
CharStart = 
CharEnd = 
CharEsc =

.. see, it's actually a clever fiddle: I'm setting "_" as an alternative comment, which i highlight in bright pink :(

.. the side-effect is that using the continuation feature makes you blind ( :lol: )

Share this post


Link to post
Share on other sites

:D  I'm happy (eager even) to share this .. but it will cost you all 5 nice things to say about Textpad  :ph34r:  ...

.. see, it's actually a clever fiddle: I'm setting "_" as an alternative comment, which i highlight in bright pink  :(

.. the side-effect is that using the continuation feature makes you blind ( :lol: )

<{POST_SNAPBACK}>

Ok... so all your functions are considered comments... cool ... avoids lots of coding issues... :lol:

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

Share this post


Link to post
Share on other sites

What a second. What happen if you use the _ as line divider?

$eg= 'a very long, but of course less than 4096 chars ' &_

'text?'

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