Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Right analog stick does not work as mouse #75

Open
bell07 opened this issue Nov 10, 2022 · 8 comments
Open

Right analog stick does not work as mouse #75

bell07 opened this issue Nov 10, 2022 · 8 comments

Comments

@bell07
Copy link

bell07 commented Nov 10, 2022

Configured the right stick to use as mouse for old game on Steam Deck with Gentoo.

    "rstick": {
        "action": "mouse()"
    }, 

evteston the "SCController Mouse" device returns no mouse input. The mouse is not moved :-(

How I can help to find the reason?

EDIT: Same setting on left stick work as expected. The right stick works fine as "stick" so there is no hardware issue.

@Ryochan7
Copy link
Owner

Ryochan7 commented Mar 8, 2023

The problem is definitely not uinput related then. Maybe it is a problem with the steamdeck driver in the program? RS mouse works in theory with the DS4 and DualSense but the actual behavior has always been wrong. Still tries to calculate deltas like when using a touchpad as input. I do not use SC Controller other than with the Steam Controller so I did not want to bother trying to correct the behavior.

@bell07
Copy link
Author

bell07 commented Apr 6, 2023

Tried the same with my Logitech F710: both sticks are useable as mouse as expected with this pad.
So I think the issue root is in steamdeck driver in program.

@Ryochan7
Copy link
Owner

I finally changed how the mouse action works with RS. It took some hackery but it feels better to me and it is closer to what I am used to from my other experiments. More of the actual computation is done in the mouse action rather than in the Mouse class (uinput.py).

fa32bb3

@bell07
Copy link
Author

bell07 commented Apr 16, 2023

unfortunately the change did not fix my issue. The right stick still not work as mouse

@gordon-quad
Copy link

I did a little investigation and it looks like following patch fixes rstick mouse on my deck, however it is a bit ugly.

--- a/scc/actions.py    2023-10-16 19:06:46.387956633 -0000
+++ b/scc/actions.py    2023-10-31 13:43:32.689125560 -0000
@@ -17,7 +17,7 @@
 OUTPUT_360_STICK_MIN, OUTPUT_360_STICK_MAX)
 from scc.constants import STICK_PAD_MAX_HALF, TRIGGER_MIN, TRIGGER_HALF
 from scc.constants import HIPFIRE_NORMAL, HIPFIRE_SENSIBLE, HIPFIRE_EXCLUSIVE
-from scc.constants import LEFT, RIGHT, CPAD, STICK, PITCH, YAW, ROLL
+from scc.constants import LEFT, RIGHT, CPAD, STICK, RSTICK, PITCH, YAW, ROLL
 from scc.constants import PARSER_CONSTANTS, ControllerFlags
 from scc.constants import FE_STICK, FE_TRIGGER, FE_PAD
 from scc.constants import TRIGGER_CLICK, TRIGGER_MAX
@@ -918,7 +918,7 @@
                #       mapper.mouse_move(x * self.speed[0] * 0.01, y * self.speed[1] * 0.01)
                #       mapper.force_event.add(FE_STICK)
                if ((what == STICK) or
-                       (what == RIGHT and mapper.controller_flags() & ControllerFlags.HAS_RSTICK)):
+                       (what == RSTICK and mapper.controller_flags() & (ControllerFlags.HAS_RSTICK | ControllerFlags.IS_DECK))):
                        ratio_x = x / (STICK_PAD_MAX if x > 0 else STICK_PAD_MIN) * copysign(1, x)
                        ratio_y = y / (STICK_PAD_MAX if y > 0 else STICK_PAD_MIN) * copysign(1, y)
                        mouse_dx = ratio_x * (mapper.time_elapsed * BASE_STICK_MOUSE_SPEED) * self.speed[0]

@Ryochan7
Copy link
Owner

Ryochan7 commented Nov 2, 2023

Not sure why HAS_RSTICK is not set in ControllerFlags for the Deck. Actions should not have to know what device is being mapped if it can be helped.

@Ryochan7
Copy link
Owner

Ryochan7 commented Nov 6, 2023

Now that I have mapper.py pulled up, I can see why HAS_RSTICK is not set for the Steam Deck module. Both the Right Stick and Right Touchpad use the same mapping id (RIGHT). Such a configuration works fine for the DS4 or DualSense as those controllers only include one touchpad (CPAD). It complicates matters when a device has two sticks and two touchpads like the Steam Deck.

mapper.py uses one workaround to use RSTICK as the mapping id in one portion of code. However, later in mapper.input, the conflict will happen. Some extra code will have to be changed. Also, I need to double check what SC Controller uses in the profiles for the Right Stick id.

@bell07
Copy link
Author

bell07 commented Dec 9, 2023

Confirm the "ugly fix" does solve my issue. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants