Please, how can i hold Windows+Ctrl key while MouseClickDraging?
Here is the code:
Send, {Win Ctrl Down}
CoordMode, mouse, screen
MouseClickDrag, left, 3181, 326 , 3769, 642
Thanks
You need to ensure that the hotkey you use to trigger the logic does not conflict with the keys you want to send, ie. don't use Win or Ctrl. With that being said, the following example uses F3. For the Win key, you need to specify left or right. Since it doesn't seem to be of importance, the example just assumes LWin.
CoordMode, mouse, screen
F3::
Send, {LWin down}{Ctrl down}
MouseClickDrag, left, 3181, 326 , 3769, 642
Send, {Ctrl up}{LWin up}
return
Related
Hope someone can help me with this.
I am trying to use Autohotkey to automate some menu navigation within figma.
Point is that the "WinMenuSelectItem" function somehow doesn't work.
While searching for this, i found a script to detect any clicked menu item, and tell its position.
Turns out that none of the menu items, were detected.
it made me suspect that probably Figma's Windows app is just a disguised web browser, so i have to approach this differently.
A solution could be to create my shortcuts through mouse position, but i once i switch screens, all the positioning will be messed.
Can someone help me?
Thank you!
Edit: As request, im going to paste the code i have right now.
But is almost of no use, as now i am using mouse movement to click on menu items, and this solution is both slow (on performing time) and as soon as i change screen resolution, those coordinates render useless.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^!+f1:: ; Go to main component
SendEvent {Click 28 63}
sleep, 100 ;
SendEvent {Click 93 228}
sleep, 400 ;
SendEvent {Click 291 464}
sleep, 100 ;
SendEvent {Click 550, 463}
CoordMode, Mouse, Screen
MouseMove, (A_ScreenWidth // 2), (A_ScreenHeight // 2)
return
^!+f2:: ; Plugin Papa component
SendEvent {Click 28 63}
sleep, 100 ;
SendEvent {Click 93 338}
sleep, 400 ;
SendEvent {Click 296 535}
sleep, 100 ;
CoordMode, Mouse, Screen
MouseMove, (A_ScreenWidth // 2), (A_ScreenHeight // 2)
return
^!+f3:: ; Copy Prototype link
SendEvent {Click 2374 69}
sleep, 400 ;
SendEvent {Click 1109 506}
return
I was wondering if this can be done in AutoHotKey that whenever I press Q the output should be Q and mouse right click. I tried
Q::MouseClick, right but this doesnt do the Q keystroke. Any help is appreciated.
As well as ~ you can send the ASCII character
q::
Send, {Asc 113}
mouseclick, right
return
My brain is borderline flat and I'm having no luck understanding what Up and Down mean. I only want the hotkey to hold left click for whatever amount of time. If anyone could provide the code used for that and maybe a short explanation of how Up and Down work (r/explainlikeim5) that would be greatly appreciated. :)
$Lbutton:: ;when you push left mouse button(Can be changed)
Sendinput, {LButton down} ; holds left mouse button down
Sleep, 1000 ; delay in miliseconds(1 second delay)
Sendinput, {LButton up} ; releases left mouse button
Return
There you go sir.
Can someone help me with my autohotkey script? I tried looking online for loop scripts, however when i activate it, it never stops. Even when i assign an stop command. I would like to assign the stop command to F1. Thank you
^!r::
WinWait, BlueStacks App Player,
IfWinNotActive, BlueStacks App Player, , WinActivate, BlueStacks App Player,
WinWaitActive, BlueStacks App Player,
MouseClick, left, 335, 574
Sleep, 100
MouseClick, left, 191, 134
MouseClick, left, 191, 134
Sleep, 100
MouseClick, left, 191, 134
Sleep, 100
Send, {CTRLDOWN}v{CTRLUP}{ENTER}
MouseClick, left, 29, 47
Sleep, 100
MouseClick, left, 104, 128
MouseClick, left, 104, 128
Sleep, 100
Send, {CTRLDOWN}v{CTRLUP}{ENTER}
MouseClick, left, 24, 58
Sleep, 100
MouseClick, left, 24, 58
Sleep, 100
return
Try:
F1::Reload
and make sure your hotkey doesn't accidentally trigger itself by sending ^!r.
Your looping structure is not allowing the escape hotkey to be called. Additionally try adding a pause:
p::Pause
If you can get your program to pause then add an exit:
Esc::ExitApp
Is it possible to trigger an AHK script based on the position of the mouse? Say, if I wanted to press a button or series of buttons on my keyboard if I move my mouse to the corner or edge of the screen. Also, can this be done multiple times per second until the mouse is moved out of the specified area?
All I could find from googling is AHK scripts for moving the mouse using the keyboard, when I want to do the opposite.
I did it, thanks Aaron and ahkcoder.
I got a little better feel with Up and Down instead of PgUp and PgDn, to anyone else, play with the timings until it's sufficient. You'll also need to modify the values for the edges of your screen.
; move up and down when mouse is at edges of screen
#Persistent
SetTimer, foo, 65
return
foo:
MouseGetPos, x, y, id, control
; ToolTip, %x% %y%
; will trigger only at edges of a full screen
if (y = 1087){
; bottom
send {Down}
send {Down}
send {Down}
; sleep, 300
}
else if(y = 8){
; top
send {Up}
send {Up}
send {Up}
}
return
Yes. Easiest way I can think of to do what you are asking is to use SetTimer and MouseGetPos to evaluate the position and if it matches than trigger your script.
The 2nd example code on the MouseGetPos is using SetTimer. This should get you headed in the right direction.