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 

Need to freeze mouse movment using hotkey. $25.00+ Reward
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
xellow



Joined: 29 Aug 2008
Posts: 10

PostPosted: Fri Aug 29, 2008 4:44 am    Post subject: Need to freeze mouse movment using hotkey. $25.00+ Reward Reply with quote

I am a CG artist/photographer for www.jgroupstudios.com I developed Tendon injury in both arms from excessive mouse/tablet usage. I needed to use a no hands mouse with out spending a fortune, so I attached a Gyration Go (Wiimote Like Mouse) to my head and can easily move the mouse using slight head moments & Mouse click using a foot switch.

The problem is I need to be able to freeze the cursor so I can double click and to re-adjust my head positioning with out cursor movement. The Gyration Go mouse has a trigger for this purpose but this button doesn't show in KeyHistory which makes it a MysteryKey. Sad

So...
I need some script coding genius.
Description of what script I need:

Holding "Hotkey" allows mouse movment.
Release same "HotKey" = Cursor is frozen in place.
*Mouse buttons must work while cursor is frozen.

or

Name of the trigger key on the Gyration Go (Mystery Key name)

This is a critical step toward my wellness and career productivity, I will pay reward $25.00 US (Paypal only) to solution winner. Bonus $10.00 US (PayPal) If it works in video games. Yea I know its cheap, but it's the best I can do.

Thanks in advance,

Kyle Gruba
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Fri Aug 29, 2008 8:11 am    Post subject: Reply with quote

Code:
LCTRL::BlockInput, MouseMoveOff
LCTRL UP::BlockInput, MouseMove


hotkey in the code is Left Control. change to whatever you want
_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com
Back to top
View user's profile Send private message
n-l-i-d
Guest





PostPosted: Fri Aug 29, 2008 10:21 am    Post subject: Reply with quote

If someone offers a solution, consider donating to AutoHotkey instead.
________________________________________________________
New here? Please, before you post...
1. Read the tutorial and try the examples. -> 2. Take a look at the command list to get an idea of what you could do. -> 3. Create your script. Consult the documentation and the FAQ if you get stuck. -> 4. Search the forum if you need help or examples, method 1 (forum), method 2 (site), method 3 (Google). -> 5. Post your code on the forum in the "Ask for Help" section if you still run into problems (but read this first). -> 6. There is more AHK on autohotkey.net and the Wiki and there is an AHK IRC chat.
Back to top
xellow



Joined: 29 Aug 2008
Posts: 10

PostPosted: Fri Aug 29, 2008 6:38 pm    Post subject: Winner heresy Reply with quote

heresy wrote:
Code:
LCTRL::BlockInput, MouseMoveOff
LCTRL UP::BlockInput, MouseMove


hotkey in the code is Left Control. change to whatever you want


