abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyEventHandler.java
diff options
context:
space:
mode:
authorJules Aguillon2025-10-02 01:59:07 +0200
committerJules Aguillon2025-12-28 18:13:17 +0100
commit2208079e489ef7652e28294130825d7451e01571 (patch)
treeeaf08fad2d28585b858e2248b9cb0133a1237755 /srcs/juloo.keyboard2/KeyEventHandler.java
parentc4d802d873ee404863fa7376651ef59212d57a9f (diff)
downloadunexpected-keyboard-2208079e489ef7652e28294130825d7451e01571.tar.gz
unexpected-keyboard-2208079e489ef7652e28294130825d7451e01571.zip
CurrentlyTypedWord: Handle key events
Currently, refreshing the current word on each key event. Refreshing is done after a short delay, to ensure the editor has handled the event.
Diffstat (limited to 'srcs/juloo.keyboard2/KeyEventHandler.java')
-rw-r--r--srcs/juloo.keyboard2/KeyEventHandler.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java
index c6b1730..057033b 100644
--- a/srcs/juloo.keyboard2/KeyEventHandler.java
+++ b/srcs/juloo.keyboard2/KeyEventHandler.java
@@ -33,11 +33,12 @@ public final class KeyEventHandler
public KeyEventHandler(IReceiver recv)
{
_recv = recv;
- _autocap = new Autocapitalisation(recv.getHandler(),
+ Handler handler = recv.getHandler();
+ _autocap = new Autocapitalisation(handler,
this.new Autocapitalisation_callback());
_mods = Pointers.Modifiers.EMPTY;
_suggestions = new Suggestions(recv);
- _typedword = new CurrentlyTypedWord(this);
+ _typedword = new CurrentlyTypedWord(handler, this);
}
/** Editing just started. */
@@ -222,7 +223,10 @@ public final class KeyEventHandler
metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE));
if (eventAction == KeyEvent.ACTION_UP)
+ {
_autocap.event_sent(eventCode, metaState);
+ _typedword.event_sent(eventCode, metaState);
+ }
}
void send_text(String text)