forked from extern/Unexpected-Keyboard
Stop special handling of delete keys
This commit is contained in:
parent
6bb257fd75
commit
7fb89b0c95
@ -97,25 +97,25 @@ public class Keyboard2 extends InputMethodService
|
|||||||
_inputView.setKeyboard(_numericKeyboard);
|
_inputView.setKeyboard(_numericKeyboard);
|
||||||
else if ((flags & (KeyValue.FLAG_CTRL | KeyValue.FLAG_ALT)) != 0)
|
else if ((flags & (KeyValue.FLAG_CTRL | KeyValue.FLAG_ALT)) != 0)
|
||||||
handleMetaKeyUp(key, flags);
|
handleMetaKeyUp(key, flags);
|
||||||
else if (key.getEventCode() == KeyEvent.KEYCODE_DEL)
|
// else if (key.getEventCode() == KeyEvent.KEYCODE_DEL)
|
||||||
handleDelKey(1, 0);
|
// handleDelKey(1, 0);
|
||||||
else if (key.getEventCode() == KeyEvent.KEYCODE_FORWARD_DEL)
|
// else if (key.getEventCode() == KeyEvent.KEYCODE_FORWARD_DEL)
|
||||||
handleDelKey(0, 1);
|
// handleDelKey(0, 1);
|
||||||
else if (key.getChar(flags) == KeyValue.CHAR_NONE && key.getEventCode() != KeyValue.EVENT_NONE)
|
else if (key.getChar(flags) == KeyValue.CHAR_NONE && key.getEventCode() != KeyValue.EVENT_NONE)
|
||||||
handleMetaKeyUp(key, flags);
|
handleMetaKeyUp(key, flags);
|
||||||
else if (key.getChar(flags) != KeyValue.CHAR_NONE)
|
else if (key.getChar(flags) != KeyValue.CHAR_NONE)
|
||||||
sendKeyChar(key.getChar(flags));
|
sendKeyChar(key.getChar(flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleDelKey(int before, int after)
|
// private void handleDelKey(int before, int after)
|
||||||
{
|
// {
|
||||||
CharSequence selection = getCurrentInputConnection().getSelectedText(0);
|
// CharSequence selection = getCurrentInputConnection().getSelectedText(0);
|
||||||
|
|
||||||
if (selection != null && selection.length() > 0)
|
// if (selection != null && selection.length() > 0)
|
||||||
getCurrentInputConnection().commitText("", 1);
|
// getCurrentInputConnection().commitText("", 1);
|
||||||
else
|
// else
|
||||||
getCurrentInputConnection().deleteSurroundingText(before, after);
|
// getCurrentInputConnection().deleteSurroundingText(before, after);
|
||||||
}
|
// }
|
||||||
|
|
||||||
private void handleMetaKeyUp(KeyValue key, int flags)
|
private void handleMetaKeyUp(KeyValue key, int flags)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user