AutoHotkey Community

It is currently May 27th, 2012, 1:24 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Turn keyboard into Mouse
PostPosted: February 23rd, 2009, 11:47 pm 
Offline

Joined: January 8th, 2009, 12:42 am
Posts: 51
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.

Code:
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?

Code:
^!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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2009, 4:04 am 
Offline

Joined: June 11th, 2005, 9:34 am
Posts: 264
Location: England ish
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
::


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2009, 8:57 am 
Offline

Joined: November 27th, 2008, 9:44 am
Posts: 62
@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)

Code:
#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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2009, 11:51 am 
Offline

Joined: October 13th, 2008, 4:14 pm
Posts: 60
Location: South Park, Colorado
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. ;')


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, Yahoo [Bot] and 12 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