Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange keyboard behavior wrapping characters in backspace and space #282

Open
akkartik opened this issue Nov 22, 2024 · 0 comments
Open

Comments

@akkartik
Copy link

I just heard from someone for whom LÖVE 11.5's keyboard handlers are triggered unreliably. This is on a Samsung Galaxy A70 with AZERTY layout and 3 languages installed (English, French, Russian). Autocomplete is off.

The scenario

  • I had them run the following LÖVE app on their device:
utf8 = require 'utf8'

Lines = ''

function love.load()
  love.keyboard.setTextInput(true)
  local h, flags
  W, h, flags = love.window.getMode()
  flags.resizable = true
  love.window.setMode(W, h, flags)
end

function love.resize(w, h)
  W = w
end

function love.draw()
  love.graphics.printf(Lines, 10, 10, W)
end

function love.keypressed(key)
  Lines = Lines .. 'keypress '..key..'\n'
end

function love.textinput(t)
  Lines = Lines .. 'textinput '..t..' '..#t..' '..utf8.len(t)..'\n'
end
  • I then had them press the following keys on their English AZERTY keyboard: a space b . d backspace backspace backspace backspace e space f g.

Some of the time, particularly if they switch apps in between, they see the expected output:

keypress a
textinput a 1 1
keypress space
textinput  1 1
keypress b
textinput b 1 1
keypress .
textinput . 1 1
keypress d
textinput . 1 1
keypress backspace
keypress backspace
keypress backspace
keypress backspace
keypress e
textinput e 1 1
keypress space
textinput  1 1
keypress f
textinput f 1 1
keypress g
textinput g 1 1

At other times, however, they see the following output:

keypress a
textinput a 1 1
keypress space
textinput  1 1
keypress b
textinput b 1 1
keypress .
textinput . 1 1
keypress d
textinput . 1 1
keypress backspace
keypress backspace
keypress backspace
keypress backspace
keypress backspace
keypress e
keypress space
textinput e  2 2
keypress space
textinput  1 1
keypress backspace
keypress f
keypress space
textinput f  2 2
keypress backspace
keypress g
keypress space
textinput g  2 2

It looks like pressing . and d one after another, then some time later backspacing over a word until a space, puts the keyboard into a strange mode that wraps every non-space character with a backspace before and a space after. Have y'all ever seen anything like this? Is it perhaps some sort of feature that can be turned off on the device?

Screenshot:
screenshot

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

No branches or pull requests

1 participant