Script complexe pour 2 touches

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Script complexe pour 2 touches

Re: Script complexe pour 2 touches

by 6zerox » 02 Feb 2023, 06:51

Yes when you explain that i though that was Because you dont know how to do it but it’s just impossible
Thanks a lot for your help

Re: Script complexe pour 2 touches

by DuckingQuack » 01 Feb 2023, 21:31

I tried to explain that earlier today but I was unclear.
DuckingQuack wrote:
01 Feb 2023, 11:14
I can fix that, virtual keys don’t continuously send their key as if you were holding the button down because the keyboard does that. So I’ll add a repeated “m” to the script.

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 20:54

So if i understand that i want is really impossible 😮
Because ahk cant stay down on one touch but just can repeat that touch to simulate it

Re: Script complexe pour 2 touches

by DuckingQuack » 01 Feb 2023, 20:49

Yes, the 10 is the frequency of the m being sent in milliseconds. Increasing this number will slow the speed at which they are sent. 200 is 5 times per second.
(Oui, le 10 est la fréquence du m envoyé en millisecondes. L'augmentation de ce nombre ralentira la vitesse à laquelle ils sont envoyés. 200 c'est 5 fois par seconde.)
6zerox wrote:
01 Feb 2023, 20:05
Hum i am sory but doesn t work like i would like
"SetTimer, timer, 10" this line is to modify how many time between two M it's exacltly ?
But i really need only one M push and after when i press f that is up ^^
I
I suggest reading the documentation so that you better understand how the down/up keystrokes function.
(Je vous suggère de lire la documentation afin de mieux comprendre le fonctionnement des touches bas/haut.)

https://www.autohotkey.com/docs/v1/lib/Send.htm
To hold down or release a key: Enclose in braces the name of the key followed by the word Down or Up. For example:

Code: Select all

Send {b down}{b up}
Send {TAB down}{TAB up}
Send {Up down}  ; Press down the up-arrow key.
Sleep 1000  ; Keep it down for one second.
Send {Up up}  ; Release the up-arrow key.
When a key is held down via the method above, it does not begin auto-repeating like it would if you were physically holding it down (this is because auto-repeat is a driver/hardware feature). However, a Loop can be used to simulate auto-repeat.

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 20:31

I would like the same output but not by this way 😂 it’s really important the M stay down if i didn’t press F Again
So with that i would like that will doing pmmmmmmmp… but not by same way you see ?
Because if i understand your script it’s when press F that press P and One M each 10 ms but that is not same for me

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 20:31

I would like the same output but not by this way 😂 it’s really important the M stay down if i didn’t press F Again
So with that i would like that will doing pmmmmmmmp… but not by same way you see ?

Re: Script complexe pour 2 touches

by DuckingQuack » 01 Feb 2023, 20:14

I'm having difficulty understanding what output you want. Please type it like this.
DuckingQuack wrote:
01 Feb 2023, 18:24
The output of this script when you press "f" and wait a few seconds and press "f" again is:
(La sortie de ce script lorsque vous appuyez sur "f" et attendez quelques secondes et appuyez à nouveau sur "f" est) :
pmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmp
Like:
Press f: pm Press f: p Press f: pm

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 20:05

Hum i am sory but doesn t work like i would like
"SetTimer, timer, 10" this line is to modify how many time between two M it's exacltly ?
But i really need only one M push and after when i press f that is up ^^
I

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 19:40

Really sory you spend time for nothing because you was in good way (sory again for english)
But you are genius to do it on tel xD

Re: Script complexe pour 2 touches

by DuckingQuack » 01 Feb 2023, 19:04

6zerox wrote:
01 Feb 2023, 18:56
oh my bad i didnt see i can scroll so i dont take the bottom
Thats work you are great ! :)
:lol: :crazy: :headwall:
You had me very confused all day! lol

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 18:56

oh my bad i didnt see i can scroll so i dont take the bottom
Thats work you are great ! :)

Re: Script complexe pour 2 touches

by DuckingQuack » 01 Feb 2023, 18:24

Google Translation in parentheses (Google Traduction entre parenthèses)
@6zerox I've tested each script I've provided and have no errors. Depending on what the error is that you get, it could be an issue on your side. (J'ai testé chaque script que j'ai fourni et je n'ai aucune erreur. Selon l'erreur que vous obtenez, cela pourrait être un problème de votre côté.)

The output of this script when you press "f" and wait a few seconds and press "f" again is:
(La sortie de ce script lorsque vous appuyez sur "f" et attendez quelques secondes et appuyez à nouveau sur "f" est) :
pmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmp

Code: Select all

#Requires AutoHotkey v1.1.33
Esc::ExitApp
f::
If on := !on {
	Send, p
 	SetTimer, timer, 10
	} Else {
	Send, p
 	SetTimer, timer, Off
	}
Return

timer(){
	Send, m
}

If you require a different output result from pressing a single button, please describe it as I have done above. If this was the desired output, then I wish you good luck in resolving your error codes. (Si vous avez besoin d'un résultat de sortie différent en appuyant sur un seul bouton, veuillez le décrire comme je l'ai fait ci-dessus. S'il s'agissait de la sortie souhaitée, je vous souhaite bonne chance pour résoudre vos codes d'erreur.)

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 14:31

DuckingQuack wrote:
01 Feb 2023, 11:14
I can fix that, virtual keys don’t continuously send their key as if you were holding the button down because the keyboard does that. So I’ll add a repeated “m” to the script.
I’ m sorry but i really need it’s only one M continue and not a lot of M :D
I said it’s difficult script for two keys 😂
So to imagine it i can say
If first press F -> Press P and push M (maybe with delay for M but not sur)
If second press F -> press P and up M

Les modérateurs n’hésitez pas à dire si on doit bouger de topic car on parle anglais dans le topic fr désolé
Thanks a lot for your Time :)

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 14:22

DuckingQuack wrote:
01 Feb 2023, 11:14
I can fix that, virtual keys don’t continuously send their key as if you were holding the button down because the keyboard does that. So I’ll add a repeated “m” to the script.
Hum sorry but i really need that is only one M on continue and not a lot of M like : if press F press P and release and push M and if press F Again so press P and release and up M
I sais it’s difficult macro for 2 touch xD

Re: Script complexe pour 2 touches

by DuckingQuack » 01 Feb 2023, 13:36

This is a script for AHKv1… I’m more accustomed to writing in AHKv2, which is why I’m having problems, but I’ll test it when I get home. I need to know what the errors are to fix them.

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 13:31

OH may be because i have version 1.XX ?

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 13:26

A new error :)

Re: Script complexe pour 2 touches

by DuckingQuack » 01 Feb 2023, 12:48

@6zerox I may have gotten it right this time.

Code: Select all

f::
If on := !on {
	Send, p
 	SetTimer, timer, 10
	} Else {
	Send, pm
 	SetTimer, timer, Off
	}
Return

timer()
{
	Send, m
}
Return

Re: Script complexe pour 2 touches

by 6zerox » 01 Feb 2023, 12:42

An new error :p

Re: Script complexe pour 2 touches

by DuckingQuack » 01 Feb 2023, 12:38

I corrected some syntax mistakes, thank you for your patience. I’m doing this from my phone. Please test this one and let me know how it goes.

Code: Select all

f::
If on := !on {
	Send, p
 	SetTimer, timer, 10
	} Else {
	Send, p
 	SetTimer timer, Off
	}
Return

timer()
{
	Send, m
}
Return

Top