mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04: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)
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user