Review Request 115436: Add code navigation via mouse forward/backward buttons

Andrey Matveyakin a.matveyakin at gmail.com
Sun Feb 2 22:02:06 UTC 2014



> On Feb. 2, 2014, 9:36 p.m., Sven Brauch wrote:
> > Hmm. Those keys do not sound very "Forward" / "Backward"-like from their names. Are they really guaranteed to be Forward/Backward on all devides?
> > 
> > Greetings,
> > Sven

Good question :-) Honestly I don't know if it is guaranteed to be Forward/Backward on all devices. What I know is:

1. It does work as Forward/Backward for my mouse (and other “gamer” mice) in many applications. And I've never seen any other usage, besides programming by hand.

2. Other KDE projects compare mouse buttons against Qt::XButton1/2 and I don't see any special checks on whether it is Forward/Backward or something else:


==== Dolphin ---- views/dolphinview.cpp

void DolphinView::slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons)
{
    hideToolTip();

    if (itemIndex < 0) {
        // Trigger the history navigation only when clicking on the viewport:
        // Above an item the XButtons provide a simple way to select items in
        // the singleClick mode.
        if (buttons & Qt::XButton1) {
            emit goBackRequested();
        } else if (buttons & Qt::XButton2) {
            emit goForwardRequested();
        }
    }
}


==== Okular ---- ui/pageview.cpp

void PageView::mousePressEvent( QMouseEvent * e )
{
    ...

    // trigger history navigation for additional mouse buttons
    if ( e->button() == Qt::XButton1 )
    {
        emit mouseBackButtonClick();
        return;
    }
    if ( e->button() == Qt::XButton2 )
    {
        emit mouseForwardButtonClick();
        return;
    }

    ...
}


- Andrey


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115436/#review48780
-----------------------------------------------------------


On Feb. 2, 2014, 8:03 p.m., Andrey Matveyakin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115436/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2014, 8:03 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> Allow to travel through last visited text locations by mouse forward and backward buttons (called XButton1 and XButton2 in Qt).
> 
> 
> Diffs
> -----
> 
>   plugins/contextbrowser/browsemanager.cpp fef2c02 
>   plugins/contextbrowser/contextbrowser.h 0c065a3 
> 
> Diff: https://git.reviewboard.kde.org/r/115436/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrey Matveyakin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140202/f786205d/attachment-0001.html>


More information about the KDevelop-devel mailing list