Unsolved Qml Image key events
-
Hi, I have a Image object where I show images.
I need to detect PageDown and PageUp key press to change image. How can I detect the key press event inside an Image object?
It seems that key events can detect only in a text object. -
-
Already tried but does not work.
Have you got an example? -
@mrdebug
qt5.13.0 mingw64//QtQuick 2.12 Image{ source: "" anchors.fill: parent focus: true //< Keys.onPressed:{ if(event.key === Qt.Key_PageUp){ console.log("up") } else if(event.key === Qt.Key_PageDown){ console.log("down") } } }
-
It works in a TextEdit object but not in the Image object.
This is not a problem.
Do you know how to resolveconsole.log(event.key, Qt.Key_KeyUp)
qml: 32 undefined -
@mrdebug said in Qml Image key events:
Do you know how to resolve
console.log(event.key, Qt.Key_KeyUp)its Qt.Key_Up instead of Qt.Key_KeyUp