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

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -