TESTCORE: only load the test-keybindings if the appname differs

each test app can provide its own application name - and thus would also load a custom keybinding file
Martin Gerhardy 2020-03-15 12:31:26 +01:00
parent 8b86ed2deb
commit 7a1364a136
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,4 @@
# overrides the keybindings from the shared module
ctrl+tab toggleconsole
w +move_forward
a +move_left
s +move_backward

View File

@ -56,7 +56,10 @@ core::AppState TestApp::onConstruct() {
}
core::AppState TestApp::onInit() {
_keybindingHandler.load("test-keybindings.cfg");
// apps may provide their own keybindings
if (_appname != "test") {
_keybindingHandler.load("test-keybindings.cfg");
}
const core::AppState state = Super::onInit();
if (state != core::AppState::Running) {
return state;