Close

Page 1 of 7 123 ... LastLast
Results 1 to 10 of 61
  1. #1

    AutoHotkey and vJoy Script to allow mouse to be used with Keyboard (now with vXBox)

    Hello, I have taken an already existing mouse to joystick script created by Helgef on the AutoHotkey forums and modified it to work with CEMU in a more streamlined way.

    The script will allow you to control the virtual Joystick using your keyboard and mouse. The only keybinds that are hard coded into the script is that mouse movement is tied to the Right Stick, every other key is fully customizable. I've even created an interface that allows you easily set up your keys in a familiar manner.

    Code and Releases can be found on GitHub


    The following guide has been adapted from my original Reddit post.

    [Updated Video - April 5, 2018] [BSoD Gaming made a video] that shows how to set this up. It is incomplete, but for the most part it shows the initial process very well. It doesn't get into details about anything, and while it recommends using the alternate mouse movement detection be aware that this is still experimental and already implemented slightly different from the version used in the video. Also, changing your mouse sensitivity will only really have an effect with this experimental mode, not really on the normal mode. Along the same lines, the sensitivity he has in the settings are invalid (negative values make no sense with how it is implemented and might even cause issues), but again since he is using the alternate method they have zero effect on the program.



    For this to work you must have vJoy installed, I provide a compiled version of the AutoHotkey script, so AutoHotkey itself is not needed unless you want to run the script un-compiled.



    Initial Setup

    1. Install the latest vJoy
    2. Run the vJoy Configuration (Not necessary if you only plan on using vXBox)
      1. Set it up so it has at least 18 Buttons, I set mine to 32.
    3. Download controller profiles for CEMU > 1.9.0 (Also included in GitHub release zip)
      1. Extract these text files into your CEMU controllerProfiles folder
    4. Then open CEMU and goto the input settings
      1. Choose the type of controller you want to use, either 'Wii U Pro Controller' or 'Wii U GamePad'
      2. If using standard vJoy Device
        1. Choose DirectInput for the Controller API
        2. Make sure to choose the device as vJoy Device and confirm it says connected

      3. If using vXBox Device
        1. Run the script FIRST and choose 'Use vXBox Device' on the General Page of settings
          • If this is the first time you will be prompted to Install ScpVBus, choose yes, then yes again on the security prompt to run DevCon
          • Script will reload and if the message box doesn't show up again you should be ready to use vXBox.

        2. Choose XInput for the Controller API
        3. Make sure to choose a controller and confirm it says connected (May need to press refresh for Controller to show up)

      4. Not sure if necessary but Press Calibrate
      5. Choose the appropriate Profile for the type of controller you are setting up.
      6. Click Load


    For vJoy devices -- The input setup should look like this

    For vXBox devices -- The input setup should look like this
    • Note: feel free to manually remap the blow mic and showscreen buttons here, as the vXBox controller doesn't have enough buttons for them to be included.


    If it doesn't look like this, you are going to have a problem

    Using the Script and changing the key mapping

    1. Visit the GitHub release page and download the latest release
    2. Launch the script:
      1. Double click the .ahk file if you have AutoHotKey installed.
      2. Run the exe if you don't.
    3. IF you don't want to customize anything you are ready to use the Script.
      1. Press F1 to toggle the controller ( CEMU and Script must be running )

    Mapping your keys
    Open the script settings by right clicking on the controller icon in your system tray (Bottom Right) and choose 'settings'. (Or just Double click the icon)
    1. Goto the Mouse2Joystick->Keys page:
      1. You can set the KeyList here
        1. This is a comma separated list of AHK valid keys in order of vJoy Buttons
          1. The first key is mapped to Button 0 and so on.

        2. Manually setting the list has an advantage in that you can add more than one key to the same button (New as of 0.2.0.3)
          1. This is accomplished by adding the keys together using the | symbol.
            • i.e. you'll notice Xbutton1|e, is what I have set for A -- allowing Mouse4 and e to both work.

        3. I recommend setting up the keys with the Helper as below, then adding in any desired secondary keys manually.

      2. KeyList Helper
        1. This is an interface that closely matches CEMU input layout, which will make it easy to create your KeyList.
        2. You just need to click each box and then press the key you would like to use
          1. Can be mouse buttons

        3. AutoCycle will go through each key one by one allowing you to quickly set the keys
        4. When you click save you will see the KeyList string update itself with any changes you've made.
          1. If you'd like to add secondary keys now is a great time to do it.

    Note: you can still keep KeyList strings for different games saved to a text file locally, and just paste it in (like it used to have to be done)

    For an overview of the other settings check the original Reddit Post, or the GitHub ReadMe.

    Script Downloads


    GitHub Releases will be the best place to find the latest version of the script


    Alternate Direct Download

    Or you can download it directly from the end of this post.


    Extra Reminders

    1. Changing your keys within CEMU isn't recommended as it is tedious and finicky. The script allows you to easily change which key is assigned to which vJoy button. Then the button assignment in CEMU doesn't matter at all as long as each key has something.
    2. Note that the in-game camera settings affect the camera speed the most, so try changing there if camera speed is your only issue.
    3. If you run CEMU as an admin, then you need to run the script as an admin as well.





    Please feel free to comment here or on Reddit for help, or send me a PM.
    Attached Files Attached Files
    Last edited by CemuUser8; 16.04.2018 at 15:27. Reason: Added part about video guide that was made by BSoD Gaming

  2. #2
    Super-Moderator Serfrost's Avatar
    Join Date
    13.09.2017
    Posts
    156
    Dang, nice formatting. +10

  3. #3
    With vXBox, mouse cursor doesn't hide and randomly triggers left click on cemu(which switch the video output to gamepad)
    But it could be me having messed up the install, thought I no longer need vjoy so I uninstalled vjoy after scpvbus was installed and then reinstalled it (vjoy).
    I tried to manually reinstall scpvbus, but it gave me 'devcon.exe failed'.

  4. #4
    Quote Originally Posted by NAVras View Post
    With vXBox, mouse cursor doesn't hide and randomly triggers left click on cemu... thought I no longer need vjoy so I uninstalled vjoy after scpvbus was installed and then reinstalled it (vjoy).
    Yes vJoy is still required as it is what provides the vGenInterface.dll, just an alternate interface, that I attempted to wrap myself based off evilC's original code.

    If you enable the usevXbox setting and run the script does it ask you to install the ScpVBus still? if not then it must already still be installed correctly.

    I'm not sure why the script would stop acquiring the mouse any differently from previous versions, I've not encountered that in my testing. Do other keys, and mouse movement still work, just hiding and clicking broken?


    I did already update to version 0.3.0.1 because I noticed an AND instead of an OR in one of the vXBox button presses, causing strange behavior maybe that is related if the problem starts when pressing one of the thumb buttons?

    Let me know, as I want to make this to work as it opens up my script for much more than just CEMU even, XInput is used by a lot, and I've already tested in STEAM Big Picture and it looks promising.




    Edit: If everything looks good outside of CEMU can you try going to html5gamepad.com and enabling the controller (Still F1 by default) and seeing if it picks up XBOX 360 Controller
    Click image for larger version. 

