AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

horizontal pointer wrap

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
shortmort37



Joined: 27 Aug 2008
Posts: 3

PostPosted: Wed Aug 27, 2008 8:06 pm    Post subject: horizontal pointer wrap Reply with quote

Hi, I'm an AHK newbie. I'm interested to know if anyone's developed a pointer wrap that is constrained to wrap in the horizontal only -- I want to block wrapping vertically. "Edgeless" works beautifully, but lacks that constraint.

adTHANKSvance,
Dan
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Wed Aug 27, 2008 8:20 pm    Post subject: Reply with quote

Something like this?

Code:
#singleinstance force
#persistent
setbatchlines, -1
coordmode, mouse, screen
settimer, mouseget, 25
return

mouseget:
mousegetpos, x, y
if (x = 0)
   mousemove, % a_screenwidth, % y, 0
if (x = a_screenwidth-1)   
   mousemove, 0, % y, 0
return

_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Wed Aug 27, 2008 11:20 pm    Post subject: Reply with quote

Code:
; Buttersmooth mod of Serenity's script
#singleinstance force
#persistent
setbatchlines, -1
coordmode, mouse, screen
settimer, mouseget, 1
mouseget:
mousegetpos, x, y
if !Mod(x, a_screenwidth-1)
   mousemove, % x ? 1 : A_ScreenWidth-2, % y, 0
return

_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Wed Aug 27, 2008 11:59 pm    Post subject: Reply with quote

Thanks [VxE]! :D

I wanted to try this for the active window but it isn't always catching the window edges:

Code:
#singleinstance force
#persistent
setbatchlines, -1
coordmode, mouse, screen
settimer, mouseget, 1
return

mouseget:
mousegetpos, x, y
wingetpos,,, w, h, a
if !Mod(x, w-1)
   mousemove, % x ? 1 : w-1, % y, 0   
if !Mod(y, h-1)
   mousemove, % x, % y ? 1 : h-1, 0     
return

_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Thu Aug 28, 2008 12:50 am    Post subject: Reply with quote

Code:
; Buttersmooth mod of Serenity's script
#singleinstance force
#persistent
setbatchlines, -1
coordmode, mouse, relative
settimer, mouseget, 1

mouseget:
mousegetpos, x, y, hwnd
wingetActiveStats, t, w, h, wx, wy
ifWinNotActive, AHK_ID %hwnd%
   MouseMove, % Mod(x + w, w), % Mod(y+h,h), 0
return
Very Happy
_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
shortmort37



Joined: 27 Aug 2008
Posts: 3

PostPosted: Fri Aug 29, 2008 1:56 pm    Post subject: Reply with quote

Way Cool! I can't believe I'm just now finding out about autohotkeys. This is great!

I think I need help with a couple refinements, though. I neglected to point out a couple things:

1) I'm working in a multiple display environment, and
2) the display resolution is mixed.

I actually can have 3 or 5 displays; there is a control monitor on the left of resolution 1280x1024, and 2 or 4 diagnostic monitors on the right of resolution 1200x1920 ( portrait mode -- this is for a radiology application).

Additionally -- since the task bar actually is positioned on the leftmost Dx monitor, the ULHC of the control monitor is (-1280,0).

When I roll off the rightmost Dx monitor, I want the pointer to appear on the left of the control monitor; and vice versa. However, it's possible for the pointer to roll off at, say, (2399, 1900). Since it can't appear on the control monitor at (-1280,1900), it would have to be moved into real space. If Windows permits assigning the pointer a non-real location, the script would then have to take this into account, and move it to (-1280, 1023).

adTHANKSvance
Dan
Back to top
View user's profile Send private message
shortmort37



Joined: 27 Aug 2008
Posts: 3

PostPosted: Mon Sep 01, 2008 12:06 am    Post subject: Reply with quote

Hmmm... No takers?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group