mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-10 12:51:16 +07:00
KeyPressDispatcher no longer silently eats exceptions (#6931)
This commit is contained in:
parent
fe0ec08e61
commit
6f7af9ee22
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user