diff options
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2View.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2View.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index fed2be6..d946aa1 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -90,6 +90,27 @@ public class Keyboard2View extends View invalidate(); } + /** Called by auto-capitalisation. */ + public void set_shift_state(boolean state) + { + KeyValue shift = KeyValue.getKeyByName("shift"); + KeyboardData.Key key = _keyboard.findKeyWithValue(shift); + if (key == null) + { + // Lookup again for the lockable shift key, which is a different value. + shift = shift.withFlags(shift.getFlags() | KeyValue.FLAG_LOCK); + key = _keyboard.findKeyWithValue(shift); + } + if (key != null) + { + if (state) + _pointers.add_fake_pointer(shift, key); + else + _pointers.remove_fake_pointer(shift, key); + invalidate(); + } + } + public KeyValue modifyKey(KeyValue k, Pointers.Modifiers mods) { return KeyModifier.modify(k, mods); |
