Jump to content

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

AutoHotKey Along side windows Mouse Keys


  • Please log in to reply
7 replies to this topic
chris2200
  • Members
  • 5 posts
  • Last active: Feb 03 2014 03:03 PM
  • Joined: 28 Jan 2014

http://windows.micro...e-mouse-pointer

 

Numpad6::Run Notepad will work with mousekeys off but as soon i put mousekeys on it will not.

 

I need to be able to press LButton & Numpad6 to trigger a right click. 

 

It is for people with disabilities who use switches instead of a mouse or keyboard. Switch input works with mouse keys to move the mouse just like a keyboard would, unfortunately a right click hasn't been added. So i was trying to create a auto key with LButton & Numpad6 to trigger a right click. 

 

But mousekeys setting on seems to break autohotkey as it doesn't notice Numpad6 being pressed.

 

If anyone can write this script you would be helping a lot of people. 

 

 



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012


Selecting a mouse button

Before you use Mouse Keys to click items on your screen, you must first select which mouse button you want to be the active button: the left button, the right one, or both.

To Press

Select the left mouse button

The forward slash (/)

Select both buttons

The asterisk (*)

Select the right mouse button

The minus sign (-)

 

Why not have users hit - and then right click?



chris2200
  • Members
  • 5 posts
  • Last active: Feb 03 2014 03:03 PM
  • Joined: 28 Jan 2014

The numpad will not trigger autohotkeys with mousekeys setting on 

NumpadDiv::Run Notepad

Will work with mousekeys off not with mousekeys on



chris2200
  • Members
  • 5 posts
  • Last active: Feb 03 2014 03:03 PM
  • Joined: 28 Jan 2014

the script could even be if numpad6 pressed twice like a double click then right click 

but with mousekeys on autohotkey does not see numpad6



chris2200
  • Members
  • 5 posts
  • Last active: Feb 03 2014 03:03 PM
  • Joined: 28 Jan 2014

The algorithm could work as

 

if lclick down & mousemoved <10 pixels right then trigger right click.

 

would anyone know how to right that in ahk?



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Does holding down Shift produce any different results from the key? (It's the same as hitting NumLock and then pressing the numbers) What if you use Sticky Keys in Windows to hold down the Shift Key for whomever you are trying to help with this?

 

The algorithm could work as

 

if lclick down & mousemoved <10 pixels right then trigger right click.

 

would anyone know how to right that in ahk?

 

LButton:: ;(Left Click)
GetMousePos, X1, Y1
KeyWait, LButton ; Wait for the LButton to be released
GetMousePos, X2, Y2
X3:=X1-X2
Y3:=Y1-Y2
If(-10<X3<10)&&(-10<Y3<10)
{
Send RButton
}
Return

 

This should work, but it's untested. You could also add a "hold down lbutton for so long" by doing this:

 

LButton:: ;(Left Click)
GetMousePos, X1, Y1
Time1:=A_Sec
KeyWait, LButton ; Wait for the LButton to be released
GetMousePos, X2, Y2
Time2:=A_Sec
X3:=X1-X2
Y3:=Y1-Y2
Time3:=Time1-Time2
If(Time3<0)
Time3+=120 ; Add 60 to a value if the time becomes negative. For example, taking the time at X:X1:20 and holding it for 45 seconds would yield X:X2:05. Time3 would originally be -15, but adding 60 will yield the correct time elapsed. ;
If(-10<X3<10)&&(-10<Y3<10)&&(Time3>3) ; Set to no movement more than 10 pixels in both horizontal and vertical directions and the mouse needed to be held down for more than 3 seconds
{
Send RButton
}
Return

 

Both of these are untested.



chris2200
  • Members
  • 5 posts
  • Last active: Feb 03 2014 03:03 PM
  • Joined: 28 Jan 2014

Both get Error on line 2 this line does not contain an a reconized action



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Whoops, it should be MouseGetPos instead of GetMousePos. My mistake. If I am still wrong, it would be MousePosGet, but I believe it's MouseGetPos.