[Interest] QML Scene2D No Keyboard Events
Kevron Rees
tripzero.kev at gmail.com
Tue Oct 17 22:45:23 CEST 2017
I'm trying to get keyboard events to my qml item that is being displayed as
a texture using Scene2D. I have simply added Keys.onPressed and MouseArea
to LogoControls[2] in the Scene2D example[1]. If I uncomment MouseArea, I
can see the mouse click console.log message. But I never see "key
pressed". Is there an extra step necessary to get Keyboard events to this
item?
[1] https://doc.qt.io/qt-5/qt3d-scene2d-example.html
[2]
LogoControls {
id: logoControls
width: offscreenTexture.width
height: offscreenTexture.height
focus: true
Keys.onPressed: {
console.log("key pressed")
}
/*MouseArea {
anchors.fill: parent
onClicked: {
console.log("clicked...")
}
}*/
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171017/e5b3b219/attachment.html>
More information about the Interest
mailing list