osx - JavaFX: Right click on Mac (Control + Click) not being detected. Any fixes? -
I have a list view with those items, which I allow to double click and right click ( To remove the item). Why not control the Mac? thank you in advanced.
Edit: My code
listview.setOnMouseClicked (new event handler & lt; mouse Event & gt; () {@Override Public Zero Handle (MouseEvent Event) {if ( Event.getButton (.mobButton.PRIMARY) {if (event.getClickCount () == 2) {System.out.println ("double clicked"); Clicked on system.out.println ("" + List view .getSelectionModel (). GetSelectedItem ());}} if (event.getButton (.) Equals (MouseButton.SECONDARY)) {System.out.println ("right click");}}}); My trackpad is set as a secondary button through two finger naps.
Looking for someone else it is right that two finger clicks are registered as mousebutton Will go SECONDARY event, but I think you should also check for Ctrl + MouseButton. If the primary control is a common method to emulate the right click before control, then the statement should be:
if (event.getButton () == mouse button. SECONDARY || e IsControlDown ()) {// right click action}
Comments
Post a Comment