AutoHotkey Community

It is currently May 24th, 2012, 2:45 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: January 16th, 2007, 10:36 pm 
Offline

Joined: September 16th, 2006, 5:34 am
Posts: 27
I have a constant battle with my laptop's built-in pointer device randomly repositioning the focus of the screen to wherever the mouse pointer is located. I can be typing along in a text box (like this one) and suddenly what I am typing moves somewhere else in the text box or goes outside the text box and is seen as an attempted hotkey by by browser. I want to be able to "tie" the mouse pointer to the same location as the text cursor so that it follows along while I type in a text box. I'd love to do this in Autohotkey, but can't seem to figure out how to tell the position of the text cursor so that I can set the mouse location to that. If it is even possible, how could you then leave the text box when you were ready to do so? Anyone have any ideas?
D.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2007, 10:48 pm 
Code:
!y::BlockInput, MouseMoveOff ; Blocks the user to move the mouse cursor.
!x::BlockInput, MouseMove ; Allows the user to move the mouse cursor.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2007, 11:14 pm 
Offline

Joined: December 11th, 2006, 4:11 pm
Posts: 242
Location: Orlando, FL
Just adding on to what BoBo wrote. Instead of using Two seperate hotkeys, you could use one:
Code:
!y::
x+=1
If Mod(x,2) ;If x is an odd number, the statement will be true
   BlockInput, MouseMove
ELSE
   BlockInput, MouseMoveOff
RETURN

Hope this helps :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2007, 11:22 pm 
Offline

Joined: September 16th, 2006, 5:34 am
Posts: 27
BoBo wrote:
Code:
!y::BlockInput, MouseMoveOff ; Blocks the user to move the mouse cursor.
!x::BlockInput, MouseMove ; Allows the user to move the mouse cursor.
Freezing the mouse location would work, but is not the solution that I am looking for. For example, when I click the button to reply to your message, the mouse cursor stays in that location, while screen focus shifts to the reply text box on the resulting page. I *could* remember to manually move the cursor to someplace in the text box and freeze it, but that would only work if the location of the text that I was typing stayed in a constant relative position to the mouse cursor. Otherwise, when my screwed up laptop changed the focus back to the mouse, the cursor (and the location of the text I was typing) just changes to a pre-defined position and not to where the text cursor was originally. The only way freezing the cursor in a specific position would work is if it could be positioned at the very bottom right corner of the text box before freezing it, and there would be no need to correct or insert text above where you already had some.

Somehow, Windows knows when you are in a text entry area because the mouse cursor changes shape. Somehow, Windows knows where your text cursor is. I want to automatically, or with a set of hotkeys that can turn it on or off, tell Windows that if I am in a text input area, "marry" the text cursor location and the mouse cursor location.

Does that make sense?
D.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2007, 11:39 pm 
Offline

Joined: December 11th, 2006, 4:11 pm
Posts: 242
Location: Orlando, FL
It makes sense. And I'm sure somewhere out there is information that will allow you to do that.

Unfortunately, I am not the source of that information. :) Though, I think BoBo's solution should work for you in the meantime. If your laptop's mouse is "misfiring", then blocking the input should prevent the OS from reading those false inputs.

I think it's worth a try untill you can come up with a better way to work it.

P.S.- 3rd choice: buy a f$@%! new laptop! :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2007, 11:50 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
EDIT: Remember to change the IfWinActive
Code:
#persistent

SetTitleMatchMode, RegEx

CoordMode, Caret, Screen
CoordMode, Mouse, Screen

SetTimer, movemymouse, 100

Return

movemymouse:
  IfWinActive, ^UltraEdit
    MouseMove, %A_CaretX%, %A_CaretY%
Return


EDIT AGAIN: Fun to make, but don't work - unable to move the mouse cursor!

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2007, 11:54 pm 
Offline

