Patchwork: mouse buttons should trigger forward/backward in browsing history

Created on 9 Apr 2017  路  8Comments  路  Source: ssbc/patchwork

I have a Razer Deathadder mouse, and I'm very used to using MB4/MB5 for going backwards and forwards in my browser history. Patchwork has the same kind of buttons, but when I press MB4/MB5 on my mouse nothing happens!

It's not a big thing, but it would feel a lot better navigationally if you could use those buttons in the same way as when browsing in Firefox or Chrome.

help wanted enhancement

All 8 comments

In addition it would be nice if macOS style back/forward page gestures worked.

Some FYIs for anybody wanting to implement these:

At least for Windows the app-command event can be used to grab the back button clicks.

On MacOS the swipe event is used for three-finger swipes.

The lack of support for mouse buttons for linux is a known problem, Brave has encountered it and hasn't solved it yet.

This is basically the code needed for Windows support:

if (process.platform == 'win32'){
  windows.main.on('app-command',function(e,cmd){
    if (cmd === 'browser-backward' && views.canGoBack){
      views.goBack()
    }else if (cmd === 'browser-forward' && views.canGoForward){
      views.goForward()
    }
  })
}

oh yes please, I was about to open an issue about this. Has someone tried implementing this already?

Looks like someone is going at a solution in Electron: https://github.com/electron/electron/pull/15441

Since it bugs me a lot, i opened an MR utilising an external library. In case anyone else is interested in this before the Electron releases their fix :smile:

I will keep an eye on that Electron PR; whenever that is released, my solution will be obsolete.

what a ride

This does not seem to be working on Windows 10 with v3.17.7 (probably haven't worked before either).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

entron picture entron  路  6Comments

Gaffen picture Gaffen  路  4Comments

Powersource picture Powersource  路  5Comments

mmckegg picture mmckegg  路  5Comments

slinlee picture slinlee  路  4Comments