How can I simulate the middle mouse button on Linux?
I just got a 4-button trackball mouse without a mousewheel (many of those don't have a mousewheel, for some reason), and I would like to make one of those buttons act like the middle mouse button (for the purpose of autoscrolling). The 4-buttons, by default, are for left click, right click, back and forward (i.e. back/forward a page while web browsing). I changed the back/forward buttons to act like page-up and page-down (using xte
and xbindkeys
as suggested in an answer to a question somewhere on StackExchange), but I wasn't completely satisfied with that; so, I'd like to turn one of those buttons (the back button) into the middle mouse button, and do something creative with the other one, but I don't know how to make one mouse button simulate another (nor do I know the name of the middle mouse button). I do, however, know how to make a mouse button represent a key or key combination on a keyboard (or how to make it launch a program or script). Edit: I found out a way to remap mouse buttons, but it doesn't seem to work with Button-2 (that's the right button, right? I'm wanting the button that makes a circle with arrows appear and when you move the mouse it scrolls in the direction you move it; also, when you click a link with it, it opens it in a new tab, and such).
Anyway, here's what I attempted putting in my .xbindkeysrc
file:
"xte 'mouseclick 2'"
b:8
Note: Pressing left-click and right-click at the same time doesn't simulate the middle mouse button on my OS (Xubuntu 17.04) with my mouse.
linux mouse shortcuts xubuntu mouse-click
add a comment |
I just got a 4-button trackball mouse without a mousewheel (many of those don't have a mousewheel, for some reason), and I would like to make one of those buttons act like the middle mouse button (for the purpose of autoscrolling). The 4-buttons, by default, are for left click, right click, back and forward (i.e. back/forward a page while web browsing). I changed the back/forward buttons to act like page-up and page-down (using xte
and xbindkeys
as suggested in an answer to a question somewhere on StackExchange), but I wasn't completely satisfied with that; so, I'd like to turn one of those buttons (the back button) into the middle mouse button, and do something creative with the other one, but I don't know how to make one mouse button simulate another (nor do I know the name of the middle mouse button). I do, however, know how to make a mouse button represent a key or key combination on a keyboard (or how to make it launch a program or script). Edit: I found out a way to remap mouse buttons, but it doesn't seem to work with Button-2 (that's the right button, right? I'm wanting the button that makes a circle with arrows appear and when you move the mouse it scrolls in the direction you move it; also, when you click a link with it, it opens it in a new tab, and such).
Anyway, here's what I attempted putting in my .xbindkeysrc
file:
"xte 'mouseclick 2'"
b:8
Note: Pressing left-click and right-click at the same time doesn't simulate the middle mouse button on my OS (Xubuntu 17.04) with my mouse.
linux mouse shortcuts xubuntu mouse-click
1
Bothxbindkeys
andxte
are additional applications that intercept X events. It's cleaner to just change the button map, e.g. withxinput --set-button-map
or via properties, depending on how your trackball works. Seeman xinput
, andman evdev
if you want to record the buttonmap in anxorg.conf
to make it work automatically on boot.
– dirkt
Oct 17 '17 at 14:47
add a comment |
I just got a 4-button trackball mouse without a mousewheel (many of those don't have a mousewheel, for some reason), and I would like to make one of those buttons act like the middle mouse button (for the purpose of autoscrolling). The 4-buttons, by default, are for left click, right click, back and forward (i.e. back/forward a page while web browsing). I changed the back/forward buttons to act like page-up and page-down (using xte
and xbindkeys
as suggested in an answer to a question somewhere on StackExchange), but I wasn't completely satisfied with that; so, I'd like to turn one of those buttons (the back button) into the middle mouse button, and do something creative with the other one, but I don't know how to make one mouse button simulate another (nor do I know the name of the middle mouse button). I do, however, know how to make a mouse button represent a key or key combination on a keyboard (or how to make it launch a program or script). Edit: I found out a way to remap mouse buttons, but it doesn't seem to work with Button-2 (that's the right button, right? I'm wanting the button that makes a circle with arrows appear and when you move the mouse it scrolls in the direction you move it; also, when you click a link with it, it opens it in a new tab, and such).
Anyway, here's what I attempted putting in my .xbindkeysrc
file:
"xte 'mouseclick 2'"
b:8
Note: Pressing left-click and right-click at the same time doesn't simulate the middle mouse button on my OS (Xubuntu 17.04) with my mouse.
linux mouse shortcuts xubuntu mouse-click
I just got a 4-button trackball mouse without a mousewheel (many of those don't have a mousewheel, for some reason), and I would like to make one of those buttons act like the middle mouse button (for the purpose of autoscrolling). The 4-buttons, by default, are for left click, right click, back and forward (i.e. back/forward a page while web browsing). I changed the back/forward buttons to act like page-up and page-down (using xte
and xbindkeys
as suggested in an answer to a question somewhere on StackExchange), but I wasn't completely satisfied with that; so, I'd like to turn one of those buttons (the back button) into the middle mouse button, and do something creative with the other one, but I don't know how to make one mouse button simulate another (nor do I know the name of the middle mouse button). I do, however, know how to make a mouse button represent a key or key combination on a keyboard (or how to make it launch a program or script). Edit: I found out a way to remap mouse buttons, but it doesn't seem to work with Button-2 (that's the right button, right? I'm wanting the button that makes a circle with arrows appear and when you move the mouse it scrolls in the direction you move it; also, when you click a link with it, it opens it in a new tab, and such).
Anyway, here's what I attempted putting in my .xbindkeysrc
file:
"xte 'mouseclick 2'"
b:8
Note: Pressing left-click and right-click at the same time doesn't simulate the middle mouse button on my OS (Xubuntu 17.04) with my mouse.
linux mouse shortcuts xubuntu mouse-click
linux mouse shortcuts xubuntu mouse-click
edited Jan 30 at 1:13
Shule
asked Oct 10 '17 at 6:10
ShuleShule
1389
1389
1
Bothxbindkeys
andxte
are additional applications that intercept X events. It's cleaner to just change the button map, e.g. withxinput --set-button-map
or via properties, depending on how your trackball works. Seeman xinput
, andman evdev
if you want to record the buttonmap in anxorg.conf
to make it work automatically on boot.
– dirkt
Oct 17 '17 at 14:47
add a comment |
1
Bothxbindkeys
andxte
are additional applications that intercept X events. It's cleaner to just change the button map, e.g. withxinput --set-button-map
or via properties, depending on how your trackball works. Seeman xinput
, andman evdev
if you want to record the buttonmap in anxorg.conf
to make it work automatically on boot.
– dirkt
Oct 17 '17 at 14:47
1
1
Both
xbindkeys
and xte
are additional applications that intercept X events. It's cleaner to just change the button map, e.g. with xinput --set-button-map
or via properties, depending on how your trackball works. See man xinput
, and man evdev
if you want to record the buttonmap in an xorg.conf
to make it work automatically on boot.– dirkt
Oct 17 '17 at 14:47
Both
xbindkeys
and xte
are additional applications that intercept X events. It's cleaner to just change the button map, e.g. with xinput --set-button-map
or via properties, depending on how your trackball works. See man xinput
, and man evdev
if you want to record the buttonmap in an xorg.conf
to make it work automatically on boot.– dirkt
Oct 17 '17 at 14:47
add a comment |
1 Answer
1
active
oldest
votes
This can be solved by mapping mouse buttons to keyboard keys via xkbset: see Use keys for mouse buttons on linux. Alternative to AHK?
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1257730%2fhow-can-i-simulate-the-middle-mouse-button-on-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This can be solved by mapping mouse buttons to keyboard keys via xkbset: see Use keys for mouse buttons on linux. Alternative to AHK?
add a comment |
This can be solved by mapping mouse buttons to keyboard keys via xkbset: see Use keys for mouse buttons on linux. Alternative to AHK?
add a comment |
This can be solved by mapping mouse buttons to keyboard keys via xkbset: see Use keys for mouse buttons on linux. Alternative to AHK?
This can be solved by mapping mouse buttons to keyboard keys via xkbset: see Use keys for mouse buttons on linux. Alternative to AHK?
answered Jun 7 '18 at 4:04
RussoRusso
1012
1012
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1257730%2fhow-can-i-simulate-the-middle-mouse-button-on-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Both
xbindkeys
andxte
are additional applications that intercept X events. It's cleaner to just change the button map, e.g. withxinput --set-button-map
or via properties, depending on how your trackball works. Seeman xinput
, andman evdev
if you want to record the buttonmap in anxorg.conf
to make it work automatically on boot.– dirkt
Oct 17 '17 at 14:47