Joined: September 16th, 2006, 5:34 am
Posts: 27
Jaytech wrote:
I think BoBo's solution should work for you in the meantime. If your laptop's mouse is "misfiring", then blocking the input should prevent the OS from reading those false inputs.
Does keeping the mouse from moving also eliminate whatever is changing the focus to that location?

Quote:
P.S.- 3rd choice: buy a f$@%! new laptop! :D
Would love to. Doesn't quite fit into my fixed disability income though. :(
D.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 12:01 am 
Check ---> Start/ControlPanel/Mouse/Button/ClickLock (disabled?)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 12:05 am 
Offline

Joined: September 16th, 2006, 5:34 am
Posts: 27
BoBo wrote:
Check ---> Start/ControlPanel/Mouse/Button/ClickLock (disabled?)
I'm on Windows 200 (this clinker won't run XP) and don't have a ClickLock option.
D.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 12:07 am 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
I've made a slight revision of my script make lbutton work as a toggle, click to release lock and click to lock at new position.
Still need some work, though.
Code:
#persistent

SetTitleMatchMode, RegEx

CoordMode, Caret, Screen
CoordMode, Mouse, Screen

SetTimer, movemymouse, 100

isEnabled = 1

Return

movemymouse:
  If Mod(isEnabled,2) = 1
  {
    IfWinActive, ^UltraEdit
      MouseMove, %A_CaretX%, %A_CaretY%
  }
Return

~LButton::isEnabled++

F11::reload

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 12:16 am 
Offline

Joined: November 27th, 2006, 3:06 pm
Posts: 69
You may also have a function key on your laptop to disable your touchpad if you use an external mouse or keyboardstick.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 3:25 pm 
Offline

Joined: September 2nd, 2006, 6:39 am
Posts: 279
Location: Scotland
djeaton3162 wrote:
Somehow, Windows knows when you are in a text entry area because the mouse cursor changes shape. Somehow, Windows knows where your text cursor is. I want to automatically, or with a set of hotkeys that can turn it on or off, tell Windows that if I am in a text input area, "marry" the text cursor location and the mouse cursor location.


The variable A_Cursor contains the name of the type of cursor that is on the screen. IBeam is the name of the cursor you get over a text field.

With this script when you press F1 it starts a loop that checks the name of the cursor.If the name is IBeam it disables user mouse movement, clicks to focus the window then "marries" the mouse cursor to the text cursor.

F2 unmarries it by reloading the script
Code:
F2::Reload
F1::
Loop,
{
Gosub, IbeamCheck
If y != 1
continue
BlockInput, MouseMove
Break
}
y := 0
click
SetTimer, FollowCaret, 100
return

FollowCaret:
MouseMove, %A_CaretX%, %A_CaretY%
return

IbeamCheck:
If A_Cursor = IBeam
y :=1
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 5:26 pm 
Offline

Joined: December 11th, 2006, 4:11 pm
Posts: 242
Location: Orlando, FL
@jps: Nice script, works perfectly :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 7:22 pm 
Offline

Joined: November 14th, 2006, 4:40 pm
Posts: 16
I had kind of the same issue but I solved it another way. When you start typing the mouse gets disabled and when you stop typing it renables.
http://www.autohotkey.com/forum/viewtopic.php?t=15816

_________________
Don't capture me again!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 7:29 pm 
Offline

Joined: September 16th, 2006, 5:34 am
Posts: 27
@jps: Very cool! Works great. The programming is a little above me though. I'll have to study it and learn from it. I have 20 years of programming experience but, for two years now, have suffered from neurological condition that keeps me from being able to do the mental stuff that once came so easy to me. The guys (and gals) on this forum are excellent sources of information though. You rank right up there with some of the most helpful people on the net. Thanks.
D.


EDIT: Why would this work when typing in a forum text box in IE or in Notepad or such, but *not* work in forum textbox in Firefox? In Firefox running on 2000, the mouse cursor goes to the top left corner of the screen. On XP, it goes to the top left of the text box.
D.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: azure, engunneer, jyloup, KenC, Pulover, Sambo and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group