add a softwareDeadKeyEvent

to preserve coordinates, which can be useful in edge cases
This commit is contained in:
Helium314 2025-01-13 20:09:17 +01:00 committed by GitHub
parent b11e6604b7
commit 007f386066
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -146,13 +146,19 @@ class Event private constructor(
}
// This creates an input event for a dead character. @see {@link #FLAG_DEAD}
@JvmStatic
fun createDeadEvent(codePoint: Int, keyCode: Int, metaState: Int, next: Event?): Event { // TODO: add an argument or something if we ever create a software layout with dead keys.
fun createDeadEvent(codePoint: Int, keyCode: Int, metaState: Int, next: Event?): Event {
return Event(EVENT_TYPE_INPUT_KEYPRESS, null, codePoint, keyCode, metaState,
Constants.EXTERNAL_KEYBOARD_COORDINATE, Constants.EXTERNAL_KEYBOARD_COORDINATE,
null, FLAG_DEAD, next)
}
// This creates an input event for a dead character. @see {@link #FLAG_DEAD}
@JvmStatic
fun createSoftwareDeadEvent(codePoint: Int, keyCode: Int, metaState: Int, x: Int, y: Int, next: Event?): Event {
return Event(EVENT_TYPE_INPUT_KEYPRESS, null, codePoint, keyCode, metaState, x, y,
null, FLAG_DEAD, next)
}
/**
* Create an input event with nothing but a code point. This is the most basic possible input
* event; it contains no information on many things the IME requires to function correctly,