Skip to content

Strange keyboard behavior wrapping characters in backspace and space #282

@akkartik

Description

@akkartik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions