Use macOS-style modifier keys (wishlist)

Bug #1624189 reported by wolf
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Switchboard Keyboard Plug
Confirmed
Undecided
Unassigned

Bug Description

I'm using a Macintosh-style keyboard with Loki and would like my modifier keys to work as they do in OS X. That is, I would like:

* to copy, paste, new window with Super (Cmd) by default and not Ctrl
* option/alt and the arrow keys to jump whole words
* option/alt+shift+hyphen for em dash; option/alt+e then grave accent for è
* essentially the shortcuts as the OS X column says here: https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts#Text_editing

I thought that by choosing the "English (Macintosh)" keyboard layout that this would happen automatically—would that be a bug or a feature request? (Is there any elementary OS-internal way to activate this? If not, what is the easiest external tool that already has a profile/config set up for this use case?)

Was recommended to take this request here from http://elementaryos.stackexchange.com/questions/7889/use-macos-style-modifier-keys?noredirect=1#comment10873_7889

wolf (w+lf)
description: updated
Revision history for this message
wolf (w+lf) wrote :

To add to this, the same way that OS X lets users customize system shortcuts (http://www.howtogeek.com/howto/39520/how-to-change-the-cmdq-shortcut-key-in-os-x-to-stop-accidentally-closing-apps/), it would be the nice to do the same here.

I do not want to remap my Super (⌘) as Ctrl--I want it to remain Super, distinct from Ctrl's other uses--but I do want to switch the default modifier key for most system functions (copy/paste, new window/tab, select all, ability to move between words and pages with shift/option/command keys)

Revision history for this message
wolf (w+lf) wrote :

I'd be willing to work on this, just would need some advice on where to begin.

System-level reassignment of modifier key use? A new keyboard profile that modifies the "English (Macintosh)" layout? A separate program (where would it best hook in with the system)?

description: updated
Revision history for this message
Santiago (santileortiz) wrote :

I don't use OSX so I don't know exactly which features you require, but from your description it seems that implementing a solution for this would require touching several different aspects of the system, and it isn't a very straightforward task. For instance:

* Option/alt+shift+hyphen for em dash; option/alt+e then grave accent for è

These seem to be a problem of xkb's English(Macintosh) layout description, and should be fixed either upstream on xkeyboard-config, or you can create a custom layout with these options for yourself.

* Copy/Paste, New Window/Tab with Super and not Ctrl

The problem here is applications are the ones that choose what to do here, so this may be an Epiphany, Chrome, or Files thing. It depends if the application provides a way to modify them, this is why the easy thing to do here is to put Ctrl on the Super key, then applications won't even know what happened, and it will work everywhere. But still, another problem with this is it goes against the design decision on elementary of having most system wide shortcuts assigned to Super, and leave Ctrl for application specific shortcuts.

I think you actually do want to remap Super as Control, and then look at Settings>Keyboard>Shortcuts and change the ones you like, from Super+<key> to Ctrl+<key>. So overall I think most of these things can be solved by creating a better English (Macintosh) layout, and changing some of the system keybindings, but we would have to check for conflicts with default ones like Super+T to open the terminal.

Maxim Taranov (png2378)
affects: elementaryos → switchboard-plug-keyboard
Changed in switchboard-plug-keyboard:
status: New → Confirmed
Revision history for this message
Zisu Andrei (matzipan) wrote :

Hey wolf,

Maybe worth having a look at Gala? I'm not sure where, though :(

Revision history for this message
Maurits Lamers (mauritslamers) wrote :

Adding my 2cts to this bug: I would like to have the identical keyboard shortcuts as OSX. This goes much further than simply remapping cmd to ctrl.

OSX uses Cmd instead of Ctrl for many actions so you don't need to use any extra modifiers when using applications like Terminal, where Ctrl already has a meaning by itself. In "default" Linux Shift has to be added, which is not a keyboard shortcut which can be done with a relaxed hand.

What also need to be covered is basic cursor management. Under OSX Cmd+right arrow is end of line, Cmd+left arrow is beginning of line, Cmd+arrow up is top of document, Cmd+arrow down end of document etc.

Ideally there should be a list of actions/events which then can be linked to specific key combinations.

A basic list of key combinations can be found here: https://support.apple.com/en-us/HT201236

Revision history for this message
Zisu Andrei (matzipan) wrote :

Welp, I can see how not having cmd+left/right is annoying on a mac keyboard. Non-mac keyboards have Home/End.

Revision history for this message
Richard Morris (richard.morris) wrote :

What you can do us use function and left right arrow keys to move to start end of the line. function up and down scroll one page up our down. I've still not found a good short cut to go to the top of document.

Revision history for this message
Maurits Lamers (mauritslamers) wrote :

@matzipan: Some Mac keyboards do have Home and End, but MacBook (Pro) keyboards do not have Home and End by default. Even when I am using a full keyboard, I prefer Cmd+left/right above Home and End, because it is consistent, and because they do not require a "jump" of the hand to another "island" in the keyboard.

@richard.morris: While the Fn+left/right looks like a good solution on a laptop keyboard, but on a Mac aluminium keyboard the fn is on the same island as Home and End, which breaks consistency and negates any advantage above using Home and End.

Revision history for this message
Maurits Lamers (mauritslamers) wrote :

Additionally, it would be even better if it would be possible to mimic the typical Mac Ctrl-click option as an alternative to right click. Even though modern Mac laptops do currently have an option to use the right part of the touchpad as right click (not only in tap), older laptops do not. From my experience with other Linux window managers / desktop environments, I remember that this goes way down to the way how X deals with input.

I wouldn't have a problem trying to create a basic fix myself, if I only would have some kind of idea where to start with this, as well as how far down the rabbit hole I would need to go.

Revision history for this message
Raymond Plante (raymond-plante) wrote :

I would love this feature. Going through so many hoops to create a OSX like experience with Elementry OS, key bindings are the biggest issue remaining!

BTW @mauritslamers I found a way to enable the right click on lower right corner of mac touchpad: http://elementaryos.stackexchange.com/questions/9925/how-to-enable-lower-right-corner-touchpad-as-secondary-click-on-2008-macbook-5-1

Pothi Kalimuthu (pothi)
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Khaled Ezzughayyar (ezzughayyar) wrote :

I would like to see this feature.
What's the status now for this ticket?

Revision history for this message
jmowen (jmowen) wrote :

Bump for interest in this feature. It would be terrific to have "hot-swappable" templates which can be named/edited/duplicated/exported/imported, each template specifying a set of systemwide keyboard shortcuts (including those which are normally managed at application level / not editable via System Settings > Keyboard, e.g. Ctrl + V : paste, Ctrl + C : copy, etc).

Revision history for this message
Guillaume Hain (zedtux) wrote :

I'm also looking for this feature, and as Khaled I'd like to know what's the status of this issue?

Thanks !

Revision history for this message
Ben Reaves (rbreaves) wrote :

Pretty sure I have solved this with my project on over at github. Kinto handles all of the wordwise functionality everyone is talking about Cmd+Arrow or Option+Arrow stuff that moves the cursor across each word or the entire line.

Word-wise was solved by creating new xkb symbols and types files to handle the re-assignment, wasn't particularly easy for me though.. before this project I had no knowledge of xkb and still struggled with it for few months.

The most difficult part about the situation was to make the Terminals operate the exact same way as they do under macOS, but that is really just handled by keeping Ctrl and Alt/Option/Win as they are and remapping Cmd/Alt to Ctrl+Shift while a Terminal has the focus. Initially I tried what a lot of people were doing, using Super for a lot of things, but that just makes things even more complicated and requires a lot of remapping in places you just don't want to be.

Kinto also uses a json config file and you can add in as many tweaks as you want to load up depending on the app category and you can add more than just the default gui and term categories I add by default. I may add a 3rd down the road for web browsers specifically, to make it even more mac like later due to wordwise and browsers sharing similar shortcuts, but I will have to hook into ibus signals to fully resolve it so they no longer conflict.. that's a problem that no one even talks about it lol.

https://github.com/rbreaves/kinto

Revision history for this message
Ben Reaves (rbreaves) wrote :

I don't believe I can edit my last comment, so I will make another. I have done a fairly major update to kinto so that it now just uses xkeysnail which only needs a python config file to accomplish the same thing I was doing earlier. Kinto also converts xkeysnail into an actual service in systemd.

https://github.com/rbreaves/kinto
https://github.com/mooz/xkeysnail

I don't know the likelihood of anyone being able to integrate kinto or xkeysnail into switchboard, but that would be pretty awesome.

I think any solution though will need the ability to give the users the ability to add additional terminal names to be excluded from the mac like remaps and to make the Cmd key position Ctrl+Shift by default. That'd keep it simple, might not fix everything but it'd satisfy most requirements.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.