-
Notifications
You must be signed in to change notification settings - Fork 405
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
Regression 11.5: key events not triggered when an IME language is active (windows) #2031
Comments
Is there a game you know of that does work as you expect on your system? That being said, since love uses SDL for input handling, if it is even possible for apps to control that behaviour then SDL's code would have to change rather than love's code. |
re-tested 11.4 works correctly, so it's a regression.
Overwatch for example, and basically pretty much any game that started off with an AAA-ish engine. |
Are you able to test directly with the latest SDL and file a bug there if needed? love 11.4 used SDL 2.0.18, and 11.5 uses 2.28.5. |
latest SDL.dll fails for both 11.4 and 11.5 11.4's SDL.dll works when copied to 11.5 as well. So it's upstream. |
A couple clarifying questions:
|
|
If you ever want to have a text box or handle typed text from users, you'll definitely want to use those instead of love.keypressed (whereas the latter is good for other game input unrelated to text). :)
|
In both versions, during IME mode no With So the only difference between 11.4 and 11.5 is whether or not local vkeycode_accu = 0
local scancode_accu = 0
local input_count = 0
local edit_count = 0
function love.mousepressed(x,y,button,istouch,presses)
if button==3 then love.keyboard.setTextInput( not love.keyboard.hasTextInput() ) end
end
function love.textinput(text)
input_count = input_count + 1
end
function love.textedited( text, start, length )
edit_count = edit_count + 1
end
function love.keypressed(vkey,scan,isRepeat)
if vkey=="w" then vkeycode_accu = vkeycode_accu + 1 end
if scan=="w" then scancode_accu = scancode_accu + 1 end
end
function love.keyreleased(vkey,scan)
if vkey=="w" then vkeycode_accu = vkeycode_accu - 1 end
if scan=="w" then scancode_accu = scancode_accu - 1 end
end
function love.draw()
love.graphics.print(
"love.keyboard.isDown('w') = " .. (love.keyboard.isDown('w') and "true" or "false") .. "\n" ..
"love.keyboard.isScancodeDown('w') = " .. (love.keyboard.isScancodeDown('w') and "true" or "false") .. "\n" ..
"vkey w accu = " .. vkeycode_accu .. "\n" ..
"scan w accu = " .. scancode_accu .. "\n" ..
"textinput count = " .. input_count .. "\n" ..
"textedited count = " .. edit_count
)
end |
2.24.2 fails. |
This _should_ implement support for IMEs for CJK, by showing what the currently edited text is. This is still a little untested, since I want to do that on another computer and it's easier to just push immediately and pull there, than to copy it over with a USB stick or something, heh. This also adds the behavior change that while uncommitted IME text is currently set, regular key input (love.keypressed and love.keyboard.isDown()) is ignored. This is because inputs that should go to the IME (like Enter, Esc, etc) were also interpreted by Ved, meaning if you press Enter to commit text, Ved would first insert a new line and then commit the text. At least, this would happen in LÖVE 11.4 and below, because in 11.5 the behavior changed to one I actually need, lol: love2d/love#2031 [pre23]
I'm a bit confused by this - is there IME-related UI visible and active while text input is active, or is there not? |
The IME toolbar is a status indicator in the systray, next to the system clock. The IME character selection overlay element is never visible in Love2D. |
is this also fixed by switching to sdl3? |
Yes, because text input is opt-in on all platforms now. But Sam still has the SDL issue open so I assume he has more plans for investigating or changing what happens to key presses while text input and an IME are active. |
If you have a CJK language active then the corresponding keypressed/keyreleased events are not triggered.
It's the same kind of problem that Minecraft has (which uses glfw), so it might have something to do with naive handling of scancode/virtual-key codes.
tested on 11.5
EDIT: works correctly in 11.4 so it's a regression.
test code:
The text was updated successfully, but these errors were encountered: