forked from extern/Unexpected-Keyboard
Compare commits
2 Commits
master
...
caps-lock-
Author | SHA1 | Date | |
---|---|---|---|
|
408d80b26c | ||
|
95e7494ad7 |
@ -292,7 +292,7 @@ public final class KeyEventHandler implements Config.IKeyEventHandler
|
|||||||
public static interface IReceiver
|
public static interface IReceiver
|
||||||
{
|
{
|
||||||
public void handle_event_key(KeyValue.Event ev);
|
public void handle_event_key(KeyValue.Event ev);
|
||||||
public void set_shift_state(boolean state, boolean lock);
|
public void set_shift_state(boolean state);
|
||||||
public InputConnection getCurrentInputConnection();
|
public InputConnection getCurrentInputConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,9 +302,9 @@ public final class KeyEventHandler implements Config.IKeyEventHandler
|
|||||||
public void update_shift_state(boolean should_enable, boolean should_disable)
|
public void update_shift_state(boolean should_enable, boolean should_disable)
|
||||||
{
|
{
|
||||||
if (should_enable)
|
if (should_enable)
|
||||||
_recv.set_shift_state(true, false);
|
_recv.set_shift_state(true);
|
||||||
else if (should_disable)
|
else if (should_disable)
|
||||||
_recv.set_shift_state(false, false);
|
_recv.set_shift_state(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ public final class KeyValue
|
|||||||
SWITCH_FORWARD,
|
SWITCH_FORWARD,
|
||||||
SWITCH_BACKWARD,
|
SWITCH_BACKWARD,
|
||||||
SWITCH_GREEKMATH,
|
SWITCH_GREEKMATH,
|
||||||
CAPS_LOCK,
|
|
||||||
SWITCH_VOICE_TYPING,
|
SWITCH_VOICE_TYPING,
|
||||||
SWITCH_VOICE_TYPING_CHOOSER,
|
SWITCH_VOICE_TYPING_CHOOSER,
|
||||||
}
|
}
|
||||||
@ -355,6 +354,7 @@ public final class KeyValue
|
|||||||
case "box": return modifierKey("Box", Modifier.BOX, 0);
|
case "box": return modifierKey("Box", Modifier.BOX, 0);
|
||||||
case "fn": return modifierKey("Fn", Modifier.FN, 0);
|
case "fn": return modifierKey("Fn", Modifier.FN, 0);
|
||||||
case "meta": return modifierKey("Meta", Modifier.META, 0);
|
case "meta": return modifierKey("Meta", Modifier.META, 0);
|
||||||
|
case "capslock": return modifierKey(0xE012, Modifier.SHIFT, FLAG_LOCKED);
|
||||||
|
|
||||||
/* Special event keys */
|
/* Special event keys */
|
||||||
case "config": return eventKey(0xE004, Event.CONFIG, FLAG_SMALLER_FONT);
|
case "config": return eventKey(0xE004, Event.CONFIG, FLAG_SMALLER_FONT);
|
||||||
@ -368,7 +368,6 @@ public final class KeyValue
|
|||||||
case "change_method": return eventKey(0xE009, Event.CHANGE_METHOD_PICKER, FLAG_SMALLER_FONT);
|
case "change_method": return eventKey(0xE009, Event.CHANGE_METHOD_PICKER, FLAG_SMALLER_FONT);
|
||||||
case "change_method_prev": return eventKey(0xE009, Event.CHANGE_METHOD_AUTO, FLAG_SMALLER_FONT);
|
case "change_method_prev": return eventKey(0xE009, Event.CHANGE_METHOD_AUTO, FLAG_SMALLER_FONT);
|
||||||
case "action": return eventKey("Action", Event.ACTION, FLAG_SMALLER_FONT); // Will always be replaced
|
case "action": return eventKey("Action", Event.ACTION, FLAG_SMALLER_FONT); // Will always be replaced
|
||||||
case "capslock": return eventKey(0xE012, Event.CAPS_LOCK, 0);
|
|
||||||
case "voice_typing": return eventKey(0xE015, Event.SWITCH_VOICE_TYPING, FLAG_SMALLER_FONT);
|
case "voice_typing": return eventKey(0xE015, Event.SWITCH_VOICE_TYPING, FLAG_SMALLER_FONT);
|
||||||
case "voice_typing_chooser": return eventKey(0xE015, Event.SWITCH_VOICE_TYPING_CHOOSER, FLAG_SMALLER_FONT);
|
case "voice_typing_chooser": return eventKey(0xE015, Event.SWITCH_VOICE_TYPING_CHOOSER, FLAG_SMALLER_FONT);
|
||||||
|
|
||||||
|
@ -418,10 +418,6 @@ public class Keyboard2 extends InputMethodService
|
|||||||
setSpecialLayout(loadNumpad(R.xml.greekmath));
|
setSpecialLayout(loadNumpad(R.xml.greekmath));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CAPS_LOCK:
|
|
||||||
set_shift_state(true, true);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SWITCH_VOICE_TYPING:
|
case SWITCH_VOICE_TYPING:
|
||||||
if (!VoiceImeSwitcher.switch_to_voice_ime(Keyboard2.this, get_imm(),
|
if (!VoiceImeSwitcher.switch_to_voice_ime(Keyboard2.this, get_imm(),
|
||||||
Config.globalPrefs()))
|
Config.globalPrefs()))
|
||||||
@ -435,9 +431,9 @@ public class Keyboard2 extends InputMethodService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set_shift_state(boolean state, boolean lock)
|
public void set_shift_state(boolean state)
|
||||||
{
|
{
|
||||||
_keyboardView.set_shift_state(state, lock);
|
_keyboardView.set_shift_state(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputConnection getCurrentInputConnection()
|
public InputConnection getCurrentInputConnection()
|
||||||
|
@ -110,16 +110,16 @@ public class Keyboard2View extends View
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Called by auto-capitalisation. */
|
/** Called by auto-capitalisation. */
|
||||||
public void set_shift_state(boolean state, boolean lock)
|
public void set_shift_state(boolean state)
|
||||||
{
|
{
|
||||||
if (_keyboard == null || _shift_key == null)
|
if (_keyboard == null || _shift_key == null)
|
||||||
return;
|
return;
|
||||||
int flags = _pointers.getKeyFlags(_shift_key, _shift_kv);
|
int flags = _pointers.getKeyFlags(_shift_key, _shift_kv);
|
||||||
if (state)
|
if (state)
|
||||||
{
|
{
|
||||||
if (flags != -1 && !lock)
|
if (flags != -1)
|
||||||
return; // Don't replace an existing pointer
|
return; // Don't replace an existing pointer
|
||||||
_pointers.add_fake_pointer(_shift_kv, _shift_key, lock);
|
_pointers.add_fake_pointer(_shift_kv, _shift_key, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user