AutoHotkey Community

It is currently May 26th, 2012, 11:00 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: August 29th, 2008, 5:44 am 
Offline

Joined: August 29th, 2008, 4:47 am
Posts: 10
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2008, 9:11 am 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2008, 11:21 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject: Winner heresy
PostPosted: August 29th, 2008, 7:38 pm 
Offline

Joined: August 29th, 2008, 4:47 am
Posts: 10
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2008, 7:46 pm 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2008, 8:06 pm 
Offline

Joined: August 29th, 2008, 4:47 am
Posts: 10
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Winner heresy
PostPosted: August 29th, 2008, 9:16 pm 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Winner heresy
PostPosted: August 29th, 2008, 11:00 pm 
Offline

Joined: August 29th, 2008, 4:47 am
Posts: 10
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 4:40 am 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 5:05 am 
Offline

Joined: August 29th, 2008, 4:47 am
Posts: 10
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 August 30th, 2008, 5:26 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 5:22 am 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 5:26 am 
Offline

Joined: August 29th, 2008, 4:47 am
Posts: 10
Ill Try that...
Also, Is there a way to get this to work over a remote desktop conection?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 6:11 am 
Offline

Joined: August 29th, 2008, 4:47 am
Posts: 10
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 6:41 am 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 6:20 pm 
Offline

Joined: August 29th, 2008, 4:47 am
Posts: 10
heresy wrote:
try this and tell me what you got
Code:
MsgBox % DllCall("GetDoubleClickTime")


Still no luck.


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: [VxE], Bing [Bot], Klark92 and 62 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