KeyPressDispatcher no longer silently eats exceptions (#6931)

This commit is contained in:
SomeTroglodyte 2022-05-25 18:32:24 +02:00 committed by GitHub
parent fe0ec08e61
commit 6f7af9ee22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,12 +203,9 @@ class KeyPressDispatcher(val name: String? = null) : HashMap<KeyCharAndCode, (()
return super.keyDown(event, keycode)
}
// try-catch mainly for debugging. Breakpoints in the vicinity can make the event fire twice in rapid succession, second time the context can be invalid
if (consoleLog)
println("${this@KeyPressDispatcher}: handling $key")
try {
this@KeyPressDispatcher[key]?.invoke()
} catch (ex: Exception) {}
return true
}
}