ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.67k stars 618 forks source link

[CS 1.6] macOSX 10.10-10.14.4 mouse input locks up local video+sound #2396

Open systemcrash opened 5 years ago

systemcrash commented 5 years ago

videos

Video 1 - problem starts after 30 seconds, first mouse clicks around 42 seconds. Video1 of this Youtube Video1 of this download Demo recorded during video1 which hopefully captures all inputs and game engine events.

Video 2 - problem starts immediately. video2 showing unprovoked onset Youtube video2 showing unprovoked onset download

Both of the video download versions contain keypresses captured into a subtitle track.

Above videos have netgraph enabled which help illustrate some of the underlying parts of the problem. When green pixels start to go upward and indicate lag etc, they indicate mouse button 1 is being depressed.

Build

Build:

] version Protocol version 48 Exe version 1.1.2.7/Stdio (cstrike) Exe build: 15:53:18 Apr 3 2019 (8196)

Problem description/symptoms

When playing CS1.6 (hl_osx) windowed (Option->Video->Run in a window ON, vertical sync OFF, click the green fullscreen button on window bar) on macOS, before starting any gaming, I occasionally need to 'unstick' my mouse.

Sometimes I initially find that I can only turn my character left as far as my mouse would go left in a window, and my character can only turn right as far as my mouse would go right in a window like the mouse stops at edge of window, until I "raw on/off console open/close" a few times until I can get full rotation and free movement with the mouse 'unbound and unhindered' by any window bounding box limitations.

Some unknown combination of events causes lockup on mouse1 to reappear, and after a new round begins (not always this event though), clicking +mouse1 (fire) will jam and all video+sound freezes, until I release the mouse button, but all online play continues, where I sometimes find myself killed, unless I perform an emergency unstick procedure. Doesn't always work first time.

Unstick procedure

open then close the command console (tilde ~) and raw on/off the mouse a few times usually gets things working.

I tried just about every suggestion that seemed related in Steam forums. No dice. I've been enduring this issue for YEARS.

Note: I run windowed so I can relocate my window to my external monitors.

Potentially related issues https://github.com/ValveSoftware/halflife/issues/1504

mikela-valve commented 5 years ago

When I saw your video the first thing I thought of was that you might be running windowed, so I'm glad to see that you are. There are a couple of mouse issues with macOS and possibly Linux as well. These are the two I know about:

  1. Some mouse directions do not work or do not work well with raw input disabled. This is probably #1504.
  2. The video sometimes locks up temporarily when clicking while running windowed. This is what you're seeing. I don't think this happens when running full-screen.

I believe 2. is caused by the mouse going outside of the game window while it is captured and clicking causes some error or some kind of processing that doesn't normally occur when clicking inside of the window.

This is either caused by something in SDL or by mouse handling in GoldSrc. I'm planning to update the version of SDL for GoldSrc and other Valve games soon so if that doesn't fix this then I'll look into the mouse handling to see if something is going awry. In the meantime, I believe you can fix in the meantime this by bringing up the console and mousing into the window then closing the console.

systemcrash commented 5 years ago

Yeah - in this case, windowed. Sometimes your suggestion does indeed work - but there are times when, while I am able to mouse into the window (I know this because I can hear the mouse over sounds of buttons going clack clack), the pointer is completely invisible. But one thing at a time...

Grateful for any attempts to nail this problem.