mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-18 07:53:07 +00:00
make it compile (again, why did it work before?)
This commit is contained in:
parent
04430fdb21
commit
eee94f2924
3 changed files with 8 additions and 8 deletions
|
@ -17,7 +17,7 @@ interface Combiner {
|
||||||
* @param event the event to combine with the existing state.
|
* @param event the event to combine with the existing state.
|
||||||
* @return the resulting event.
|
* @return the resulting event.
|
||||||
*/
|
*/
|
||||||
fun processEvent(previousEvents: ArrayList<Event>?, event: Event?): Event
|
fun processEvent(previousEvents: ArrayList<Event>?, event: Event): Event
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the feedback that should be shown to the user for the current state of this combiner.
|
* Get the feedback that should be shown to the user for the current state of this combiner.
|
||||||
|
|
|
@ -188,18 +188,18 @@ class DeadKeyCombiner : Combiner {
|
||||||
// TODO: make this a list of events instead
|
// TODO: make this a list of events instead
|
||||||
val mDeadSequence = StringBuilder()
|
val mDeadSequence = StringBuilder()
|
||||||
|
|
||||||
override fun processEvent(previousEvents: ArrayList<Event>?, event: Event?): Event {
|
override fun processEvent(previousEvents: ArrayList<Event>?, event: Event): Event {
|
||||||
if (TextUtils.isEmpty(mDeadSequence)) { // No dead char is currently being tracked: this is the most common case.
|
if (TextUtils.isEmpty(mDeadSequence)) { // No dead char is currently being tracked: this is the most common case.
|
||||||
if (event!!.isDead) { // The event was a dead key. Start tracking it.
|
if (event.isDead) { // The event was a dead key. Start tracking it.
|
||||||
mDeadSequence.appendCodePoint(event.mCodePoint)
|
mDeadSequence.appendCodePoint(event.mCodePoint)
|
||||||
return Event.createConsumedEvent(event)
|
return Event.createConsumedEvent(event)
|
||||||
}
|
}
|
||||||
// Regular keystroke when not keeping track of a dead key. Simply said, there are
|
// Regular keystroke when not keeping track of a dead key. Simply said, there are
|
||||||
// no dead keys at all in the current input, so this combiner has nothing to do and
|
// no dead keys at all in the current input, so this combiner has nothing to do and
|
||||||
// simply returns the event as is. The majority of events will go through this path.
|
// simply returns the event as is. The majority of events will go through this path.
|
||||||
return event
|
return event
|
||||||
}
|
}
|
||||||
if (Character.isWhitespace(event!!.mCodePoint)
|
if (Character.isWhitespace(event.mCodePoint)
|
||||||
|| event.mCodePoint == mDeadSequence.codePointBefore(mDeadSequence.length)) { // When whitespace or twice the same dead key, we should output the dead sequence as is.
|
|| event.mCodePoint == mDeadSequence.codePointBefore(mDeadSequence.length)) { // When whitespace or twice the same dead key, we should output the dead sequence as is.
|
||||||
val resultEvent = createEventChainFromSequence(mDeadSequence.toString(), event)
|
val resultEvent = createEventChainFromSequence(mDeadSequence.toString(), event)
|
||||||
mDeadSequence.setLength(0)
|
mDeadSequence.setLength(0)
|
||||||
|
|
|
@ -11,8 +11,8 @@ class HangulCombiner : Combiner {
|
||||||
val history: MutableList<HangulSyllable> = mutableListOf()
|
val history: MutableList<HangulSyllable> = mutableListOf()
|
||||||
val syllable: HangulSyllable? get() = history.lastOrNull()
|
val syllable: HangulSyllable? get() = history.lastOrNull()
|
||||||
|
|
||||||
override fun processEvent(previousEvents: ArrayList<Event>?, event: Event?): Event? {
|
override fun processEvent(previousEvents: ArrayList<Event>?, event: Event): Event {
|
||||||
if(event == null || event.mKeyCode == Constants.CODE_SHIFT) return event
|
if(event.mKeyCode == Constants.CODE_SHIFT) return event
|
||||||
if(Character.isWhitespace(event.mCodePoint)) {
|
if(Character.isWhitespace(event.mCodePoint)) {
|
||||||
val text = combiningStateFeedback
|
val text = combiningStateFeedback
|
||||||
reset()
|
reset()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue