abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyEventHandler.java
diff options
context:
space:
mode:
authorJules Aguillon2022-04-03 17:15:12 +0200
committerJules Aguillon2022-04-03 17:15:12 +0200
commitaa78229b2aef963d5f840b72d8aa3cad3a78dfc4 (patch)
tree4ea7950b7a62829890ba0e9dc1b8108b39dcc902 /srcs/juloo.keyboard2/KeyEventHandler.java
parentd62e7647e0feb9c3c7d363c50f31f1aaf101ecd0 (diff)
downloadunexpected-keyboard-aa78229b2aef963d5f840b72d8aa3cad3a78dfc4.tar.gz
unexpected-keyboard-aa78229b2aef963d5f840b72d8aa3cad3a78dfc4.zip
Add the Programming Layout option
Allow specifying a layout for programming and add a key for switching to it easily. The switching key is placed on the top edge of the space bar. The option has no effect by default because the ergonomic isn't ideal, it needs to be enabled explicitly. Users of Latin-script languages certainly prefer to use one layout (for programming or not). This feature might be removed in favor of a better language-switching mechanisms in the future.
Diffstat (limited to 'srcs/juloo.keyboard2/KeyEventHandler.java')
-rw-r--r--srcs/juloo.keyboard2/KeyEventHandler.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java
index 217a2cd..8382737 100644
--- a/srcs/juloo.keyboard2/KeyEventHandler.java
+++ b/srcs/juloo.keyboard2/KeyEventHandler.java
@@ -18,12 +18,13 @@ class KeyEventHandler implements Config.IKeyEventHandler
switch (key.eventCode)
{
case KeyValue.EVENT_CONFIG: _recv.showKeyboardConfig(); return;
- case KeyValue.EVENT_SWITCH_TEXT: _recv.setLayout(-1); return;
- case KeyValue.EVENT_SWITCH_NUMERIC: _recv.setLayout(R.xml.numeric); return;
+ case KeyValue.EVENT_SWITCH_TEXT: _recv.switchMain(); return;
+ case KeyValue.EVENT_SWITCH_NUMERIC: _recv.switchNumeric(); return;
case KeyValue.EVENT_SWITCH_EMOJI: _recv.setPane_emoji(); return;
case KeyValue.EVENT_SWITCH_BACK_EMOJI: _recv.setPane_normal(); return;
case KeyValue.EVENT_CHANGE_METHOD: _recv.switchToNextInputMethod(); return;
case KeyValue.EVENT_ACTION: _recv.performAction(); return;
+ case KeyValue.EVENT_SWITCH_PROGRAMMING: _recv.switchProgramming(); return;
default:
if ((flags & (KeyValue.FLAG_CTRL | KeyValue.FLAG_ALT | KeyValue.FLAG_META)) != 0)
handleKeyUpWithModifier(key, flags);
@@ -91,8 +92,9 @@ class KeyEventHandler implements Config.IKeyEventHandler
public void showKeyboardConfig();
public void performAction();
- /** 'res_id' is '-1' for the currently selected layout. */
- public void setLayout(int res_id);
+ public void switchMain();
+ public void switchNumeric();
+ public void switchProgramming();
public void sendKeyEvent(int eventAction, int eventCode, int meta);