I’ve been following the Chicken Outbreak Demo as a reference. I have a SceneBase that contains
...
signal backPressed
Keys.onPressed:{
console.debug("SceneBase: pressed key code: ", event.key)
if(event.key === Qt.Key_Backspace && system.desktopPlatform) {
console.debug("backspace key pressed - simulate a back key pressed on desktop platforms for debugging the user flow of
Android on windows!")
backPressed()
}
}
Keys.onBackPressed: {
backPressed()
}
...
Which is the same code used in the Chicken Outbreak SceneBase.qml
In their MainScene.qml, they have the onBackPressed function and a Connections which prompts the user if they really want to quit. Although I personally wouldn’t want a prompt, I just copied and pasted it and all I got was the debug info “wm_char received for wparam: 8” each time I pressed backspace. So, thinking it had to do with activeScene (the target of their Connections) I tried simply adding a function in my main scene as follows
onBackPressed: {
Qt.quit()
}
and I still only get the debug info “wm_char received for wparam: 8”.
Edit: When I run the Chicken Outbreak Demo, the backspace functionality works on that program.
-
This topic was modified 9 years, 7 months ago by
Nuggetslug.