Simulation souris
Simulation souris
Salut,
peut on deplacer le pointeur de la souris logiciellement ? Si oui, comment ?
Je sais aussi qu'on peux simuler le clic de la souris.
Je n'ai pas voulu deterrer un vieux post meme plus valable avec nos 5.70
Merci
peut on deplacer le pointeur de la souris logiciellement ? Si oui, comment ?
Je sais aussi qu'on peux simuler le clic de la souris.
Je n'ai pas voulu deterrer un vieux post meme plus valable avec nos 5.70
Merci
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: Simulation souris
Bonjour SPH,
Je penses que tu recherches "SetCursorPos_(x, y)".
Cordialement,
GallyHC
Je penses que tu recherches "SetCursorPos_(x, y)".
Cordialement,
GallyHC
Configuration : Tower: Windows 10 (Processeur: i7 "x64") (Mémoire: 16Go) (GeForce GTX 760 - 2Go) - PureBasic 5.72 (x86 et x64)
Re: Simulation souris
Hoooo, c'est exactement caGallyHC a écrit :Bonjour SPH,
Je penses que tu recherches "SetCursorPos_(x, y)".
Cordialement,
GallyHC
As tu la commande qui clique la souris ?
EDIT:
je crois avoir trouvé :
Code : Tout sélectionner
mouse_event_(#MOUSEEVENTF_LEFTUP,200,180,0,1)
mouse_event_(#MOUSEEVENTF_LEFTDOWN,200,180,0,1)
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
-
- Messages : 43
- Inscription : lun. 22/oct./2018 19:34
- Localisation : Haisnes (62)
Re: Simulation souris
j'avais fait ça il y a très longtemps, mais fonctionne toujours même si ce n'est pas optimisé
Code : Tout sélectionner
Global lpPoint.Point
Procedure LeftClick()
GetCursorPos_(lpPoint)
Debug "Cible : "+lpPoint\x+", "+lpPoint\y+" Click Gauche"
mouse_event_(#MOUSEEVENTF_LEFTDOWN,0,0,0,0)
mouse_event_(#MOUSEEVENTF_LEFTUP,0,0,0,0)
EndProcedure
Procedure RightClick()
GetCursorPos_(lpPoint)
Debug "Cible : "+lpPoint\x+", "+lpPoint\y+" Click Droit"
mouse_event_(#MOUSEEVENTF_RIGHTDOWN,0,0,0,0)
mouse_event_(#MOUSEEVENTF_RIGHTUP,0,0,0,0)
EndProcedure
Procedure Target(X.i, Y.i, Button.i=0 ) ; Button = 0 (Pas de Click), Button = 1 (LeftClick), Button = 2 (RightClick)
Protected Xa.d, Ya.d, Xb.d, Yb.d, DeplacX.d, DeplacY.d, Dx.i, DY.i
GetCursorPos_(lpPoint)
Debug "Depart : "+lpPoint\x+", "+lpPoint\y
Xa = lpPoint\x
Ya = lpPoint\y
Xb=X
Yb = Y
Dx = Pow(Xa - Xb, 2)
Dy = Pow(Ya - Yb, 2)
If Dx >= Dy
If Xa <= Xb
DeplacX = Xb - Xa
DeplacY = (Yb - Ya) / DeplacX
Repeat
SetCursorPos_(Xa, Ya)
Xa+1 : Ya + DeplacY
Delay(2)
WindowEvent()
Until Xa >= Xb
Else
DeplacX = Xa - Xb
DeplacY = (Yb - Ya) / DeplacX
Repeat
SetCursorPos_(Xa, Ya)
Xa-1 : Ya + DeplacY
Delay(2)
WindowEvent()
Until Xa <= Xb
EndIf
Else
If Ya <= Yb
DeplacY = Yb - Ya
DeplacX = (Xb - Xa) / DeplacY
Repeat
SetCursorPos_(Xa, Ya)
Ya+1 : Xa + DeplacX
Delay(2)
WindowEvent()
Until Ya >= Yb
Else
DeplacY = Ya - Yb
DeplacX = (Xb - Xa) / DeplacY
Repeat
SetCursorPos_(Xa, Ya)
Ya-1 : Xa + DeplacX
Delay(2)
WindowEvent()
Until Ya <= Yb
EndIf
EndIf
If button = 1 : LeftClick() : EndIf
If Button = 2 : RightClick() : EndIf
EndProcedure
OpenWindow(0,0,0,400,400,"Test Mouse", #PB_Window_SystemMenu)
Target(390,5,1) ; Position bouton fermeture window
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Re: Simulation souris
Thx,
je matterais ca en temps voulu
je matterais ca en temps voulu
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: Simulation souris
Cool, ca marche bien sur facebook.
J'ai pu ajouté 1000 invitations sur fesses bouc
J'ai pu ajouté 1000 invitations sur fesses bouc
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: Simulation souris
Mr zuckerberg ne va pas être content.
@++
@++
Windows 10 x64, PureBasic 5.73 x86 & x64
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
Re: Simulation souris
J'ai eu 400 amis en 24h
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: Simulation souris
Beh alors là... Voir SPH chaluter, c'est bien la surprise qui devait me changer la tendance du moral.
Félicitation...
Félicitation...