Support #7996

Middle mouse button & opening new browser tab (in foreground and background)

Added by max p about 2 years ago. Updated over 1 year ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:



first of all thanks for making this great project :)

I would like to ask about two separate things:

  1. Why 'clicked' event does not fire on the middle mouse button? Let's take this: - there is a button that has assigned 'clicked' callback. It does not react on the middle mouse button. Is it even possible to handle that button?

  2. How to open a new web browser tab in the foreground/background? I know it's possible via WLink, but my goal is to make a popup menu and open a new tab when one of the items is clicked. Currently, I do WApplication::doJavaScript(""), but this approach does not work for Safari (iOS).

Thanks for the help,


Updated by Korneel Dumon about 2 years ago

Hi Max,

there is indeed no clicked-event for the middle button (or right button). The event maps onto browser's clicked event, which only fires for the 'primary' mouse-button. I will adjust the documentation to more accurately reflect that. If you connect to mouseWentDown() or mouseWentUp(), you can get the middle/right clicks.

For WPopupMenu, you can add a WMenuItem to the menu and use WMenuItem::setLink() to achieve what you want.


Updated by max p about 2 years ago


Thanks for the answer.

I will proceed as you have suggested.



Updated by Roel Standaert over 1 year ago

  • Target version set to 4.5.1

Updated by Roel Standaert over 1 year ago

  • Status changed from New to Closed
  • Target version deleted (4.5.1)

Updated by Korneel Dumon over 1 year ago

  • Target version set to 4.5.1

Updated by Roel Standaert over 1 year ago

  • % Done changed from 0 to 100

Also available in: Atom PDF