mouse2joystick.rar(no direct download)
Edit 3: New download link. No other changes.
Edit 4: Someone has done further work on this script, I mention it here in case someone is interested. Although, I know nothing about it, I will guess that it is probably better than my version. Please also see github.com/CemuUser8/mouse2joystick_custom_CEMU/releases.
The new script does both Mouse displacement to virtual joystick and to keyboard presses, as dicribed in the original post, see below. The following concerns mouse to virtual joystick:
It has the same features as the mouse to keyboard, but obviously doesn't send keys, but instead output to virtual joystick.
For mouse to virtual joystick, you need to install vJoy, from: http://vjoystick.sourceforge.net/site/
You don't need to install vJoy if you just want to use mouse to keyboard.
Additonal features for the virtual joystick output is:
- Non-linear sensitivity, if desired.
- Optional key binds to all virtual joystick buttons.
- The stick can be auto held in any position, so you can get back normal mouse functionallity, click around, and then switch back to controlling the stick, from where you left off.
- The stick can be fixed to at any radius.
- Options to invert both axes, might be redundant since probably most games can do it anyways.
- Angular deadzones can be modified, this is perhaps not a conventional term, but it means that you can modify the area in which only one axis is considered.
For example, if you move the mouse upwards, there is an area around the y-axis where you can't get any output to the x-axis, this is to enable full forward without left or right drift.
New general features:
- Autoactivate game can be disabled, wow!
- From the Tray menu, you can now click: Select game, and point and click on any running applictions window, to set its executable name as input destination.
- Toggle knob size, small/big.
- The key to get a good user experience is to modify the sensitivity, nonlinear sensitivity, deadzones, and perhaps the fallback pause, for each specific application.
- If you want to save your settings, make copies the settings.ini file and manually switch between different setting-setups. There is no profile managment.
- Default is mouse to joystick, you can change it in the settings dialog, Tray menu -> Settings -> General: Output mode.
- If vJoy is not installed you will be asked to either switch to mouse to keyboard or exit application.
To bind keys to joystick buttons, go to Settings->Mouse2Joystick->Keys: Keylist.
The key list should be a list of comma delimited keynames, that is valid ahk-keynames.
Eg, if you want to bind joystick button 1 and 5, to key b and ctrl+u, respectively, the keylist should look like this:
- Now also tested in Microsoft Flight Simulare 2004.
- http://vjoystick.sourceforge.net/site/ - vJoy device drivers, needed for mouse to virtual joystick.
- https://autohotkey.com/boards/viewtopic.php?t=5705 - CvJoyInterface.ahk
- crisangelfan and evilC on autohotkey.com forum provided useful input.
- Credit to author(s) of vJoy @ http://vjoystick.sourceforge.net/site/
- evilC did the CvJoyInterface.ahk
Below is the original post, it concerns the mouse to keyboard functionallity, it is now an option in the new script.
There was a request for a script that maps mouse movements to imitate a joystick.
In the end, I had spent a few more hours on it than originally intended, so I decided to complete it and add some more features and some setup options.
The main features are:
- Maps mouse displacment to eight keyboard combinations: UP, UP+RIGHT, RIGHT, RIGHT+DOWN, DOWN, DOWN+LEFT, LEFT, LEFT+UP.
- Mimics joystick feature: Apply pressure along just one axis will still roll the stick along the other, for a maximum of 90 degrees.
- A graphical overlay for visual aid.
- Options for sensitivity and minimum displacement before triggering any keyboard presses.
- Automatically activates game/application.
- Blocks game/application from taking control of the mouse when "joystick" is on (places an invisible gui over the game screen).
- Hide cursor if desired.
- Bind left and right mouse buttons to any key when "joystick" is on.
- Keys are pressed and hold down rather than repeatedly sent.
- By default there is a snap back to the center and a short mouse block when leaving the outer ring, this is to enable quick halt without immediately start going in the other direction, this can be disabled in the settings dialog.
- For the visual aid you need to put the images in a folder named "images" in the script folder. Script can be used without this though, will automatically disable the visual aid.
- Toggle on/off, default key: Winkey+s
- Exit app, defualt key: Winkey+q
- Move visual aid, default key: Winkey+d (By default visual aid is automatically placed)
- Default up/down/left/right keys are: w/a/s/d.
- Relevant settings are accessed via tray icon->settings.
- Specify the game's application name, default is notepad.exe for testing purposes.
- Game needs to be run in window mode. If this i a problem, then check out evilCs scripts, links below.
- If needed, modify the update rate via "freq"-parameter in script, this is not available in the settings dialog.
- There is little or none input validation in the settings dialog, don't try to break it.
- There will probably be bugs, you are welcome to report these.
- Tested only on Windows 7, ahk v1.1.22.09 64 bit, in quake live and notepad.
- You are welcome to report where it works and not.
- Check out evilCs more elaborate scripts, eg, UCR, UJR (related to joystick, but not mouse) and MouseDelta.
- Get a real joystick.
Shows the visual aid.
Orignial script, perhaps I'll keep it here as a historical monument.