FWGS / xash3d

DEPRECATED in favor of https://github.com/FWGS/xash3d-fwgs. Only bugfixes are accepted.
https://xash.su
GNU General Public License v3.0
549 stars 107 forks source link

Latest build on ios 12 - not recognized any inputs from bluetooth controller or keyboard. #445

Open TuTuc0 opened 5 years ago

TuTuc0 commented 5 years ago

Bluetooth controller or keyboard worked fine on ios 10 or 11, but on ios 12 app does not recognize any input. Even BT keyboard does not type anything when console is opened.

a1batross commented 5 years ago

@mittorn sounds like sdl2 bug? Maybe it should be updated to latest version for ios?

TuTuc0 commented 5 years ago

Does it need to be compiled with latest ios sdk to make bt inputs to work? Also new compiling should make app to properly adjust screen resolution for new 11 inch ipad pro. Currently Xash 3d is displayed with black bars around screen corners like every app that wasn't compiled with latest ios 11 sdk.

TuTuc0 commented 5 years ago

Looking into log, it seems to recognize joystick. Do I need to type additional commands to get some input? I have also root access to app if that would help anything.

[2019:04:19|19:14:02] 1 joysticks found: [2019:04:19|19:14:02] 0 : MFi Extended Gamepad [2019:04:19|19:14:02] Pass +set joy_index N to command line, where N is number, to select active joystick

mittorn commented 5 years ago

Try add -sdl_joy_old_api option

TuTuc0 commented 5 years ago

Try add -sdl_joy_old_api option

Thanks a lot, controller works great now.

Slightly off-topic: when using external monitor through video adapter, and choosing one of windowed video modes, it will run nicely 16:9 only on monitor. But issue is I can't get controller (or any touch input) to work in this mode. However when mirroring screen works fine as it should (4:3 ratio). Could be this achieved with command to use controller inputs also when viewing on external monitor?

mittorn commented 5 years ago

Sorry, i do not know how it work

TuTuc0 commented 5 years ago

Thanks for help anyway. Not sure if I understand it correctly: when windowed, inputs are obtained only when window is active (focus), otherwise inputs are suspended which could be case when using external monitor. I wonder if there could be any start command to gain focus to the other window or to always gather inputs, even in background.

a1batross commented 5 years ago

External monitors? On iOS? Never heard of this. @TuTuc0

Probably this on SDL2 level. We don't have any checks on "lost focus" engine state in eventhandlers, i.e. always accepting incoming events from SDL2.

TuTuc0 commented 5 years ago

Yes, it is possible to use external monitor via adaper/hub. By default, everything is mirrored from ios device, unless set otherwise. In game video settings, if I select "current window size", it will use only external monitor but unfortunately gamepad input is ignored.

Here is a comparison of two modes: "Desktop size" and "Current window size" 2019-04-23 10 22 00 2019-04-23 10 15 25

a1batross commented 5 years ago

You probably can try to report this to SDL2 developers, but I doubt that they will fix it unless we don't provide minimal example.

"Desktop mode" selection just does call SDL_GetDesktopDisplayMode on first screen, so engine knows native resolution of first screen. Looks like your external monitor becomes first for some reason.

And current window mode were done for resizing window, leaving no changes.

TuTuc0 commented 5 years ago

It's the opposite. Setting Desktop makes external screen to "mirror" screen. Setting current window and restarting game uses only the external monitor while leaving device gray blank. (after confirming start commands, which is firstly in "mirror" mode).

a1batross commented 5 years ago

Anyway, I only supposed how it works.

TuTuc0 commented 5 years ago

I think the SDL grabs mouse and keyboard input for active window, which could be main device currently displaying grey window and leaving external screen window without input. But this isn't probably best place for discussion. Original issue with controller was resolved thanks to "-sdl_joy_old_api" option. I will move on :) Thanks for help.