Skip to content

Conversation

@JoshRacine
Copy link

Touchpad Mode for Secondary Displays + 3-Finger Keyboard Fix

What's New

This PR adds a touchpad mode for dual-screen setups and fixes the annoying issue where the 3-finger keyboard gesture
would flash and immediately close.

Touchpad Mode Feature

  • Added a new mode that turns your secondary display into a touchpad while the game streams to your primary display
  • Uses Android's Presentation API to properly handle secondary displays
  • Added a preference to select which display to use as the touchpad
  • Added a quick menu option to toggle the touchpad on/off without restarting the stream (only shows up when touchpad
    mode is enabled in settings)
  • The touchpad screen has buttons for keyboard, menu, and close
  • Handles all the edge cases: activity lifecycle, screen rotation, display disconnection, etc.

3-Finger Keyboard Gesture Fix

This has been broken in Artemis for a while - when you'd do the 3-finger tap, the keyboard would appear for a split
second and vanish.

What was wrong:

  • The StreamContainer wasn't telling Android it could accept text input, so the keyboard would bail immediately
  • Text was being buffered until you pressed Enter instead of typing live

What's fixed:

  • Keyboard now stays open when you tap with 3 fingers
  • Characters type immediately as you press them (no more Enter key needed)
  • Backspace works properly
  • Back button dismisses the keyboard like it should
  • Works regardless of the "enable commit text" preference setting

Files Changed

Modified:

  • Game.java - Touchpad management, toggle methods
  • GameMenu.java - Added touchpad toggle to main menu
  • StreamContainer.java - Fixed keyboard input handling
  • PreferenceConfiguration.java - Touchpad preferences
  • ServerHelper.java - Display routing for touchpad mode
  • ExternalDisplayControlActivity.java - Touchpad integration
  • preferences.xml, strings.xml, arrays.xml - UI resources

Added:

  • TouchpadPresentation.java - Touchpad UI for secondary display
  • DisplaySelectionPreference.java - Display picker preference widget

Testing

Tested on AYN Thor (dual-screen handheld) with touchpad mode enabled/disabled, 3-finger gesture, keyboard input,
display disconnects, and app lifecycle stuff.

Compatibility

Everything is backwards compatible. Touchpad mode is optional and off by default. The keyboard fix just makes the
existing 3-finger gesture actually work.

@ClassicOldSong
Copy link
Owner

Thanks for your contribution but this actually conflicts with another PR which makes full external display mode work like your description: #437

@junoxxx67
Copy link

can i get some apk file?
this 3 finger keyboard fix...
my ayn thor cant use 3 finger keyboard..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants