-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mouse movement or speed is erratic in games (especially Wine) / Support relative mouse movement without uinput #28
Comments
+1 Normally this needs to be done from the application, not the system or container. |
I think that there should be a way for mouse behavior to work correctly even with the current configuration.
I suspect that this is because the mouse cursor movements should be compensated for this resolution difference. This explains why pointer mode is slower or faster when the remote vs local resolution is different. Communication between the screen size of the web interface and the screen size of the server to calculate the precise mouse movement intensity and sending to the X server with Xlib should be possible, and this may solve this issue without relying on uinput.
This is definitely related to relative mouse movement being sent as absolute mouse movements instead. I think going to pointer locked mode for 3D games such as The Witcher 2 is definitely adequate. If cursors of these applications or games catch the relative, also called the raw mouse motion, Xlib doesn't work correctly. There should also be a way to compensate this behavior in the web interface for the Python application to scale the remote screen size and the local screen size to properly send movements with Xlib. |
The issues I see while testing various games or applications that my colleagues lent me for testing (continuously updated, VKD3D indicates DirectX 12 applications run on Wine, DXVK indicates DirectX 9-11 applications run on Wine): Cyberpunk 2077 (VKD3D): Cursor disappears at start screen, tried to enter settings to see if it can be fixed but can't find the cursor. Unplayable. |
Did anyone solve this? I am having same issue when running GTA5 using wine. Mouse works fine for GTA Vice city but it is a little laggy but with GTA5 mouse movement is unpredictable even in main menu. Please can anyone help me how I can solve this. I think this is a very interesting project |
@joyflix99 Could you make the remote resolution same as the local resolution then use full screen mode on the web browser (reduce resolution locally as needed)? Also, try enabling fullscreen mode instead of borderless windowed mode on the Wine game. This configuration varies per game. |
@ehfd Thank you for such quick response :) I just tried that but it didn't help. I think I will try tracing mouse input in wine, I think it is somewhere in xinput11.c file. And rebuild it to read mouse input from unix pipe and then write mouse data to this unix pipe. There is one drawback to this approach, you will not be able to interact with anything outside wine. I will let you know how it goes |
@joyflix99 Check #55 as well for a similar attempt |
This issue mainly attributes to inputting the mouse movement without any scaling with Coordinating this with the window size of the web client can fix the issue. |
https://gist.github.com/loochek/f0d875fb8c2adcb92431e13868cbd079 This is a very interesting take and currently works for most Wine games. |
Mouse is completely unusable running UE4 game through Wine. Is there any solution? |
Alright I patched @loochek gist in and it does not improve my mouse issues. |
@vamman Ah, for mouse... I have that issue too, but it's a lot of work to do to fix it. One hint that I found is that it would work if there is a "game cursor mode" where the mouse cursor is fixed to the center of the screen and only relative movements, not absolute coordinates, are passed to X.org. |
Good, now I know my issue isn't just me ;) I have some potential ideas to solve this issue. Do you have a method that allows me to keep the browser cursor visible until I "click into" the application? For example in your EGL example the KDE cursor is present as soon as I mouse over the window. I want the native browser cursor visible until I click in. I also want the ability to hit the ESC key and the native browser cursor pop out. This is normal behavior for most "canvas" apps. They are using the Pointer Lock API. |
@vamman Note that Ctrl+Shift+Click already is the Pointer Lock API (it is in the docs). But even that is a bit finicky. All native games are okay and most Wine games work, though. Refer: #28 (comment) |
@vamman Try Ctrl+Shift+Click, and also try virtual desktop for Wine (Lutris has a setting for that, it restricts the cursors to the space). I'm not sure virtual desktop would work, but it could. |
Have you seen how cloud morph and Epic are handling this? Epic is actually grabbing the mouse position from the browser and sending it directly to their application via a web socket. Cloud morph does the same thing essentially but instead send mouse position to a generic exe that translates the position relative. I'll give the virtual desktop a try. |
Epic, as in pixel streaming? I know @adamrehn .
We also do this, but it's simply a bit unrefined. We just have to fine tune things and make sure it works out. My hypothesis is that in relative cursor mode, the absolute mouse cursor should be locked to the center and only make relative movements. Alternatively, if you aren't using containers, you could use
This is our code. Take a look at the section. I would appreciate if you could make suggestions. |
Absolutely, happy to take a look at this. I am using containers. |
https://github.com/selkies-project/selkies-gstreamer/tree/master/addons/gst-web/src Our web interface as well. |
@vamman There is an option on PlayOnLinux or Lutris called Mouse Warp Override. Setting it to forced could solve things, combined with the Wine Virtual Desktop. At least for what I experienced so far. |
Update: Perhaps, try using https://github.com/ValveSoftware/gamescope as an alternative. |
Please test #97 in Wine, if you follow. |
#28 (comment) One issue persists where the mouse movement speed is slower when the remote resolution is smaller than the local resolution, and vice versa. |
I have two issues with mouse pointer:
if pointer is not locked, mainly games cannot be controlled as mouse jumps randomly over screen. Could be related to resolution change? It does not happen e.g., with tuxracer. But it does happen in witcher 2.
if pointer is locked and remote and local resolution is significantly different, e.g., 4k vs. 1920x1080, pointer motion is very slow, acceleration should be adjusted.
The text was updated successfully, but these errors were encountered: