We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5029 - TextInput events not fired while ctrl is held
Summary: TextInput events not fired while ctrl is held
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.10
Hardware: x86_64 Windows 10
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-14 00:16 UTC by keith
Modified: 2020-03-16 02:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description keith 2020-03-14 00:16:15 UTC
TextInput events are paused while control is held. If a keyboard layout with AltGr is in use, those keys will be produced, but not with ctrl alone.

This is a problem if an application wants to handle keybindings such as <C-^> because there is no crossplatform way to handle the ^ key using keydown events.
Comment 1 keith 2020-03-14 00:17:04 UTC
I've seen some reports that maybe on non windows platforms, the events will work as expected? I have no way of confirming either way.
Comment 2 Sam Lantinga 2020-03-14 02:12:53 UTC
In general text input events are for ... text. Ctrl+button usually doesn't create printable text. If you want to handle Ctrl+key bindings, I recommend using keycodes instead of text input for your bindings.
Comment 3 keith 2020-03-15 23:51:16 UTC
This doesn't work in a crossplatform way. In the example I gave, there is no way with the current keybinding events to handle control-^. I could hard code that I expect ctrl + shift + the 6 keycode, but this will only work with qwerty layouts. For other layouts this will mess up the keybinding.

Today there is no crossplatform way to handle ctrl + modified key text for windows.
Comment 4 Sam Lantinga 2020-03-16 02:58:38 UTC
That's correct. Ctrl-^ doesn't exist. You can check for that text event while Ctrl is held down, but that's not the same thing, and on some keyboards, holding down Ctrl while pressing those keys won't even generate that text.