I would like my keyboard numpad to fuction as a joystick and am not sure if it can be done in the way Id like it. I understand I will not have the variable speed of a joystick; pressing a button will cause the cursor to travel at a set speed unless of course I add a hotkey that speeds it up or slows it down etc, etc.
I have only been using AHK for 1 day and have since partly modified this very basic script (below) but I thought before I proceed to painstakingly scour the internet for days and weeks scraping together scraps of information here and there before I finally understand what Im doing and how to do it....... I should first find out if its even possible.
--------------------------------------------------------------------------------------------------------------
---SCRIPT---
Code: Select all
*Numpad8::MouseMove, 0, -10, 0, R ; => Move cursor N
*Numpad2::MouseMove, 0, 10, 0, R ; => Move cursor S
*Numpad4::MouseMove, -10, 0, 0, R ; => Move cursor W
*Numpad6::MouseMove, 10, 0, 0, R ; => Move cursor E
*Numpad7::MouseMove, -10, -10, 0, R ; => Move cursor NW
*Numpad9::MouseMove, 10, -10, 0, R ; => Move cursor NE
*Numpad1::MouseMove, -10, 10, 0, R ; => Move cursor SW
*Numpad3::MouseMove, 10, 10, 0, R ; => Move cursor SE
*<#RCtrl:: ; LeftWin + RightControl => Left-click (hold down Control/Shift to Control-Click or Shift-Click).
SendEvent {Blind}{LButton down}
KeyWait RCtrl ; Prevents keyboard auto-repeat from repeating the mouse click.
SendEvent {Blind}{LButton up}
return
*<#AppsKey:: ; LeftWin + AppsKey => Right-click
SendEvent {Blind}{RButton down}
KeyWait AppsKey ; Prevents keyboard auto-repeat from repeating the mouse click.
SendEvent {Blind}{RButton up}
return
These are the directions I would like and are written in compass format to avoid confusion:
8=N
6=E
2=S
4=W
7=NW
9=NE
3=SE
1=SW
7+4=WNW
7+8=NNW
9+8=NNE
9+6=ENE
3+6=ESE
3+2=SSE
1+2=SSW
1+4=WSW
- I would like the cursor movement to be silky smooth whether it be slow or fast, no jumping and jittering, no swishing across the screen forcing you to wait until it stops 'playing' like a movie. It should travel at a constant rate too from start to finish.
- When I press and hold 4 for instance it should respond instantly and only be moving because my finger is on the button. When I release it it should stop instantly. There should be no autorepeat delay after the intial button press and hold.
- If my finger is on 4 for example and I press and hold 8 as well it should not stop 4 then switch to 8; it should continue with 4 and initiate 8 as well combinding both directions effectively giving me a NW direction, and if I let go of 8 it should of course continue only with 4 so long as my finger is on the button. Although 7 is assisgned NW above it needs to be so so that when I press and hold both 7+8 for instance (if its possible) I get NNW giving me even finer control of my movement. Pressing any other non-directional key (a third perhaps like 5) should not interfere with the keys currently being pressed and vice versa, unless otherwise specified.
---------------------------------------------------------------------------------------------------------------
These points below are more a matter of interest/curiosity/nitpicking although since I am planning on using this for gaming too, point * would be a nice additional parameter if possible:
* I have experimented with another program which allowed smooth HIGH speed cursor movement with my keyboard however if I tapped and released a key quickly the cursor would intially jump or jolt in that direction and then from that point on proceeed to move smoothly. It wasnt very noticeable when pressing and holding the button down but a quick tap would cause a mini teleportation if you will. Is it possible to avoid this initial jump with this program? I would ideally like it to move differently based on how quickly the button is pressed and released, for example if I tap and release 4 quickly the cursor moves only a little even though the press and hold speed is high, similar to when youre playing a game and trying to get as close to an edge as possible without falling off as you tap tap tap the forward button. If I was playing a game with this 'joystick' numpad it would be usefull to have this feature when looking around to save me having to press another hotkey to reduce sensitivity/speed for small movements however I dont want it to interfere when Im trying to lock-on to a target by being laggy either. Perhaps Im asking for too much.
**I am interested in experimenting with different acceleration to decceleration rates. I like the idea of holding down numpad enter and then tapping and releasing 4 for example and the cursor in essence responds as though it were a flicked ball SO LONG AS numpad enter is held down. It could either 'roll' for a while but eventually slow down to a stop or continue on indefinitely based on how 'hard' it was flicked. By hard I mean if * above is possible a quick tap (nudge) would cause a subtle movement and a slightly longer harder press a flick/full movement. Releasing numpad enter would STOP ALL movement and pressing another direction whilst the cursor is moving would combine movements like expressed higher above. I get the feeling I have really overdone it with this one.
***I have noticed that when I press ctrl,alt,delete and go into task manager AHK stops working. Assuming that I am able to do all above, is there a way to get Windows to always recognise these 'commands'? I seem to recall reading something about a program that lets you alter your registry so that Windows takes these commands seriously. Will it work with simulated mouse/joystick movements too?
---------------------------------------------------------------------------------------------------------------
I have taken a long time to write this as clearly as I can. I would greatly appreciate it if you responded in at least a little more patience and clarity in you explainations than you normally would, as if explaining an Ipad to an elderly person lol. As stated above I only started using AHK yesterday and have much to learn. If you have some idea of what youre doing but are not 100% sure in some area please say so so that I know what to take to heart and what needs more input from another / learning on my behalf.
MANY THANKS