love2d/love-android

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

Closed this issue · 8 comments

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:

  • Top row: a history of keys pressed on one row, separated by spaces.
  • Middle row: a history of frames where love.keyboard.isDown() was true for either lctrl or rctrl.
  • Bottom row: a history of love.keypressed and love.keyreleased events, denoted by d and u respectively.

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.

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?

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..

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.

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

GitHub requires you to login to get the artifacts.

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

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?

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

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.