Jump to content

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

Turn keyboard into Mouse


  • Please log in to reply
3 replies to this topic
7usabball
  • Members
  • 51 posts
  • Last active: Dec 03 2010 10:47 PM
  • Joined: 07 Jan 2009
Made by: 7usabball

Ps. This isn't my first script and this took me like 1 minute to make, but I thought it would be useful for some people.

I will be editing it to make it better and hopefully the mouse faster, haha.

SetDefaultMouseSpeed, 0 ; Sets the delay of mouse speed to instant
w::MouseMove, 0, -25, 100, R ; when you press w, mouse will move up 25 pixels
s::MouseMove, 0, 25, 100, R ; when you press s, mouse will move down 25 pixels
a::MouseMove, -25, 0, 100, R ; when you press a, mouse will move left 25 pixels
d::MouseMove, 25, 0, 100, R ; when you press d, mouse will move right 25 pixels
q::MouseClick, left ; when you press q, mouse will left click
e::MouseClick, right ; when you press e, mouse will right click
x::MouseClick, WheelDown ; when you press x, mouse will scroll down
2::MouseClick, WheelUp ; when you press 2, mouse will scroll up
^!z::ExitApp ; when you press ctrl+alt+z, the app will exit

If anyone could help me making the mouse move faster, that would be great. Also I will be editing this to make it much easier to use.

Why this was made you may ask?... Well I have a wireless mouse and sometimes it bugs out on me, so I figured this could help if my mouse ever bugs out again.

Note: I suggest making an autohoykey script like this, so you can open it when you need it, cause if your mouse bugs out like mine, then how are you suppose to get to the program and open it?

^!a::Run scriptname.ahk ; will run the script on ctrl+alt+a


I hope you enjoy this, and maybe someone could help me make the mouse move quicker, because 100 is the highest speed, and 0 is no delay.

TheLeO
  • Members
  • 264 posts
  • Last active: Jan 02 2012 01:51 AM
  • Joined: 11 Jun 2005
thank you for your effort, dude.
the wasd is actually quite a good idea, you should continue to work on the script, perhaps dynamic speeds, automatically move to certain buttons.. something like that would make it potentially really useful.


:)
::
I Have Spoken
::

rulfzid
  • Members
  • 62 posts
  • Last active: Mar 11 2011 08:31 PM
  • Joined: 27 Nov 2008
@7usabball

The 3rd argument in your MouseMove command (the "100"s) sets the MouseMove command to be the slowest it can be, so you can speed up your mouse by making that any number less than 100 (0 is instantaneous).

@everybodyelse

I was intrigued enough by this to make my own mouse moving script that moves the mouse faster the longer you hold down a direction AND allows you to move diagonally. I didn't add any of the clicking stuff because I was more interested in the movement algorithm. Please give me feedback, I'd love to hear what people think.

(shift+ any direction key(s) to move around)

#Persistent
SetDefaultMouseSpeed, 0 

; SETTINGS
; --------
; futz with these to get the movement as you'd like it
; the settings below are the ones i liked after just
; a few minutes of playing around
distance = 10         ; - how far the mouse moves each turn of the timer
multiplier = 1.08     ; - how much farther (exponentially) the mouse moves in
                      ;   a direction the longer you hold that direction down
CFKM = 30             ; - how often to run the timer

SetTimer, CheckForKeyMouse, %CFKM%

return

CheckForKeyMouse:
	if not GetKeyState("Shift")
		return
	GetKeyState("Down") ? (d*=multiplier) : (d:=1)
	GetKeyState("Up") ? (u*=multiplier) : (u:=1)
	GetKeyState("Right") ? (r*=multiplier) : (r:=1)
	GetKeyState("Left") ? (l*=multiplier) : (l:=1)	
	y := (d-u) * distance
	x := (r-l) * distance
	MouseMove, x, y, , R
return


EricCartman
  • Members
  • 60 posts
  • Last active: Oct 26 2010 12:50 PM
  • Joined: 13 Oct 2008
You're supposed to put "Yet Another" somewhere in the subject of any mouse-moving keyboard script post. I think it's in the forum rules. ;')