Project

General

Profile

How can i get WMouseEvent

Added by Everton Fonseca almost 7 years ago

How can i get WMouseEvent when button right was pressed?

WContainerWidget wcontainer = new WContainerWidget();

wcontanier.clicked().addListener(this,(mouse)->{

System.out.println("Mouse: "+mouse.getButton());

});


Replies (2)

RE: How can i get WMouseEvent - Added by Wim Dumon almost 7 years ago

Hello Everton,

The example treeview-dragdrop demonstrates how this is done:

        /*
         * To support right-click, we need to disable the built-in browser
         * context menu.
         *
         * Note that disabling the context menu and catching the right-click
         * does not work reliably on all browsers.
         */
        treeView.setAttributeValue("oncontextmenu",
                "event.cancelBubble = true; event.returnValue = false; return false;");

Wim.

    (1-2/2)