forked from extern/Unexpected-Keyboard
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.
This commit is contained in:
parent
db8ebc2f4d
commit
d5836ebb97
@ -19,11 +19,12 @@
|
||||
<key width="0.75" key0="-" key1="^"/>
|
||||
</row>
|
||||
<row>
|
||||
<key shift="0.35" width="1.15" key0="shift" key2="fn" key4="alt"/>
|
||||
<key width="0.75" key0="switch_greekmath"/>
|
||||
<key width="0.75" key0="shift" key2="fn" key4="alt"/>
|
||||
<key key0="1" key1="superscript" key2="ordinal" key3="subscript"/>
|
||||
<key key0="2"/>
|
||||
<key key0="3"/>
|
||||
<key width="1.15" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
<row height="0.95">
|
||||
<key width="1.5" key0="switch_text" key2="ctrl"/>
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user