Multiple keypads-to-virtual-joysticks remapping work-around
Posted: 11 Aug 2014, 02:51
I'm rather new to AHK, I've only dabbled a bit with it the last month or so. I suppose this might be useable (if only in a few instances), so I'm posting this here (maybe it should be under "gaming", I wasn't too sure where to put it).
I've managed to hack together a solution of sorts for remapping multiple keyboard's numpads to virtual controllers. I think any HID compatible keypads and other similar devices also works. As windows basically don't distinguish between keyboards connected to the system, the solution was to use an external program (HIDMacros) that can, which in turn calls some AHK scripts pushing virtual joystick buttons.
vJoy_ButtonPusherDaemon.ahk is the main thing that can configure it all (except vJoy virtual controllers - this have to be configured first), generates HIDMacros macros automatically (atm for numpads only), etc. HIDMacros in turn use HIDsendVJ.ahk to tell vJoy_ButtonPusherDaemon which buttons to, yeah, push. (Lame name but whatever). Only momentary button presses are used atm, of about 0.1 seconds.
Requires (in short):
- AutoHotKey (as the scripts are not compiled)
- HIDMacros configured and running in the background.
- vJoy virtual controllers installed and configured.
- vJoy_ButtonPusherDaemon.ahk configured and running in the background.
Plus a couple of other bits (vJoy SDK). Installation instruction included in the ReadMe.txt file.
Possibly somewhat messy code, a mix of my own dabblings with forum code
Keep in mind this is basically a work-around for multiple keyboards (or numpads, really). And also that the remapped keys should not be used by themselves in a game (or whatever program you use). Only the remapped virtual buttons should be used, or else the keyboards won't be distinguished (which makes all of this pointless...).
Some acknowledgements:
I could never have done this without the following helpful links:
evilC's excellent ADHD AHK Dynamic Hotkeys for Dummies
XX0's thread: Multiple keyboards workaround
And axlar's posts in the thread Using AHK to control vJoy
Also, evilC's UJR (Universal Joystick Remapper) deserves a mention, for one since I "borrowed" the idea of a Quickbind method And also since it offers more advanced remapping options (axis combining etc).
EDIT: Just a minor correction (vJoy must be configured separately first).
I've managed to hack together a solution of sorts for remapping multiple keyboard's numpads to virtual controllers. I think any HID compatible keypads and other similar devices also works. As windows basically don't distinguish between keyboards connected to the system, the solution was to use an external program (HIDMacros) that can, which in turn calls some AHK scripts pushing virtual joystick buttons.
vJoy_ButtonPusherDaemon.ahk is the main thing that can configure it all (except vJoy virtual controllers - this have to be configured first), generates HIDMacros macros automatically (atm for numpads only), etc. HIDMacros in turn use HIDsendVJ.ahk to tell vJoy_ButtonPusherDaemon which buttons to, yeah, push. (Lame name but whatever). Only momentary button presses are used atm, of about 0.1 seconds.
Requires (in short):
- AutoHotKey (as the scripts are not compiled)
- HIDMacros configured and running in the background.
- vJoy virtual controllers installed and configured.
- vJoy_ButtonPusherDaemon.ahk configured and running in the background.
Plus a couple of other bits (vJoy SDK). Installation instruction included in the ReadMe.txt file.
Possibly somewhat messy code, a mix of my own dabblings with forum code
Keep in mind this is basically a work-around for multiple keyboards (or numpads, really). And also that the remapped keys should not be used by themselves in a game (or whatever program you use). Only the remapped virtual buttons should be used, or else the keyboards won't be distinguished (which makes all of this pointless...).
Some acknowledgements:
I could never have done this without the following helpful links:
evilC's excellent ADHD AHK Dynamic Hotkeys for Dummies
XX0's thread: Multiple keyboards workaround
And axlar's posts in the thread Using AHK to control vJoy
Also, evilC's UJR (Universal Joystick Remapper) deserves a mention, for one since I "borrowed" the idea of a Quickbind method And also since it offers more advanced remapping options (axis combining etc).
EDIT: Just a minor correction (vJoy must be configured separately first).