Convert Mac-like keystrokes into Linux keystrokes (remap)
I would like to configure my keyboard to work as close to a MacBook as possible.
Here are some examples of what I would like to do:
---------------+------------------------------------------------
I press stroke | App receives stroke
---------------+------------------------------------------------
Alt-Shift-[ Ctrl-PageUp (move to previous tab)
Ctrl-Backspace Delete
Alt-Left Home (move cursor to beginning of line)
Super-Left Ctrl-Left (move cursor left one word)
Super-Shift-Left Ctrl-Shift-Left (select left one word)
(Note that usually Mac keyboards have Cmd where PC keyboards have Alt/Meta, and Opt where PC keyboards have Win/Super)
How could I go about this?
I have experimented in the past intercepting keystrokes with Fluxbox, and emitting keystrokes with xdotool. The problem with this approach was that the app would see the original modifier key I had pressed down, unless I cleared it, in which case that would lose my input state. And sometimes when I let go, X would think the modifier key was still pressed down.
For this reason, I think I need a high-level layer (in X or in the WM) that can completely hide my actual keyboard state from apps, and simulate the keystrokes that actually get passed down to apps. (Something WM-independent would be great, but I could live with a WM-specific solution.)
For bonus points (I can live without this), make it possible to switch behaviour depending on the app that currently has keyboard focus:
Alt-C Ctrl-Shift-C on gnome-terminal or konsole
Ctrl-C in other apps
I imagine some WM integration would be needed for this.
keyboard shortcut-keys keyboard-layout mac
This question has an open bounty worth +200
reputation from joeytwiddle ending tomorrow.
This question has not received enough attention.
add a comment |
I would like to configure my keyboard to work as close to a MacBook as possible.
Here are some examples of what I would like to do:
---------------+------------------------------------------------
I press stroke | App receives stroke
---------------+------------------------------------------------
Alt-Shift-[ Ctrl-PageUp (move to previous tab)
Ctrl-Backspace Delete
Alt-Left Home (move cursor to beginning of line)
Super-Left Ctrl-Left (move cursor left one word)
Super-Shift-Left Ctrl-Shift-Left (select left one word)
(Note that usually Mac keyboards have Cmd where PC keyboards have Alt/Meta, and Opt where PC keyboards have Win/Super)
How could I go about this?
I have experimented in the past intercepting keystrokes with Fluxbox, and emitting keystrokes with xdotool. The problem with this approach was that the app would see the original modifier key I had pressed down, unless I cleared it, in which case that would lose my input state. And sometimes when I let go, X would think the modifier key was still pressed down.
For this reason, I think I need a high-level layer (in X or in the WM) that can completely hide my actual keyboard state from apps, and simulate the keystrokes that actually get passed down to apps. (Something WM-independent would be great, but I could live with a WM-specific solution.)
For bonus points (I can live without this), make it possible to switch behaviour depending on the app that currently has keyboard focus:
Alt-C Ctrl-Shift-C on gnome-terminal or konsole
Ctrl-C in other apps
I imagine some WM integration would be needed for this.
keyboard shortcut-keys keyboard-layout mac
This question has an open bounty worth +200
reputation from joeytwiddle ending tomorrow.
This question has not received enough attention.
Have you seen this: askubuntu.com/questions/10008/…
– George Udosen
yesterday
Thank you very much @GeorgeUdosen, somehow I had not found that question! It does cover most of my requirements. So if nobody can tackle my app-specific bonus soon, then I think we can close this as a duplicate. (FWIW I am using KDE this month.)
– joeytwiddle
21 hours ago
add a comment |
I would like to configure my keyboard to work as close to a MacBook as possible.
Here are some examples of what I would like to do:
---------------+------------------------------------------------
I press stroke | App receives stroke
---------------+------------------------------------------------
Alt-Shift-[ Ctrl-PageUp (move to previous tab)
Ctrl-Backspace Delete
Alt-Left Home (move cursor to beginning of line)
Super-Left Ctrl-Left (move cursor left one word)
Super-Shift-Left Ctrl-Shift-Left (select left one word)
(Note that usually Mac keyboards have Cmd where PC keyboards have Alt/Meta, and Opt where PC keyboards have Win/Super)
How could I go about this?
I have experimented in the past intercepting keystrokes with Fluxbox, and emitting keystrokes with xdotool. The problem with this approach was that the app would see the original modifier key I had pressed down, unless I cleared it, in which case that would lose my input state. And sometimes when I let go, X would think the modifier key was still pressed down.
For this reason, I think I need a high-level layer (in X or in the WM) that can completely hide my actual keyboard state from apps, and simulate the keystrokes that actually get passed down to apps. (Something WM-independent would be great, but I could live with a WM-specific solution.)
For bonus points (I can live without this), make it possible to switch behaviour depending on the app that currently has keyboard focus:
Alt-C Ctrl-Shift-C on gnome-terminal or konsole
Ctrl-C in other apps
I imagine some WM integration would be needed for this.
keyboard shortcut-keys keyboard-layout mac
I would like to configure my keyboard to work as close to a MacBook as possible.
Here are some examples of what I would like to do:
---------------+------------------------------------------------
I press stroke | App receives stroke
---------------+------------------------------------------------
Alt-Shift-[ Ctrl-PageUp (move to previous tab)
Ctrl-Backspace Delete
Alt-Left Home (move cursor to beginning of line)
Super-Left Ctrl-Left (move cursor left one word)
Super-Shift-Left Ctrl-Shift-Left (select left one word)
(Note that usually Mac keyboards have Cmd where PC keyboards have Alt/Meta, and Opt where PC keyboards have Win/Super)
How could I go about this?
I have experimented in the past intercepting keystrokes with Fluxbox, and emitting keystrokes with xdotool. The problem with this approach was that the app would see the original modifier key I had pressed down, unless I cleared it, in which case that would lose my input state. And sometimes when I let go, X would think the modifier key was still pressed down.
For this reason, I think I need a high-level layer (in X or in the WM) that can completely hide my actual keyboard state from apps, and simulate the keystrokes that actually get passed down to apps. (Something WM-independent would be great, but I could live with a WM-specific solution.)
For bonus points (I can live without this), make it possible to switch behaviour depending on the app that currently has keyboard focus:
Alt-C Ctrl-Shift-C on gnome-terminal or konsole
Ctrl-C in other apps
I imagine some WM integration would be needed for this.
keyboard shortcut-keys keyboard-layout mac
keyboard shortcut-keys keyboard-layout mac
asked Dec 12 at 7:34
joeytwiddle
8791020
8791020
This question has an open bounty worth +200
reputation from joeytwiddle ending tomorrow.
This question has not received enough attention.
This question has an open bounty worth +200
reputation from joeytwiddle ending tomorrow.
This question has not received enough attention.
Have you seen this: askubuntu.com/questions/10008/…
– George Udosen
yesterday
Thank you very much @GeorgeUdosen, somehow I had not found that question! It does cover most of my requirements. So if nobody can tackle my app-specific bonus soon, then I think we can close this as a duplicate. (FWIW I am using KDE this month.)
– joeytwiddle
21 hours ago
add a comment |
Have you seen this: askubuntu.com/questions/10008/…
– George Udosen
yesterday
Thank you very much @GeorgeUdosen, somehow I had not found that question! It does cover most of my requirements. So if nobody can tackle my app-specific bonus soon, then I think we can close this as a duplicate. (FWIW I am using KDE this month.)
– joeytwiddle
21 hours ago
Have you seen this: askubuntu.com/questions/10008/…
– George Udosen
yesterday
Have you seen this: askubuntu.com/questions/10008/…
– George Udosen
yesterday
Thank you very much @GeorgeUdosen, somehow I had not found that question! It does cover most of my requirements. So if nobody can tackle my app-specific bonus soon, then I think we can close this as a duplicate. (FWIW I am using KDE this month.)
– joeytwiddle
21 hours ago
Thank you very much @GeorgeUdosen, somehow I had not found that question! It does cover most of my requirements. So if nobody can tackle my app-specific bonus soon, then I think we can close this as a duplicate. (FWIW I am using KDE this month.)
– joeytwiddle
21 hours ago
add a comment |
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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%2faskubuntu.com%2fquestions%2f1100236%2fconvert-mac-like-keystrokes-into-linux-keystrokes-remap%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Ask Ubuntu!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2faskubuntu.com%2fquestions%2f1100236%2fconvert-mac-like-keystrokes-into-linux-keystrokes-remap%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
Have you seen this: askubuntu.com/questions/10008/…
– George Udosen
yesterday
Thank you very much @GeorgeUdosen, somehow I had not found that question! It does cover most of my requirements. So if nobody can tackle my app-specific bonus soon, then I think we can close this as a duplicate. (FWIW I am using KDE this month.)
– joeytwiddle
21 hours ago