CemuUser8 / mouse2joystick_custom_CEMU

An AutoHotkey Script to allow the use of Mouse and Keyboard control in CEMU. This uses vJoy and provides several additional features over regular keyboard control, like: the ability to control the camera with the mouse, toggle walking speed, in BotW use MouseWheel to change weapons, a separate Toggle key for ZL useful for locking onto a target in BotW.
182 stars 54 forks source link

Additional Functional Suggestions #22

Open Samsik2 opened 4 years ago

Samsik2 commented 4 years ago

The YUZU emulator also confirmed that it works normally when you select Vbox.

Sometimes I have to work with the keyboard instead of the mouse, but there are no duplicates.

Keyboard operation, not mouse operation, allows multiple keys to be available at the same time.

ex> 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) 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.

If possible, I would like to create a space under D-UP, DOWN, LEFT, and RIGHT on the keylist helper screen so that you can use the keyboard to manipulate the analog stick on the left.

Or, you may want to create a space next to the keyboard movement screen.

CemuUser8 commented 4 years ago

I've never used the YUZU emulator so I may just not understand, but to clarify.

You want to be able to control the RIGHT analog stick with the keyboard, and not the mouse?

Does that mean you want the mouse to control the LEFT analog stick? or no mouse use at all?

OR

Do you just want to be able to map more than one key at a time to the LEFT analog stick? so you can say have "W" and "UP" both work?

Samsik2 commented 4 years ago

The reason I asked you this question is because of Diablo 3 for YUZU.

Most games have only 8-axis direction and can play the game well. The current version also works well in regular FPS games.

114

In the case of Diablo 3 console, 14-axis analog stick operation is required for equipment replacement.

I remembered that there was MouseToJoystick in CEMU, so I installed it.

But CEMU was designed to replace the analog stick on the right for a typical game.

Diablo 3 made the manufacturer move the equipment replacement compartment to the left analog stick used to move from the equipment replacement screen.

I replaced the contents of lstick and rstick in qt-config and confirmed that the mouse was operating normally in Diablo 3.

115

The problem was that the mouse2joystick_custom_CEMU was unable to operate the working analog stick on the keyboard at the same time.

111 112 113

If this happens, the movement of the character should be done only with the mouse, but it is impossible. However, it was not possible to use the mouse2joystick_custom_CEMU only when replacing the equipment.


https://github.com/0x384c0/MouseToJoystickYuzu

Here's a program made by Auto Hotkey that works with YUZU.

This program makes the analog stick(right or left) work with the mouse as the keyboard works.

If the WSAD is set to the analog stick, it can work with the keyboard and also with the mouse.

By the way, this program is simple and recognizes only 4 directions, so you can enter only 8 axes.

https://www.autohotkey.com/boards/viewtopic.php?t=20703 The outer ring is divided into twelve (invisible) segments.

Original mouse2joystick.Ahk supported the 12-axis.


https://wiki.rpcs3.net/index.php?title=Help:Binding_Mouse_to_analog_sticks

https://github.com/RPCS3/rpcs3/issues/4461 Left and Right analog keyboard circle approximation issue #4461

https://github.com/RPCS3/rpcs3/pull/5468 Add mouse movement and stick lerp settings #5468

In rpcs3, the mouse2joystick method seems to be turned on and off.


The solution I've come up with is:

  1. Assign a keyboard that can operate the right analog stick. In this case, you can only use the mouse when replacing the equipment and the keyboard when moving.

'KeyList=XButton1|e' in the same way as 'Mouse shaft|WASD', etc. to operate simultaneously with the keyboard.

1-1 111_2

1-2 112_2

it's even better if you can choose either left or right in the program.

  1. Produce a mouse2joystick exclusively for Diablo 3. MouseToJoystickYuzu works simultaneously with the keyboard and creates a MouseToJoystick to support the 14-axis.

https://www.autohotkey.com/boards/viewtopic.php?t=20703

All you have to do is insert the directional key you want to enter here and specify the toggle key.

If the user specifies the specific directional key they want, they can only turn it on during equipment replacement and turn it off in normal situations.

  1. Change the setting of MouseToJoystickYuzu.

; key bindings KEY_MAP := { RIGHT : "6", DOWN : "5", LEFT : "4", UP : "8"} ; pix/sec. larger value - slower movement MOUSE_SPEED_CAP = 100 ; sec. larger value - larger lag, but larger accuracy SAMPLING_RATE = 0.05

; init private variables maxPixelsPerSample := MOUSE_SPEED_CAP SAMPLING_RATE dutyCycleFull := SAMPLING_RATE 1000

I don't know programming, so even if I change the number, it doesn't work as smoothly as mouse2joystick_custom_CEMU.

The most convenient solution would be to modify the figures to make Diablo 3 and 14 axes work.

Samsik2 commented 4 years ago
    ; Use set by index.
    ; x = 1, y = 2.
    IF ( (!a AND vXbox) OR (a AND !vXBox) ) { ; IF (GetKeyState("RButton") OR a ) {
        axisX := 4 <------ 1
        axisY := 5 <------ 2

Modifying this part will cause the mouse to adjust the left analog stick.

Equipment replacement works normally.

Instead, it becomes difficult to move the character with the keyboard. The character stops and does not move normally.

If the mouse loses its movement, the analog stick operation on the mouse will be turned off, and if the character moves only with the keyboard, it will work normally.


actionm2k(seg)
{   
    ; This is for mouse2keyboard. mouse2joystick calls action().
    ; 1 is down, 0 is up newState:=[w a s d] 
    if (seg=1 || seg=12)            ;   Keys down:
        changeStateTo([0,0,0,1])    ;   d               
    else if (seg=2)
        changeStateTo([0,0,1,1])    ;   s+d
    else if (seg=3 || seg= 4)
        changeStateTo([0,0,1,0])    ;   s
    else if (seg=5)
        changeStateTo([0,1,1,0])    ;   a+s
    else if (seg=6 || seg=7)
        changeStateTo([0,1,0,0])    ;   a
    else if (seg=8)
        changeStateTo([1,1,0,0])    ;   w+a
    else if (seg=9 || seg=10)
        changeStateTo([1,0,0,0])    ;   w
    else if (seg=11)
        changeStateTo([1,0,0,1])    ;   d+w
    else
        return -1 ; error
    return
}

This is the content of mouse2joystick, which is the prototype of this program.

Originally it supports 12 directions, but the '12, 4, 7, 10' orientation is integrated with the other direction keys and only recognizes 8 directions.

It seems to be because the keyboard is only 0(Off) and 1(On).