Middle Mouse Button Config

It seems most of the info I can find is outdated or a bit insufficient. I’m also not sure my issue fully lines up with most.

In Windows, it’s possible to click the mouse scroll wheel and move the mouse to scroll in any web browser.

This is the part I’m unsure is related or not. Some games require you to press and hold the mouse wheel in to rotate the camera. Not all of them can remap the controls, but some can.

How can I fix these issues?

Look for an “autoscroll” browser setting.

Press and hold what? Which games?

Middle Mouse wheel. Edited and fixed thanks!

I can’t recall titles right off hand but I believe one example is Emergency 4 Deluxe Edition. I feel like Banished and Anno 1800 are 2 more.

Would you share with us which desktop environment you’re on and what you did to fix your issue?

Sorry, I meant I fixed the OP. I did not fix this issue.

My mouse is a Razer Ballistix X Hyperspeed btw.

No one has any tips, tricks, etc?

Well, maybe we don’t fully undressed the issue, yet. Are you saying that the middle mouse button is working “in general”, but some games don’t recognize middle mouse clicks? Or that those games don’t offer a rebinding of a certain function?

Maybe you tell us a little more on the actual issue you’re experiencing.

I know this is basically irrelevant, but all my different Linux systems recognize middle mouse clicks without a problem. Did you try a different mouse yet?

All you had to do was ask. :wink:

So the middle mouse button works for some things but not others. I can use it to open a folder in a new tab while using Dolphin. I can use it to paste at a command shell. However, I could not click and hold it while moving the mouse to scroll in web browsers(Vivaldi is my default). Another example is the game Emergency 4 Deluxe. It’s an older game. There is no built in funtion to remap keys. Normally, this is how you would rotate the camera.

Hopefully that makes it clearer? Perhaps trying to install the open source razer driver might help?

By default, middle mouse drag should work in games and such. No intervention should be needed. It’s unexpected that it doesn’t work.

Conversely, middle mouse scroll being a browser setting that is off by default in Linux (because middle mouse also pastes) is expected. I think this is where the two of you got your wires crossed.

On a hunch, while trying to fix the browser thing, did you perhaps check the “Hold down middle button and move mouse to scroll” option in the KDE system setting? That would likely break middle mouse drag in games. Go to Mouse settings and make sure it’s unchecked, then try again in the games. Browser scrolling should not be affected by this setting, it uses its own setting for this.

Sidenote: Highlight copying and middle mouse pasting being a thing in Linux is a very annoying legacy (anti-)“feature” that is sadly (AFAIK) impossible to completely disable. It’s too deeply integrated into everything.

It’s the reason the auto scrolling is disabled by default in browsers on Linux. You can enable browser auto scrolling, but you’re technically still also pasting every time you click the middle mouse button, which can be a security concern (say you recently copied a password or highlighted something private, and the website happens to be monitoring paste events).

It’s better to break the habit of middle mouse click scrolling and form new scrolling habits to replace it. Personally, I use Logitech mice that have the magnetic free wheel scrolling instead. Or just use the keyboard where practical.

All that @zymotek writes is 100% true. I’m sorry that I personally do not to have any better hint on this topic, but my AI-overlord seems to have a few ideas including switching from Wayland to X11 or this:

Use a tool like:

  • keyd (system‑wide), or

  • xinput/xmodmap (X11 only), or

  • imwheel (for some mice).

  • Map a spare key (e.g. Caps Lock or an extra mouse button) to mouse button 2 for the Emergency 4 process or while its window is active.

which I would consider a total overkill and I’d rather abandon a game than messing that deeply with my system but of course YMMV.

But please do yourself the favor of creating a snapshot before trying any X11 shenanigans, we don’t want you to break your system along the way.

Adding to this, I used to use xmodmap for managing rebindings in X11 - it’s easy but stops working randomly and after running updates (before restarting).

For my Razer mouse specifically, I just rebind it in Windows and don’t touch it in Linux (I have my DPI button to middle mouse click, because the scroll wheel switch is trash). Not sure if you can do something similar with the middle mouse button to something else, or if that’s even relevant.

