AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mouse to Key

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
pbrad
Guest





PostPosted: Sun Nov 11, 2007 6:50 pm    Post subject: Mouse to Key Reply with quote

Hi there, I'm new to the program - is it possible for example to move the mouse left instead of the keyboard d pad left, etc.. so the d pad is being controlled by the mouse?
Back to top
Xander



Joined: 23 Sep 2007
Posts: 140

PostPosted: Sun Nov 11, 2007 11:03 pm    Post subject: Reply with quote

Yes.

Code:
Left:: MouseMove, -1, 0, , R

Should do the job.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Sun Nov 11, 2007 11:13 pm    Post subject: Reply with quote

he wans the other way around

You can probably adapt a gesture script?

dpad on keyboard or gamepad?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Xander



Joined: 23 Sep 2007
Posts: 140

PostPosted: Sun Nov 11, 2007 11:21 pm    Post subject: Reply with quote

Ahh, is the mouse not suppose to move or is that not important? You'd probably have to poll for the mouse position every 10-50 ms depending on the response tolerance you require.

Probably would be best to reset the mouse to the middle of the screen after each poll as it could probably get stuck at the screen edge.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Sun Nov 11, 2007 11:26 pm    Post subject: Reply with quote

perhaps you can adapt http://www.autohotkey.com/forum/viewtopic.php?p=147488#147488
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
pbrad
Guest





PostPosted: Tue Nov 13, 2007 8:58 am    Post subject: Reply with quote

Thanks very much for replies, what I want to do is there are some "shoot them up" games and I got to use a joypad or keyboard to shoot, but I thought that maybe I could get the mouse to act as the d pad cause it would be a lot easier to play them!
Back to top
pbrad
Guest





PostPosted: Tue Nov 13, 2007 9:19 am    Post subject: Reply with quote

So I don't mind if the mouse to move the gamepads d pad or the keyboards d pad, but the keyboard would be more intresting as it could be used for other things,
Back to top
happytodd



Joined: 12 Nov 2007
Posts: 83
Location: South Australia

PostPosted: Tue Nov 13, 2007 9:32 am    Post subject: Trust me! Reply with quote

Where theres a will theres a way.
_________________

Back to top
View user's profile Send private message Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Tue Nov 13, 2007 5:11 pm    Post subject: Reply with quote

i was asking because AHK cannot simulate gamepad inputs, but can simulate keyboard.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Xander



Joined: 23 Sep 2007
Posts: 140

PostPosted: Tue Nov 13, 2007 5:33 pm    Post subject: Reply with quote

pbrad wrote:
So I don't mind if the mouse to move the gamepads d pad or the keyboards d pad, but the keyboard would be more intresting as it could be used for other things,

Did you get it working?

If not here is a short script that might be useful. It may be necessary to change SendMode to get it to work with different windows/games.

Code:
#NoEnv
CoordMode, Mouse, Screen
CenterX := A_ScreenWidth/2
CenterY := A_ScreenHeight/2
MouseMove, CenterX, CenterY
SetTimer, PollMouse, 30
return

!x::
   ExitApp
   
PollMouse:
   MouseGetPos, x, y
   if (x < CenterX) {
      Loop, % CenterX - x
         Send, {Left}
   } else if (x > CenterX) {
      Loop, % x - CenterX
         Send, {Right}
   }
   if (y < CenterY) {
      Loop, % CenterY - y
         Send, {Up}
   } else if (y > CenterY) {
      Loop, % y - CenterY
         Send, {Down}
   }
   MouseMove, CenterX, CenterY
   return
Back to top
View user's profile Send private message
pbrad
Guest





PostPosted: Wed Nov 14, 2007 1:17 pm    Post subject: Reply with quote

thanks for helping, I havent got much further
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group