mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-28 18:23:16 +01:00
compose: Don't remove keys not in sequence
Keys that are not part of any possible sequences are now dimmed and still usable instead of being removed, which felt weird.
This commit is contained in:
parent
63e7ac2e94
commit
e9f734b6cc
@ -10,15 +10,22 @@ public final class ComposeKey
|
|||||||
{
|
{
|
||||||
switch (kv.getKind())
|
switch (kv.getKind())
|
||||||
{
|
{
|
||||||
case Char: return apply(state, kv.getChar());
|
case Char:
|
||||||
|
KeyValue res = apply(state, kv.getChar());
|
||||||
|
// Dim characters not part of any sequence instead of removing them.
|
||||||
|
if (res == null)
|
||||||
|
return kv.withFlags(kv.getFlags() | KeyValue.FLAG_SECONDARY);
|
||||||
|
return res;
|
||||||
/* These keys must not be removed. */
|
/* These keys must not be removed. */
|
||||||
case Event: return kv;
|
case Event:
|
||||||
case Modifier: return kv;
|
case Modifier:
|
||||||
|
return kv;
|
||||||
/* These keys cannot be part of sequences. */
|
/* These keys cannot be part of sequences. */
|
||||||
case String: return null;
|
case String:
|
||||||
case Keyevent: return null;
|
case Keyevent:
|
||||||
case Editing: return null;
|
case Editing:
|
||||||
case Placeholder: return null;
|
case Placeholder:
|
||||||
|
return kv.withFlags(kv.getFlags() | KeyValue.FLAG_SECONDARY);
|
||||||
case Compose_pending: return null;
|
case Compose_pending: return null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user