This was indeed on, and I disabled it. That seems to have fixed the problem in EM4. Going to test a few other games.

Now as far as the browser, if I have enabled middle mouse button to scroll, it does fix the browser issue to an extent. I forgot that in Windows, I actually just had to click the middle mouse button and move the mouse. I didn’t have to hold it, but you bring up middle mouse/paste and I get ehat you are saying but wouldn’t it be possible just to remap that function using keyd or one of the other apps above?

[forget what I wrote here, it was nonsense. time to go to bed…]

I know that feeling lol. I apologize for not mentioning it earlier, but I am on KDE.

I’m really confused now. Let me try to unconfuse the situation:

  1. You wanted to have the Middle Mouse Button to work correctly in Emergency 4 Deluxe Edition. According to you, this was fixed my @zymotek 's tip. :white_check_mark:
  2. You want to click the Middle Mouse Button and then move the mouse to scroll in browsers. This is a KDE-feature (as @zymotek explained) :white_check_mark: , but you switched that off to make EM4 work :stop_sign: So you disabled the functionality you are looking for in order to fix EM4. :thinking:

Seems like a perfect Catch22 to me. And this question I don’t really understand :

I forgot that in Windows, I actually just had to click the middle mouse button and move the mouse. wouldn’t it be possible just to remap that function using keyd or one of the other apps above?

You want… what exactly? The “Autoscroll”-functionality to be mapped to another key? Because you disabled it in KDE? I start to get the feeling you’d be better off either disabling the Autoscroll in KDE before playing EM4 and turning it back on later or stop playing EM4 and get on with something new :sweat_smile: I really mean it, EM4 is a whopping 20 years old now, maybe you find something adequate that will not lead you into such a rabbit hole.

I guess I can’t help here.

I explained the difference between the Windows function and the cathy(linux? kde?) function.

The cachy option requires pressing and holding the middle mouse button. Then, move the mouse.

The windows option only requires a click (not a press and hold). Then move the muse.

Not a catch 22 at all.

I think I can work around this but it would be nice to get the razer drivers working in linux to further experiment and adjust dpi and such. Otherwise, I will live with remapping one of my extra mouse keys to top of page as I already have to work around the browser issue to start, plus the added security concern.

You need to look in your browser settings for something called auto scroll or similar. Not KDE settings. It may be quite a well hidden setting.

For example, in Brave, you have to navigate to brave://flags and then search for “middle button autoscroll”. Other browsers will have it somewhere else.

If enabled, it should work exactly like in Windows. Except, you’ll still be pasting when you middle click, courtesy of that long standing Linux tradition that’s probably half a century old at this point.

I mean, you could remap the middle mouse button to something else, but then it’s not the middle mouse button anymore when you click it. For example, if you remap it to CTRL, then clicking it will be the same as pressing CTRL on the keyboard. It won’t do the same thing anymore.

As long as it’s a middle mouse button click event, it will do the “paste the last thing I selected” action. And, even if you remap it to avoid the paste, any time you select some text, you’re still copying it into the buffer that would be used for the middle click paste.

IMO, this is a very bad thing and should not exist. Or, at least, be easy to disable. But, alas, it is a deeply rooted convention and we are stuck with the sins of the past.

I have not found a reliable way to globally disable this behavior.

If anyone knows of one, I’d really like to know.

PS: KDE does have a “Pastes selected text” option under General Behavior, which you can uncheck. But this is A) exclusive to KDE, and B) does not actually work globally (some applications still do the paste anyway), and C) does not suppress the copy selection behavior.

I went to vivaldi:settings and searched for auto and scroll but no luck. I guess I will just have to settle for setting one of the side keys to top of page. The other is mapped as back and works globally both in KDE and Vivaldi.

At this point, I was more curious than anything. I guess I am going to have to adjust, atleast untill I can upgrade my mouse.

Thanks for all the feedback to all of you!

This helped me, thanks!