mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
KeyPressDispatcher no longer silently eats exceptions (#6931)
This commit is contained in:
@ -203,12 +203,9 @@ class KeyPressDispatcher(val name: String? = null) : HashMap<KeyCharAndCode, (()
|
|||||||
return super.keyDown(event, keycode)
|
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)
|
if (consoleLog)
|
||||||
println("${this@KeyPressDispatcher}: handling $key")
|
println("${this@KeyPressDispatcher}: handling $key")
|
||||||
try {
|
|
||||||
this@KeyPressDispatcher[key]?.invoke()
|
this@KeyPressDispatcher[key]?.invoke()
|
||||||
} catch (ex: Exception) {}
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user