IME toggle button as a keyboard control

This commit is contained in:
minjaesong
2021-10-27 16:13:44 +09:00
parent 4434bec48e
commit 886bea5ccb
3 changed files with 22 additions and 5 deletions

View File

@@ -169,12 +169,15 @@ class UIItemTextLineInput(
// process keypresses
if (isActive) {
IngameController.withKeyboardEvent { (_, char, headkey, _, keycodes) ->
IngameController.withKeyboardEvent { (_, char, headkey, repeatCount, keycodes) ->
fboUpdateLatch = true
forceLitCursor()
val ime = getIME()
if (keycodes.contains(Input.Keys.V) && (keycodes.contains(Input.Keys.CONTROL_LEFT) || keycodes.contains(Input.Keys.CONTROL_RIGHT))) {
if (keycodes.contains(App.getConfigInt("control_key_toggleime")) && repeatCount == 1) {
toggleIME()
}
else if (keycodes.contains(Input.Keys.V) && (keycodes.contains(Input.Keys.CONTROL_LEFT) || keycodes.contains(Input.Keys.CONTROL_RIGHT))) {
endComposing()
paste(Clipboard.fetch().substringBefore('\n').substringBefore('\t').toCodePoints())
}