QML forwards/back mouse buttons handling -


i'm trying have qml application react forwards/back buttons (sometimes labeled buttons 4/5) on mice. seems mouse area/event allows signals on 3 main mouse buttons.

is there way handle these buttons in qml?

if @ list of predefined mouse buttons you'll see there forwardbutton , backbutton. "trick" need listen these buttons in qml mousearea set acceptedbuttons property.

you either set listen forward , back:

acceptedbuttons: qt.forwardbutton | qt.backbutton 

or listen mouse button:

acceptedbuttons: qt.allbuttons 

putting together, mousearea this:

mousearea {     acceptedbuttons: qt.allbuttons      onclicked: {         if (mouse.button == qt.backbutton) {             console.log("back button");         } else if (mouse.button == qt.forwardbutton) {             console.log("forward button")         }     } } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -