| View previous topic :: View next topic |
| Author |
Message |
xellow
Joined: 29 Aug 2008 Posts: 10
|
Posted: Fri Aug 29, 2008 4:44 am Post subject: Need to freeze mouse movment using hotkey. $25.00+ Reward |
|
|
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.
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 |
|
 |
heresy
Joined: 11 Mar 2008 Posts: 291
|
Posted: Fri Aug 29, 2008 8:11 am Post subject: |
|
|
| 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 |
|
 |
n-l-i-d Guest
|
Posted: Fri Aug 29, 2008 10:21 am Post subject: |
|
|
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
|
Posted: Fri Aug 29, 2008 6:38 pm Post subject: Winner heresy |
|
|
| 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 |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1390 Location: The Interwebs
|
Posted: Fri Aug 29, 2008 6:46 pm Post subject: |
|
|
| 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 |
|
 |
xellow
Joined: 29 Aug 2008 Posts: 10
|
Posted: Fri Aug 29, 2008 7:06 pm Post subject: |
|
|
| 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 |
|
 |
heresy
Joined: 11 Mar 2008 Posts: 291
|
Posted: Fri Aug 29, 2008 8:16 pm Post subject: Re: Winner heresy |
|
|
| 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 |
|
 |
xellow
Joined: 29 Aug 2008 Posts: 10
|
Posted: Fri Aug 29, 2008 10:00 pm Post subject: Re: Winner heresy |
|
|
| 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 |
|
 |
heresy
Joined: 11 Mar 2008 Posts: 291
|
Posted: Sat Aug 30, 2008 3:40 am Post subject: |
|
|
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 |
|
 |
xellow
Joined: 29 Aug 2008 Posts: 10
|
Posted: Sat Aug 30, 2008 4:05 am Post subject: |
|
|
| 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 |
|
 |
heresy
Joined: 11 Mar 2008 Posts: 291
|
Posted: Sat Aug 30, 2008 4:22 am Post subject: |
|
|
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 |
|
 |
xellow
Joined: 29 Aug 2008 Posts: 10
|
Posted: Sat Aug 30, 2008 4:26 am Post subject: |
|
|
Ill Try that...
Also, Is there a way to get this to work over a remote desktop conection? |
|
| Back to top |
|
 |
xellow
Joined: 29 Aug 2008 Posts: 10
|
Posted: Sat Aug 30, 2008 5:11 am Post subject: |
|
|
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 |
|
 |
heresy
Joined: 11 Mar 2008 Posts: 291
|
Posted: Sat Aug 30, 2008 5:41 am Post subject: |
|
|
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 |
|
 |
xellow
Joined: 29 Aug 2008 Posts: 10
|
Posted: Sat Aug 30, 2008 5:20 pm Post subject: |
|
|
| heresy wrote: | try this and tell me what you got
| Code: | | MsgBox % DllCall("GetDoubleClickTime") |
|
Still no luck. |
|
| Back to top |
|
 |
|