Skip to content

Commit

Permalink
fixup! Auto-toggle TouchControls in-game when receiving touch/mouse i…
Browse files Browse the repository at this point in the history
…nput
  • Loading branch information
grorp committed May 16, 2024
1 parent 148d546 commit cabb5af
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/defaultsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,17 @@ void set_default_settings()
#if defined(__linux__) && !defined (__ANDROID__)
// On Linux+X11 (not Linux+Wayland or Linux+XWayland), I've encountered a bug
// where fake mouse events were generated from touch events if in relative
// mouse, resulting in the touchscreen controls being instantly disabled again
// and thus making them unusable. Therefore, I've disabled automatic switching.
settings->setDefault("touch_controls", "false");
// mouse mode, resulting in the touchscreen controls being instantly disabled
// again and thus making them unusable.
// => We can't switch based on the last input method used.
// => Fall back to hardware detection.
settings->setDefault("touch_controls", bool_to_cstr(has_touch));
#else
settings->setDefault("touch_controls", "auto");
#endif
// Since GUI scaling shouldn't suddenly change during a session, we use
// hardware detection here instead of switching based on the last input
// method used.
settings->setDefault("gui_touch", bool_to_cstr(has_touch));
settings->setDefault("sound_volume", "0.8");
settings->setDefault("sound_volume_unfocused", "0.3");
Expand Down

0 comments on commit cabb5af

Please sign in to comment.