Page MenuHome

Fix missing text input on Windows with certain keyboard layouts
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Tue, Mar 24, 7:57 PM.

Details

Summary

This is a second proposal to solve the problems mentioned in D7204: Add missing keys for (ABNT) Brazilian keyboards.
T68577: Missing key on Swiss keyboard variants being the most recurring one.

The solution is to simply remove this condition:

if (key != GHOST_kKeyUnknown) {

As we can see in the comment for this line: wm_event_system.c$4045 GHOST_kKeyUnknown is a valid entry and has a corresponding RNA.
So it seems wrong to ignore all other values of this type of event (utf, pressed, released, modifiers...).

Apparently, this condition has always existed and there is no explanation for it.
GHOST_SystemWin32.cpp;12315f4d0e0ae993805f141f64cb8c73c5297311?follow=first
It seems unsafe, but I believe it is worth the risk.

Diff Detail

Repository
rB Blender

Event Timeline

Germano Cavalcante (mano-wii) edited the summary of this revision. (Show Details)

What exactly are the implications of this?

For text input I think it can be OK to handle unknown keys, as long as utf8_char is non-empty we should be able to handle it.

However it should not be possible to bind shortcuts to unknown, that can't work if there is more than one unknown key.

Ah, I forgot to add this information in the description,
it is currently not possible to use UNKNOWN keys in keymaps (a warning is displayed and the operation is ignored).
So no shortcuts issues or problems with duplicate keys.

This seems fine then, but please commit with a clear description:

Fix missing text input on Windows with certain keyboard layouts

Events for keys specific to certain keyboard layouts unknown to Blender
were ignored. Now pass them along as unknown key events for which we
can still handle text input, like we already do for Linux and macOS.
This revision is now accepted and ready to land.Thu, Mar 26, 11:58 AM
Brecht Van Lommel (brecht) retitled this revision from Fix missing keys in different keyboard layouts to Fix missing text input on Windows with certain keyboard layouts.Thu, Mar 26, 12:19 PM