@Mr-Pang
Your QML item should always have a focus otherwise you will get no key events.
For example, in QML you would do something like this:
Rectangle {
focus: true
anchors.fill: parent
[...]
Keys.onPressed: {
console.log("Keys.onPressed!")
event.accepted = true
}
}