Name:	RwIg1yh.png 
Views:	102 
Size:	42,2 KB 
ID:	47
    Last edited by CemuUser8; 21.09.2017 at 19:03.

  5. #5
    It didn't ask, guess I don't need to worry then~
    Click image for larger version. 

Name:	capture.PNG 
Views:	164 
Size:	54,0 KB 
ID:	48

    Anyway, found I just need to restart my computer... cursor now hides, testing left clicks with a lynel xD
    Edit: hmm.. random left click still there
    Last edited by NAVras; 21.09.2017 at 19:25.

  6. #6
    Quote Originally Posted by NAVras View Post
    Edit: hmm.. random left click still there
    Ok, I will do some more testing myself, just randomly clicking, and clicking as fast as possible. See if I can replicate the problem.

    I assume the problem doesn't occur if not using vXBox?


    Edit: I can't seem to reproduce the issue at all, I will test again on my Desktop at home, where I get better frames and will have more time.
    Last edited by CemuUser8; 21.09.2017 at 19:39.

  7. #7
    Oh no, still got the same problems without vxbox, tested with two mouses.
    Strange thing is that, if i power off then on my pc, cursor won't hide, but if i restart, it will...
    I'll try using a different usb port and reinstalling mouse driver.

    Here's my keylist, if it helps:
    e,LAlt,Space,Lbutton,q,3,LShift,RButton,Enter,Back space,1,2,y,n,g,j,b

    Edit:
    Click image for larger version. 

