abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyEventHandler.java
diff options
context:
space:
mode:
authorJules Aguillon2022-02-06 23:01:35 +0100
committerJules Aguillon2022-02-06 23:01:35 +0100
commit95c8acc31e53f2b98a97ca421621fd8a9cb72cfd (patch)
tree019032b446601d0a8b363d02a3cb7eea32c338bd /srcs/juloo.keyboard2/KeyEventHandler.java
parente86173b8953ab873cf0ff4126824800d6cb19811 (diff)
downloadunexpected-keyboard-95c8acc31e53f2b98a97ca421621fd8a9cb72cfd.tar.gz
unexpected-keyboard-95c8acc31e53f2b98a97ca421621fd8a9cb72cfd.zip
Add the Meta key
Currently using the diamond symbol like the history meta key: https://en.wikipedia.org/wiki/Meta_key However, this key is actually interpreted as the Super/Windows key but Android calls it "meta" internally.
Diffstat (limited to 'srcs/juloo.keyboard2/KeyEventHandler.java')
-rw-r--r--srcs/juloo.keyboard2/KeyEventHandler.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java
index 39e56d5..dad6642 100644
--- a/srcs/juloo.keyboard2/KeyEventHandler.java
+++ b/srcs/juloo.keyboard2/KeyEventHandler.java
@@ -24,7 +24,7 @@ class KeyEventHandler implements Config.IKeyEventHandler
case KeyValue.EVENT_CHANGE_METHOD: _recv.switchToNextInputMethod(); return;
case KeyValue.EVENT_ACTION: _recv.performAction(); return;
default:
- if ((flags & (KeyValue.FLAG_CTRL | KeyValue.FLAG_ALT)) != 0)
+ if ((flags & (KeyValue.FLAG_CTRL | KeyValue.FLAG_ALT | KeyValue.FLAG_META)) != 0)
handleMetaKeyUp(key, flags);
else if (key.char_ != KeyValue.CHAR_NONE)
_recv.commitChar(key.char_);
@@ -56,6 +56,8 @@ class KeyEventHandler implements Config.IKeyEventHandler
meta |= KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_ON;
if ((flags & KeyValue.FLAG_SHIFT) != 0)
meta |= KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_ON;
+ if ((flags & KeyValue.FLAG_META) != 0)
+ meta |= KeyEvent.META_META_LEFT_ON | KeyEvent.META_META_ON;
_recv.sendKeyEvent(key.eventCode, meta);
}