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 Remap ! No Need For Mouse! (Update # 2)

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sun Nov 11, 2007 3:35 pm    Post subject: Mouse Remap ! No Need For Mouse! (Update # 2) Reply with quote

Pressing Capslocks with enable/disable the remapping
of the mouse





This script will remap the arrow keys to move the mouse .
Insert,Home,Delete,Page Down,and End keys to be the mouse buttons.

Credits To ahklerner for help with mouse move

Please read the help file below


Update
2007-11-11
There Is Now a GUI remapper

Update 2007-11-24
Better Performance
Caplocks Toggles On /Off

Code:

When Pressing The Middle Mouse Remap Button
Click It One Then User UP and DOWN Arrow
Keys

The Arrow Keys Control The Mouse

Up = Mouse Move Up
Down = Mouse Move Down
Left = Mouse Move Left
Right = Mouse Move Right


Home = MouseWheel Up

End = MouseWheel Down

Delete = Left Mouse Button

Page = Down Right Mouse Button

Insert = Middle Mouse Button



And For The Mouse Remap Script!

Code:
/*
When Pressing The Middle Mouse Remap Button
Click It One Then User UP and DOWN Arrow
Keys


 The Arrow Keys Control The Mouse

 Up = Mouse Move Up
Down = Mouse Move Down
Left = Mouse Move Left
Right = Mouse Move Right


Home MouseWheel Up

End MouseWheel Down

Delete Left Mouse Button

Page Down Right Mouse Button

 Insert Middle Mouse Button
*/
SetBatchLines -1
#UseHook
Increment = 1
MouseDelay = 0

Left::
Right::
Up::
Down::
xVal=
yVal=
If GetKeyState("CapsLock","T")
   {
      IncrementValue := Increment       
      Loop,
      {
      If (A_Index > IncrementValue * 15) and (IncrementValue < Increment * 5) 
         IncrementValue := IncrementValue * 2
      If GetKeyState("Down", "P")
         yVal := IncrementValue
      Else If GetKeyState("Up", "P")
         yVal := -IncrementValue
      If !yVal
         yVal := 0
      If GetKeyState("Left", "P")
         xVal := -IncrementValue
      Else If GetKeyState("Right", "P")
         xVal := IncrementValue
      If !xVal
         xVal := 0
      If GetKeyState(A_ThisHotKey, "P") 
         MouseMove, %xVal%, %yVal%,%MouseDelay%,R
      Else 
         Break
      }
   }
Else
   Send % "{" . A_ThisHotKey . "}"
return

Esc::ExitApp


Home:: Send {WheelUp}
End:: Send {WheelDown}
Delete:: Send {LButton}
PgDn:: Send {RButton}
Insert:: Send {MButton}




The new GUI Remapper



Code:
#SingleInstance Force
SetBatchLines -1
Menu, Menu, Add, Help, HelpFile
Menu, Menu, Add, Close, GuiClose
Gui, Menu ,Menu
Menu, Tray, NoStandard
Menu, Tray, Add, Remap Mouse, Remap
Menu, Tray, Add, Exit, GuiClose
Gui, Add, Button, x6 y10 w80 h30 gRemap, Remap Mouse
Gui, Show, x131 y91 h122 w280, Mouse Remapper
return

GuiClose:
ExitApp


HelpFile:
HText =
(
When Pressing The Middle Mouse Remap Button
Click It One Then User UP and DOWN Arrow
Keys


 The Arrow Keys Control The Mouse

 Up = Mouse Move Up
Down = Mouse Move Down
Left = Mouse Move Left
Right = Mouse Move Right


Home MouseWheel Up

End MouseWheel Down

Delete Left Mouse Button

Page Down Right Mouse Button

Insert Middle Mouse Button
)

msgbox, Help File,, %HText%


Remap:
 SetBatchLines -1
#UseHook
Increment = 1
MouseDelay = 0

Left::
Right::
Up::
Down::
xVal=
yVal=
If GetKeyState("CapsLock","T")
   {
      IncrementValue := Increment ; Set the Increment value (we change it)
       
      Loop,
      {
      If (A_Index > IncrementValue * 15) and (IncrementValue < Increment * 5) 
         IncrementValue := IncrementValue * 2
      If GetKeyState("Down", "P")
         yVal := IncrementValue
      Else If GetKeyState("Up", "P")
         yVal := -IncrementValue
      If !yVal
         yVal := 0
      If GetKeyState("Left", "P")
         xVal := -IncrementValue
      Else If GetKeyState("Right", "P")
         xVal := IncrementValue
      If !xVal
         xVal := 0
      If GetKeyState(A_ThisHotKey, "P") 
         MouseMove, %xVal%, %yVal%,%MouseDelay%,R
      Else ; we're not pressing the key...break the loop
         Break
      }
   }
Else
   Send % "{" . A_ThisHotKey . "}"
return

Esc::ExitApp

Home:: Send {WheelUp}
End:: Send {WheelDown}
Delete:: Send {LButton}
PgDn:: Send {RButton}
Insert:: Send {MButton}
return



Last edited by Fry on Sat Nov 24, 2007 10:36 pm; edited 4 times in total
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1249
Location: USA

PostPosted: Sun Nov 11, 2007 4:09 pm    Post subject: Re: Mouse Remap ! No Need For Mouse! Reply with quote

Fry wrote:
Credits To Enguneer for help with mouse move

Exclamation
_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

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

so sorry Embarassed

ill edit the post Embarassed

i get yuo two confused for some reason Embarassed
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Fri Nov 23, 2007 3:03 pm    Post subject: Reply with quote

has anybody used this yet ?
_________________
check out my site
www.eliteknifesquad.com
Back to top
View user's profile Send private message
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Fri Nov 23, 2007 4:21 pm    Post subject: Reply with quote

Yes, just a minute ago Smile
It works fine and I think I will keep it (well, integrate it in my big permanent script Wink )
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Fri Nov 23, 2007 4:24 pm    Post subject: Reply with quote

just please give credits to me if you use it in a script your going to release
_________________
check out my site
www.eliteknifesquad.com
Back to top
View user's profile Send private message
Bigrob55



Joined: 24 Sep 2007
Posts: 37

PostPosted: Sat Nov 24, 2007 12:30 pm    Post subject: Reply with quote

Awesome Script!

One question if i may, have u thought to make it so you can press two buttons at the same time.

To allow for diagonal mouse travel?
_________________
Bigrob

L337 Speak - A Ventrilo Client Side program

Winamp Sound Changer - Change Audio Output on the Fly!
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sat Nov 24, 2007 2:43 pm    Post subject: Reply with quote

actually you already can go diagonal

Left Arrow Key = Going Left Diagonally

Right arror key = going right diagonally
_________________
check out my site
www.eliteknifesquad.com
Back to top
View user's profile Send private message
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Sat Nov 24, 2007 9:32 pm    Post subject: Reply with quote

Fry wrote:
actually you already can go diagonal
I'm afraid you can't ...
But with ahklerner's example here you can Wink
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sat Nov 24, 2007 10:30 pm    Post subject: Reply with quote

actually you can .
look at this video




http://www.eliteknifesquad.com/diaganol.wmv
_________________
check out my site
www.eliteknifesquad.com
Back to top
View user's profile Send private message
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Sat Nov 24, 2007 10:49 pm    Post subject: Reply with quote

Please check out what diagonal means Rolling Eyes
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 689

PostPosted: Sat Nov 24, 2007 10:50 pm    Post subject: Reply with quote

i updated the code
_________________
check out my site
www.eliteknifesquad.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions 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