love2d / love-android

Android build setup for LÖVE.
https://love2d.org
Other
211 stars 73 forks source link

ctrl key doesn't register a keypress on Samsung Galaxy tablet #252

Closed akkartik closed 1 year ago

akkartik commented 1 year ago

Android device: Galaxy Tab A7 Lite Model name: SM-T220 Android version: 13 Google Play system update: July 1, 2023 Kernel version: 4.19.191 Android security patch level: June 1, 2023

Test program

function love.load()
  KeysPressed = ''
  CtrlDown = ''
  CtrlPressed = ''
  love.keyboard.setTextInput(true)
end

function love.draw()
  love.graphics.print(KeysPressed, 30,30)
  love.graphics.print(CtrlDown, 30,60)
  love.graphics.print(CtrlPressed, 30,90)
end

function love.update()
  if love.keyboard.isDown('lctrl') then
    CtrlDown = CtrlDown..' lctrl'
  elseif love.keyboard.isDown('rctrl') then
    CtrlDown = CtrlDown..' rctrl'
  end
end

function love.keypressed(key)
  KeysPressed = KeysPressed..' '..key
  if key == 'lctrl' or key == 'rctrl' then
    CtrlPressed = CtrlPressed..'d'
  end
end

function love.keyreleased()
  if key == 'lctrl' or key == 'rctrl' then
    CtrlPressed = CtrlPressed..'u'
  end
end

This program prints out 3 rows:

Expected behavior as seen on a laptop

Pressing lctrl or rctrl appends to all 3 rows. (The bottom row only shows keypressed or d.)

Observed behavior on the Galaxy Tab A7 Lite

Tapping the ctrl key on the on-screen soft keyboard appends to none of the 3 rows.

Tapping the ctrl key in combination with any other keys (e.g. x) appends just x to the top row and nothing else.

MikuAuahDark commented 1 year ago

I updated SDL to 2.28.3 recently. Observed behavior in Galaxy A52s is same as seen in your (and my) laptop.

Can you try to use the latest nightly APK and see if it solves the issue?

akkartik commented 1 year ago

How can I find the nightly APK? I tried redownloading from the repo and checking tags here, but I don't see any mention of nightly or a date..

MikuAuahDark commented 1 year ago

It's available in the GitHub Actions. https://github.com/love2d/love-android/actions/runs/6336734575

Pick the love-android-debug.apk. Make sure you uninstall existing (nightly) APK as their signature is different on every build.

akkartik commented 1 year ago

Hold on, I can't seem to click on those artifacts on the Android tablet..

MikuAuahDark commented 1 year ago

GitHub requires you to login to get the artifacts.

Don't worry. https://nightly.link/love2d/love-android/actions/runs/6336734575

akkartik commented 1 year ago

Ugh, after I uninstalled the main LÖVE app on Android and installed this the tablet no longer knows how to run .love files.. Any ideas on what might have gotten messed up?

akkartik commented 1 year ago

Ok I managed to run the original .love file with love-android-debug.apk from the nightly build. Same result, unfortunately.

MikuAuahDark commented 1 year ago

This looks like a device-specific issue then. Unfortunately not much we can do about it.

Same with the APK losing ability to run .love files. There's not much we can do as the restriction is imposed by Android itself.