Accept some escaped keys in custom layouts

These symbols have special meaning when in `res/xml` and are escaped in
standard layouts.
The backslash is not stripped when parsed from the custom layout option.

Treat these backslashed keys specifically to allow standard layouts to
be passed back to the custom layout option.
This commit is contained in:
Jules Aguillon 2023-06-28 18:02:01 +02:00
parent 434f9aaf2d
commit e025fddf2f

View File

@ -302,6 +302,14 @@ final class KeyValue
{
switch (name)
{
/* These symbols have special meaning when in `res/xml` and are escaped in
standard layouts. The backslash is not stripped when parsed from the
custom layout option. */
case "\\?": return fallbackMakeKey("?");
case "\\#": return fallbackMakeKey("#");
case "\\@": return fallbackMakeKey("@");
case "\\\\": return fallbackMakeKey("\\");
case "shift": return modifierKey(0x0A, Modifier.SHIFT, 0);
case "ctrl": return modifierKey("Ctrl", Modifier.CTRL, 0);
case "alt": return modifierKey("Alt", Modifier.ALT, 0);