abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
-rw-r--r--srcs/juloo.keyboard2/KeyModifier.java31
1 files changed, 17 insertions, 14 deletions
diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java
index 4258322..fcb0793 100644
--- a/srcs/juloo.keyboard2/KeyModifier.java
+++ b/srcs/juloo.keyboard2/KeyModifier.java
@@ -213,7 +213,6 @@ public final class KeyModifier
case Event: name = apply_fn_event(k.getEvent()); break;
case Placeholder: name = apply_fn_placeholder(k.getPlaceholder()); break;
case Editing: name = apply_fn_editing(k.getEditing()); break;
- case Modifier: name = apply_fn_modifier(k.getModifier()); break;
}
return (name == null) ? k : KeyValue.getKeyByName(name);
}
@@ -269,15 +268,6 @@ public final class KeyModifier
}
}
- private static String apply_fn_modifier(KeyValue.Modifier m)
- {
- switch (m)
- {
- case SHIFT: return "capslock";
- default: return null;
- }
- }
-
private static KeyValue apply_ctrl(KeyValue k)
{
if (_modmap != null)
@@ -360,10 +350,23 @@ public final class KeyModifier
/** Modify a key affected by a round-trip or a clockwise circle gesture. */
private static KeyValue apply_gesture(KeyValue k)
{
- KeyValue shifted = apply_shift(k);
- if (shifted == null || shifted.equals(k))
- return apply_fn(k);
- return shifted;
+ KeyValue modified = apply_shift(k);
+ if (modified != null && !modified.equals(k))
+ return modified;
+ modified = apply_fn(k);
+ if (modified != null && !modified.equals(k))
+ return modified;
+ String name = null;
+ switch (k.getKind())
+ {
+ case Modifier:
+ switch (k.getModifier())
+ {
+ case SHIFT: name = "capslock"; break;
+ }
+ break;
+ }
+ return (name == null) ? k : KeyValue.getKeyByName(name);
}
/** Compose the precomposed initial with the medial [kv]. */