abouttreesummaryrefslogcommitdiff
path: root/srcs
diff options
context:
space:
mode:
authorJules Aguillon2022-07-09 17:30:26 +0200
committerJules Aguillon2022-07-09 17:30:26 +0200
commitd5836ebb972949a65dd34eec9530cef321c85a81 (patch)
treefe0fac84df05824f26f1ca1cd26b5a3c2fea3e1b /srcs
parentdb8ebc2f4d2739fbf7dffe51a39d1e31c1574fdf (diff)
downloadunexpected-keyboard-d5836ebb972949a65dd34eec9530cef321c85a81.tar.gz
unexpected-keyboard-d5836ebb972949a65dd34eec9530cef321c85a81.zip
Add key for switching to the greekmath pane
The key is placed on the 3rd row of the numeric pane, by taking some space from the shift key.
Diffstat (limited to 'srcs')
-rw-r--r--srcs/juloo.keyboard2/KeyEventHandler.java2
-rw-r--r--srcs/juloo.keyboard2/KeyValue.java4
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java5
3 files changed, 10 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java
index ff82cf9..57f15f6 100644
--- a/srcs/juloo.keyboard2/KeyEventHandler.java
+++ b/srcs/juloo.keyboard2/KeyEventHandler.java
@@ -34,6 +34,7 @@ class KeyEventHandler implements Config.IKeyEventHandler
case CHANGE_METHOD: _recv.switchToNextInputMethod(); break;
case ACTION: _recv.performAction(); break;
case SWITCH_PROGRAMMING: _recv.switchProgramming(); break;
+ case SWITCH_GREEKMATH: _recv.switchGreekmath(); break;
}
break;
case Keyevent:
@@ -105,6 +106,7 @@ class KeyEventHandler implements Config.IKeyEventHandler
public void switchMain();
public void switchNumeric();
public void switchProgramming();
+ public void switchGreekmath();
public void sendKeyEvent(int eventAction, int eventCode, int meta);
diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java
index fb4b776..383af8c 100644
--- a/srcs/juloo.keyboard2/KeyValue.java
+++ b/srcs/juloo.keyboard2/KeyValue.java
@@ -15,7 +15,8 @@ final class KeyValue
SWITCH_BACK_EMOJI,
CHANGE_METHOD,
ACTION,
- SWITCH_PROGRAMMING
+ SWITCH_PROGRAMMING,
+ SWITCH_GREEKMATH
}
// Must be evaluated in the reverse order of their values.
@@ -276,6 +277,7 @@ final class KeyValue
addEventKey("switch_emoji", "\u0001" , Event.SWITCH_EMOJI, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
addEventKey("switch_back_emoji", "ABC", Event.SWITCH_BACK_EMOJI, 0);
addEventKey("switch_programming", "Prog", Event.SWITCH_PROGRAMMING, FLAG_SMALLER_FONT);
+ addEventKey("switch_greekmath", "πλ∇¬", Event.SWITCH_GREEKMATH, FLAG_SMALLER_FONT);
addEventKey("change_method", "\u0009", Event.CHANGE_METHOD, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
addEventKey("action", "Action", Event.ACTION, FLAG_SMALLER_FONT); // Will always be replaced
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java
index 2a54111..8483a50 100644
--- a/srcs/juloo.keyboard2/Keyboard2.java
+++ b/srcs/juloo.keyboard2/Keyboard2.java
@@ -290,6 +290,11 @@ public class Keyboard2 extends InputMethodService
_keyboardView.setKeyboard(getLayout(R.xml.numeric));
}
+ public void switchGreekmath()
+ {
+ _keyboardView.setKeyboard(getLayout(R.xml.greekmath));
+ }
+
public void switchProgramming()
{
if (_config.programming_layout == -1)