Heresy I sent you a PM. $25.00 winner (no $10.00 bonus, Script didn't work in Crysis)

Also, I want to enable/disable script by double clicking same hotkey, or by pressing different hotkey.

n-l-i-d your right, next solution that shows up here, I will donate.
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 1390
Location: The Interwebs

PostPosted: Fri Aug 29, 2008 6:46 pm    Post subject: Reply with quote

Code:
LCTRL::
If (A_PriorHotkey = A_ThisHotkey && A_TimeSincePriorHotkey < 500)
  Suspend
Else
  BlockInput, MouseMoveOff
Return
LCTRL UP::BlockInput, MouseMove

SomeOtherHotkey::
BlockInput, MouseMoveOff
Suspend
Return


Is this what you mean?
Back to top
View user's profile Send private message AIM Address
xellow



Joined: 29 Aug 2008
Posts: 10

PostPosted: Fri Aug 29, 2008 7:06 pm    Post subject: Reply with quote

Krogdor wrote:
Code:
LCTRL::
If (A_PriorHotkey = A_ThisHotkey && A_TimeSincePriorHotkey < 500)
  Suspend
Else
  BlockInput, MouseMoveOff
Return
LCTRL UP::BlockInput, MouseMove

SomeOtherHotkey::
BlockInput, MouseMoveOff
Suspend
Return


Is this what you mean?


Close, You guys are amazing. It disables right, but it really needs to be enabled again from a disabled state with doubleClick LCTRL or someOtherHotkey.
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Fri Aug 29, 2008 8:16 pm    Post subject: Re: Winner heresy Reply with quote

xellow wrote:
Heresy I sent you a PM. $25.00 winner


hello xellow.
it's not my power, it's AutoHotkey's
hence i'd love to see you donating to AutoHotkey instead as n-l-i-d suggested.

however here's the extended version.
it uses only one hotkey (Left Control). supports On/Off Toggle by double pressing.


Code:
dct:=DllCall("GetDoubleClickTime")
BlockInput, MouseMove
Return

~LCTRL::
if !Toggle
{
    BlockInput, MouseMoveOff
    KeyWait, LCTRL
    BlockInput, MouseMove
}
KeyWait, LCTRL
if (A_PriorHotkey=A_ThisHotkey && A_TimeSincePriorHotkey <= dct)
{
    Toggle := !Toggle
    BlockInput, % Toggle ? "MouseMoveOff" : "MouseMove"
    ToolTip % Toggle ? "Off" : "On"
    SetTimer, ToolTipOff, 1500
}
Return

ToolTipOff:
ToolTip
Return

_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com
Back to top
View user's profile Send private message
xellow



Joined: 29 Aug 2008
Posts: 10

PostPosted: Fri Aug 29, 2008 10:00 pm    Post subject: Re: Winner heresy Reply with quote

heresy wrote:
xellow wrote:
Heresy I sent you a PM. $25.00 winner


hello xellow.
it's not my power, it's AutoHotkey's
hence i'd love to see you donating to AutoHotkey instead as n-l-i-d suggested.

however here's the extended version.
it uses only one hotkey (Left Control). supports On/Off Toggle by double pressing.


Code:
dct:=DllCall("GetDoubleClickTime")
BlockInput, MouseMove
Return

~LCTRL::
if !Toggle
{
    BlockInput, MouseMoveOff
    KeyWait, LCTRL
    BlockInput, MouseMove
}
KeyWait, LCTRL
if (A_PriorHotkey=A_ThisHotkey && A_TimeSincePriorHotkey <= dct)
{
    Toggle := !Toggle
    BlockInput, % Toggle ? "MouseMoveOff" : "MouseMove"
    ToolTip % Toggle ? "Off" : "On"
    SetTimer, ToolTipOff, 1500
}
Return

ToolTipOff:
ToolTip
Return


This script works exactly like the simple version; double pressing isn't doing any thing for me. Right now I'm using:
Code:

RALT::BlockInput, MouseMoveOff
RALT UP::BlockInput, MouseMove
F11::BlockInput, MouseMoveOff


To achieve the need but thats a different hotkey.
A working Double Press would be the best.
Thanks to the efforts!
Donating now.
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Sat Aug 30, 2008 3:40 am    Post subject: Reply with quote

i've missed just 'else' but it should have working even without it.
run below snippet first to test that you got it right
script was tested.

Code:

dct:=DllCall("GetDoubleClickTime")

~LCTRL::
if (A_PriorHotkey=A_ThisHotkey && A_TimeSincePriorHotkey <= dct)
    MsgBox, Working
Return



Fixed One
Code:
dct:=DllCall("GetDoubleClickTime")
BlockInput, MouseMove
Return

~LCTRL::
if !Toggle
{
    BlockInput, MouseMoveOff
    KeyWait, LCTRL
    BlockInput, MouseMove
}
else
    KeyWait, LCTRL
if (A_PriorHotkey=A_ThisHotkey && A_TimeSincePriorHotkey <= dct)
{
    Toggle := !Toggle
    BlockInput, % Toggle ? "MouseMoveOff" : "MouseMove"
    ToolTip % Toggle ? "Off" : "On"
    SetTimer, ToolTipOff, 1500
}
Return

ToolTipOff:
ToolTip
Return

_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com
Back to top
View user's profile Send private message
xellow



Joined: 29 Aug 2008
Posts: 10

PostPosted: Sat Aug 30, 2008 4:05 am    Post subject: Reply with quote

heresy wrote:
i've missed just 'else' but it should have working even without it.
run below snippet first to test that you got it right
script was tested.

Code:

dct:=DllCall("GetDoubleClickTime")

~LCTRL::
if (A_PriorHotkey=A_ThisHotkey && A_TimeSincePriorHotkey <= dct)
    MsgBox, Working
Return



Fixed One
Code:
dct:=DllCall("GetDoubleClickTime")
BlockInput, MouseMove
Return

~LCTRL::
if !Toggle
{
    BlockInput, MouseMoveOff
    KeyWait, LCTRL
    BlockInput, MouseMove
}
else
    KeyWait, LCTRL
if (A_PriorHotkey=A_ThisHotkey && A_TimeSincePriorHotkey <= dct)
{
    Toggle := !Toggle
    BlockInput, % Toggle ? "MouseMoveOff" : "MouseMove"
    ToolTip % Toggle ? "Off" : "On"
    SetTimer, ToolTipOff, 1500
}
Return

ToolTipOff:
ToolTip
Return


Double Press LCTRL still has no MouseMoveOff effect for me- I Tested on xp 32bit & Vista 64bit.
?May be I run the script wrong by pasting it into the main AutoHotKey Notepad script?
Still Using F12::BlockInput, MouseMoveOff
And have been Working Productively all day again thanks to your amazing help!!


Last edited by xellow on Sat Aug 30, 2008 4:26 am; edited 2 times in total
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Sat Aug 30, 2008 4:22 am    Post subject: Reply with quote

if you've merged it with other scripts. that might be the reason.
running this script independently will clarify it
_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com
Back to top
View user's profile Send private message
xellow



Joined: 29 Aug 2008
Posts: 10

PostPosted: Sat Aug 30, 2008 4:26 am    Post subject: Reply with quote

Ill Try that...
Also, Is there a way to get this to work over a remote desktop conection?
Back to top
View user's profile Send private message
xellow



Joined: 29 Aug 2008
Posts: 10

PostPosted: Sat Aug 30, 2008 5:11 am    Post subject: Reply with quote

NeverMind!! It works in remote desktop as long as it is windowed not fullscreen.
Maybe VideoGames work the same
also
Im still having no luck with Double press feature.
Back to top
View user's profile Send private message
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Sat Aug 30, 2008 5:41 am    Post subject: Reply with quote

try this and tell me what you got
Code:
MsgBox % DllCall("GetDoubleClickTime")

_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com
Back to top
View user's profile Send private message
xellow



Joined: 29 Aug 2008
Posts: 10

PostPosted: Sat Aug 30, 2008 5:20 pm    Post subject: Reply with quote

heresy wrote:
try this and tell me what you got
Code:
MsgBox % DllCall("GetDoubleClickTime")


Still no luck.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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