Skip to content

Commit

Permalink
refactor TerminalKeyListener (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
sydneyaldo authored Aug 14, 2020
1 parent 8029dbb commit e604da8
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,16 @@ class TerminalKeyListener(tm: TerminalManager?,

//Log.i("CBKeyDebug", KeyEventUtil.describeKeyEvent(keyCode, event));
bridge.resetScrollPosition()

// Handle potentially multi-character IME input.
if (hasMultiCharInput(event, keyCode) || flagRaised(event, keyCode) || needReturn(interpretAsHardKeyboard, keyCode, event)) return true

getUnicode(event)

if (hasShift(keyCode) || hasNonCtrlChar() || hasKeyCode(keyCode)) return true
// Handle potentially multi-character IME input.
var handleInput = hasMultiCharInput(event, keyCode) || flagRaised(event, keyCode) || needReturn(interpretAsHardKeyboard, keyCode, event)
handleInput = handleInput || hasShift(keyCode) || hasNonCtrlChar() || hasKeyCode(keyCode)
if (handleInput) return true
} catch (e: IOException) {
handleProblem(e, "Problem while trying to handle an onKey() event")
} catch (npe: NullPointerException) {
Log.d(TAG, "Input before connection established ignored.")
return true
}
return false
}
Expand Down

0 comments on commit e604da8

Please sign in to comment.