04-13-2021, 11:37 AM
I gave a shot at the rest of your question. Hope it helps.
Note:
Macro VerticalOrHorizontalCursorMovement
Trigger a
Note:
- I keyboard-triggered it to the letter a. I tried to trigger it from Ctrl key up/down but couldn't do it easily through the menu's. Maybe you or Gintaras knows how.
- I had to use rep loop with ifk- break instead of 'wait K' (wait for for key up) because wait for key up doesn't seem to work if initial trigger is set to be eaten. Maybe there is another better way to manage it. But seems to work!
Macro VerticalOrHorizontalCursorMovement
Trigger a

int vertical;;;;0 horizontal, 1 vertical
POINT P0; xm P0 ;;save mouse position in P
int sx sy sw sh; GetVirtualScreen sx sy sw sh
double dHeight = sh
double dWidth = sw
double scaleCorrection = dWidth/dHeight
out scaleCorrection
WaitForMouseAction(1);err ret
0.01
POINT P1; xm P1
int xdiff = P1.x-P0.x
if xdiff < 0; xdiff =xdiff*-1
int ydiff = P1.y-P0.y
if ydiff < 0; ydiff =ydiff*-1
if xdiff > (ydiff*scaleCorrection);
,vertical = 0
,OnScreenDisplay "horizontal" 1 0 0 "" 0 0 32
else
,vertical=1
,OnScreenDisplay "vertical" 1 0 0 "" 0 0 32
RECT r
if vertical
,r.top=sy
,r.bottom=sy+sh
,r.left=P0.x
,r.right=P0.x
else
,r.left=sx
,r.right=sx+sw
,r.top=P0.y
,r.bottom=P0.y
ClipCursor &r
rep 10
,0.5
,ifk-(a)
,,break
ClipCursor 0