Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Mouse Movement to Keypress


  • Please log in to reply
49 replies to this topic
Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
"I'm new to autohotkey. How do I configure your script to automatically reset the mouse after I activate a zone?"

You can add the following 2 lines to the script at exactly lines 165-166 (right before hKeys := zKeys). Will work for StickMode.

	If (hKeys = "DeadZone")
		GoSub, CenterMouse

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


dmg
  • Members
  • 2395 posts
  • Last active: Nov 04 2015 06:46 AM
  • Joined: 19 Nov 2010

This thread seems relevant:

http://www.autohotke...80-help-please/


"My dear Mr Gyrth, I am never more serious than when I am joking."
~Albert Campion

-----------------------------------------------------------------------------------------------
Website | Demo scripts | Blog | External contact

noxxle
  • Members
  • 3 posts
  • Last active:
  • Joined: 09 Jan 2013

You can add the following 2 lines to the script at exactly lines 165-166 (right before hKeys := zKeys). Will work for StickMode.
 

	If (hKeys = "DeadZone")
		GoSub, CenterMouse

Thanks!

 

I need something that will work for hover mode.  I'm using AHK on a Windows 8 Tablet.  I'm trying to play Magic the Gathering Online.  However, the in-game "ok" button is very small and hard to press.  It frequently takes 3-4 attempts to hit it.  Tapping the button quickly is necessary because it advances to the next step during a player's turn.  There can be many steps per turn, depending on the cards played. Other players will leave early if the turns take too long.  3-4 tap attempts per step easily adds up to 20-30 attempts per turn.  What I'd like to do is configure the "left" deadzone to press a shortcut key that corresponds to the ok button.



Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
In that case it should probably be
	If (hKeys <> "DeadZone")
		GoSub, CenterMouse

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


Oby
  • Members
  • 11 posts
  • Last active: Jan 31 2013 04:52 PM
  • Joined: 10 Dec 2012
On my machine the script (from my last spoiler) works (but not perfectly reliable), that is:

Pressing Ctrl+t remaps the mouse move directions to the ARROW KEYS and makes the cursor hold position.

Pressing Ctrl+t again, deactivates this remapping and so on.

Did You try that script?

 

Sorry Babba but I must not be endowed because I am not on to understand what I have to make.

Thus if I understood well, I have to make ctrl+t moved the mouse in the sense which I want at the same time as the touch arrows.

If it is good it, it does not walk.



noxxle
  • Members
  • 3 posts
  • Last active:
  • Joined: 09 Jan 2013

In that case it should probably be

	If (hKeys <> "DeadZone")
		GoSub, CenterMouse

This almost works.  I have the shortcut key set to the Right deadzone.  However, I must press on any of the other deadzones to return the mouse to the center.  This is necessary for the right zone to function again.

 

The previous script with "=" instead of "<>" will work so long as I click in the middle deadzone before using my Right zone shortcut.  However, if I double click (or merely tap the right zone too fast) the right zone stops working until I again tap the center.


Any ideas?



strobo
  • Members
  • 359 posts
  • Last active: Mar 10 2015 08:13 PM
  • Joined: 19 Jun 2012

@Oby:

The intended function of the script is that moving the mouse has no effect to the cursor but the arrow keys are sent.
Ctrl+t only toggles the intended function on and off.
Maybe, it just doesn't work on your machine.


Regards,
Babba

Oby
  • Members
  • 11 posts
  • Last active: Jan 31 2013 04:52 PM
  • Joined: 10 Dec 2012

Thank you for your patience thus the mouse is good to block but it does not send touches arrows.

Thus a priori it is not possible to block the cursor but what the mouse remains active to send touches.



kaekruse
  • Members
  • 4 posts
  • Last active:
  • Joined: 02 May 2013

pullover, have you ever looked into glovepie.

 

 

If you download the latest version of gloviepie and run this script example   http://glovepie.org/...ript:MouseParty

 

 

you will see that you can control a fake cursor which will allow you to send keys to the computer without sending input the the System Mouse.

 

you have to have multiple mice for this to work.  It works great on a laptop if you have your touchpad as mouse 1 and your plug in usb as mouse 2.

 

then you can assign keys to the mouse 2 movements and the system mouse will only be controlled by the mouse 1 touchpad.



Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
Looks interesting, I must take some time to try it. Maybe it's a better option for what's been requested in this thread.

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


chrisb114
  • Members
  • 8 posts
  • Last active: Nov 11 2015 08:56 PM
  • Joined: 21 Feb 2013

Hey another disabled guy here loving the script it works great. Was wondering can the scrip be made to simulate xbox 360 joystick movements? for flightsim games. cuse ppjoy is anoying lol



Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012

Hey another disabled guy here loving the script it works great. Was wondering can the scrip be made to simulate xbox 360 joystick movements? for flightsim games. cuse ppjoy is anoying lol

 

Hi Chris,

 

Unfortunately AHK cannot send joystick inputs. Have you tried VJoy?


Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


chrisb114
  • Members
  • 8 posts
  • Last active: Nov 11 2015 08:56 PM
  • Joined: 21 Feb 2013

thanks for the tip i'll check it out. Keep up the good work.



chrisb114
  • Members
  • 8 posts
  • Last active: Nov 11 2015 08:56 PM
  • Joined: 21 Feb 2013
hey your script works well with vjoy. How can I have the deadzone moved to the bottom left of the screen? instead of the center all the time?

Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012

hey your script works well with vjoy. How can I have the deadzone moved to the bottom left of the screen? instead of the center all the time?

 

You'll have edit this part:

; Get the coordinates for the center of the screen to create a Dead Zone:
DeadZoneX := A_ScreenWidth / 2
DeadZoneY := A_ScreenHeight / 2

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!