abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2.java
diff options
context:
space:
mode:
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java
index 38a9294..ce2f011 100644
--- a/srcs/juloo.keyboard2/Keyboard2.java
+++ b/srcs/juloo.keyboard2/Keyboard2.java
@@ -27,9 +27,26 @@ public class Keyboard2 extends InputMethodService
return (_inputView);
}
- public void handleKey(KeyValue key)
+ public void handleKeyUp(KeyValue key)
{
- Keyboard2.log("Key up " + key.getName());
+ int eventCode = key.getEventCode();
+
+ switch (eventCode)
+ {
+ case KeyValue.EVENT_NONE:
+ sendKeyChar(key.getChar());
+ break ;
+ case KeyValue.EVENT_DELETE:
+ getCurrentInputConnection().deleteSurroundingText(0, 1);
+ break ;
+ case KeyValue.EVENT_BACKSPACE:
+ getCurrentInputConnection().deleteSurroundingText(1, 0);
+ break ;
+ default:
+ getCurrentInputConnection().sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, eventCode));
+ getCurrentInputConnection().sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, eventCode));
+ break ;
+ }
}
public static void log(String str)