Name:	capture.PNG 
Views:	117 
Size:	4,5 KB 
ID:	49yea i don't have space in between
    Click image for larger version. 

Name:	capture.PNG 
Views:	390 
Size:	28,7 KB 
ID:	50cemu input setting

    It seems the left click is not caused by my mouse but keyboard?? I get those left clicks when pressing backspace and enter(can't reproduce enter)
    https://streamable.com/djyev
    Last edited by NAVras; 21.09.2017 at 21:12.

  8. #8
    Quote Originally Posted by NAVras View Post
    Oh no, still got the same problems without vbox, tested with two mouses.
    Strange thing is that, if i power off then on my pc, cursor won't hide, but if i restart, it will...
    I'll try using a different usb port and reinstalling mouse driver.

    Here's my keylist, if it helps:
    e,LAlt,Space,Lbutton,q,3,LShift,RButton,Enter,Back space,1,2,y,n,g,j,b
    That is certainly very strange behavior... I'm not a fan of how I hide the mouse cursor, but have yet to find a better way that works. Although in this case it seems like something else is going on as well.

    I'm not sure if it is the forum formatting strangely but when I copy paste your keylist I get: Back space instead of Backspace. I don't see how that could cause your issues, so if it really does have that extra space there it's probably not related.


    Quote Originally Posted by NAVras View Post
    It seems the left click is not caused by my mouse but keyboard?? I get those left clicks when pressing backspace and enter(can't reproduce enter)
    https://streamable.com/djyev
    Very Interesting, I will play around with your keylist later tonight.

    PS. Other quick thought, do you happen to have any other AutoHotkey script running, or anything else that would intercept input?
    Last edited by CemuUser8; 21.09.2017 at 21:25.

  9. #9
    hmm... i don't?
    (just tested, i don't get this problem with 0.2.0.3 tho)
    Last edited by NAVras; 21.09.2017 at 22:04.

  10. #10
    Quote Originally Posted by NAVras View Post
    hmm... i don't?
    (just tested, i don't get this problem with 0.2.0.3 tho)
    Good to know, I will do a code compare and see what I changed that could've introduced this bug. I know I added a lot of logic, I wonder if the button press code can take too long now? Not sure but will look into it.

    Thank you for your feedback, and willingness to test.

    Edit: So in version 0.2.0.3 there was an invisible window created by the script that overlayed the CEMU window. This would then be what received any fall through clicks I guess, however on my two computers I was never able to reproduce your bug so this is only a hypothesis.

    I removed that feature because it's sole purpose was to hide the cursor, however I was unable to make gyro controls work for aiming when it was present. I had switched the method of hiding the cursor, and thus removed the invisible GUI at the same time. I will work on making another solution to cover this case, even though it should in theory never be able to happen ( All Clicks should be intercepted by the script )


    Edit 2: Updated again to v0.3.1.0 which re-added the invisible window overlay. Should resolve this strange case.
    Last edited by CemuUser8; 22.09.2017 at 14:35.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •