1

I am trying to make a script in linux that uses Shift + right click in eight desired positions.

I already tried to emulate autohotkey in linux but it doesn't work correctly.

This is an example of autohotkey code "+" means "Shift" on autohotkey

Send +{Click 842, 464, right}  
Send +{Click 853, 530, right}
Send +{Click 783, 531, right}
Send +{Click 713, 529, right} 
Send +{Click 715, 461, right}
Send +{Click 714, 395, right}
Send +{Click 785, 394, right}
Send +{Click 852, 395, right}
MouseMove, StartX, StartY
Peyman Mohamadpour
  • 17,954
  • 24
  • 89
  • 100
Tibia REC
  • 11
  • 1
  • 1
    I doubt AHK can work well on Linux, because it depends on a lot of Windows-specific syscalls and APIs. – D. Pardal Jun 02 '20 at 11:40
  • yes thats why i want to convert this script to autokey – Tibia REC Jun 03 '20 at 03:59
  • i have tried this but i think is very fast if is possible to add like wait ms:10 ``` # Enter script code keyboard.press_key("") mouse.click_absolute(882, 504, 3) keyboard.release_key("")``` – Tibia REC Jun 03 '20 at 19:54
  • It is possible to split up and down instructions. You can for example do ```Send, {Shift down}{Click down, right}``` put a delay (```Sleep, X```) and then ```Send, {Click up, right}{Shift up}```. – scso Jun 10 '20 at 11:57

1 Answers1

1

The equivalent Autokey script would be something like this:

system.exec_command("xte 'mousemove 842 464' 'mouseclick 3'", False)
system.exec_command("xte 'mousemove 853 530' 'mouseclick 3'", False)
...

where xte must be installed.

See this example: https://github.com/autokey/autokey/wiki/Scripting#gnome-screenshot

Carlos Galdino
  • 302
  • 3
  • 14
  • 1
    AutoKey has some mouse event functionality once you get a newer version than 0.90.4, but calling out to external programs as this answer does will usually work better. It's an area of the program which needs enhancement. – Joe Oct 11 '20 at 14:19