Page MenuHome

UI: Allow AltGr Key + C,V,X Text Input
ClosedPublic

Authored by Harley Acheson (harley) on Jan 9 2022, 11:08 PM.

Details

Summary

Slight change to our processing of Ctrl-C, Ctrl-V, and Ctrl-X so that
they will not be triggered if Alt is also pressed. This allows entry
of AltGr-C, -V, -X when using International keyboard layouts.


While processing text uiBut input we are overly-broad with our testing for Ctrl-C, Ctrl-V, and Ctrl-X. We do it is such a way that we will interpret Shift-Ctrl-Alt-Win-C as a copy to clipboard command.

One problem with being overly-broad here is that a user cannot bind an operator to Ctrl-Win-C for example.

But more importantly it screws up some text character entry on some keyboard layouts. Some layouts treat the right-Alt key as AltGr. Pressing AltGr and some keys will allow users to type some characters not widely used in their location, such as currency symbols, typographical symbols, accented letters, etc

Many international keyboard layouts do not use AltGr plus C, V, or X. But some do: Dutch (Netherlands), Estonian, Greek, Norwegian, Polish, Brazil, UK Extended Layout, US International, Canadian Multilingual Standard, Finnish Multilingual, EurKEY.

So for example while using the US International keyboard layout I should be able to press AltGr+C and get ©, but instead I get nothing in Blender because this is seen as Ctrl-C. This is because, under-the-hood, we receive these AltGr presses as both Alt and Ctrl being simultaneously pressed.

This patch just tightens up the testing for Ctrl-C, Ctrl-V, and Ctrl-X so that they don't behave as such if you also have Alt depressed (even if it is only pressed without you knowing).

Diff Detail

Repository
rB Blender