sgtpuzzles icon indicating copy to clipboard operation
sgtpuzzles copied to clipboard

Keep buttons on screen with keyboard-like devices connected, and add preference

Open jack-jjm opened this issue 2 years ago • 5 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Checkout main and open it in Android Studio. (I'm on Android Studio 2021.2.1)
  2. Build the project and run it in the emulator (I'm using the "Google Pixel" device).
  3. Play any game.

Expected behavior The control buttons should appear at the bottom of the screen, but they don't. For example, in this screenshot, I would expect to see buttons for the numbers 1 through 6 just above the Undo/Redo buttons.

Screenshots

jack-jjm avatar Sep 07 '22 14:09 jack-jjm

@geajack What does Build.MODEL return on that emulator image? Here's the logic for whether the keyboard is shown - "We show data-entry if we either don't have a real hardware keyboard (we usually don't), or we're on the Android SDK's emulator" - so it looks like Build.MODEL does not start with "sdk_" and we'll need to add a case to detect whatever emulator image you're running, as long as there's an unambiguous way to do so.

chrisboyle avatar Sep 08 '22 09:09 chrisboyle

I stepped through in the debugger and got to isProbablyEmulator() and indeed it's returning false. Build.Model is Android SDK built for x86.

jack-jjm avatar Sep 08 '22 12:09 jack-jjm

This bug occurs for me on real hardware, on a custom ROM. OnePlus 7T running (the admittedly outdated) Paranoid Android Sapphire Alpha 3. (It is Android 12, but the current version is Beta 2.) Puzzles version number: Version 2022-05-21-1809-c43a34fb Screenshot_20220910-105058_Puzzles

EDIT: UGH. Wait a sec. I think I figured out why it's happening to me. The "smart" watch I'm using identifies itself as a keyboard even though it doesn't do any keyboard stuff. In which case, my reporting a bug that doesn't exist becomes a feature request: add an option to show buttons even if a physical keyboard is connected.

Formedras avatar Sep 10 '22 17:09 Formedras

Seconding this:

my reporting a bug that doesn't exist becomes a feature request: add an option to show buttons even if a physical keyboard is connected.

I recently lost buttons in the app in a similar manner on my Pixel 3, and this ticket helped me realize it was because I recently started keeping a YubiKey 5C Nano connected in the charging port—which, among other things, identifies as a physical keyboard.

myersjustinc avatar Aug 03 '23 02:08 myersjustinc

Re-titling to reflect what still needs to be done, since I mostly fixed emulators already with the linked commit. I think it still makes sense to hide the buttons when a full real keyboard is present (which these days mostly means on Chromebooks) but the tricky part is telling the difference between that and these headphones/Yubikey/smartwatch/other devices. Plus it makes sense to have a preference anyway, e.g. in case a Chromebook user just prefers the buttons.

chrisboyle avatar Mar 09 '24 16:03 chrisboyle