Live data from Hacker News

Kinto: Mac-style shortcut keys for Linux and Windows

github.com

161–170 of 248 posts

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#161
post #65

This is great, btw. Kinto is 100% a sanity saver. Please note the following rant is mostly tongue-in-cheek. 'cuz it turns out, I personally hate how Windows and Linux do things with `ctrl`. Coming from a Mac, my biggest and most consistent annoyance is that the `ctrl` key is fucking useless at best... One of the most common use cases for the `ctrl` key is COPYING shit and followed by PASTING shit and it DOES NOT WORK…

I'm having difficulty parsing your rant. I can't tell if we agree or not. :) Ctrl+C is a method of generating a standard ASCII character which has meant "ETX" (end of text, sometimes "interrupt") for many decades. Other control chars are useful too. In addition to C, I use S, Q, D, Z, V, O, N, I, G, H, M, L, J, Y, A, E, K, W ... probably others ... fairly regularly. So in the early 1980s, along comes MacOS which need…

We most certainly agree, friend :)

I should have been more clear, indeed, I find sending signals to the system using the `ctrl` good and proper. I have no problem with the control key, sequences, or characters. My issue is ignoring the sheer, maddening, brilliance of the command key...

> Then Linux desktop environments come along and say "well people really like Windows...we don't, but most people who might try our DE probably do, so let's borrow the bad ideas from Windows instead of the good ideas from Unix or MacOS. Let's use Ctrl+C for copy! But also the command line is kind of important on Linux, so let's screw everything up and use Ctrl+Shift+C for copy in the terminal only because who cares about usability and UX consistency? Not us!"

Yes :jacknicholsonnoddingandsmiling:

Linux and non-mac *nix systems emphasize how powerful the command line is but totally fucking ignore even the most fundamental of modern use case(s): copying and fucking pasting. It's just fucking silly. Yew (being a fancy terminal box thing) ain't that powerful if yew cain't (yeah, that's can't + ain't) copy and paste some shit. It's like someone bragging about how fast they can type with their feet, "...cool brometheus... how about you get a fucking job and pay rent for once?"

shakes fist menacingly at the ether

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#162

Earlier quoted context omitted.

That's why I never connect a mouse on my laptops. I've got a touchpad that's part of the keyboard. I select text with it and paste with its middle button. I only buy laptops with three physical buttons precisely because of this user case. A mouse would slow me down. Where a mouse is really needed is in action games. A touchpad is too slow there.

Doesn't the word "mouse" include trackpads in most context?

Maybe, but I'm not sure about it. They are very different in location and interaction patterns.

In this context there is a lot of difference between a mouse and a touchpad. For example, I select text with the keyboard most of the times in emacs and in any other input box (not in vim, is it even possible?). So I'd lose time by reaching to a mouse. I hardly have to move my hands to use my touchpad.

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#163
Consistent cmd+x/c/v is great.

I've tried replicating this experience in Linux in many different ways over the years, but the best approach was to add `altwin(ctrl_alt_win)` to xkeyboard preferences together with custom `ctrl_space_toggle` for layout toggle. It achieves almost the same effect as Kinto without an additional daemon: physical Alt maps to Ctrl (Cmd in terms of Mac layout), Ctrl works as Super and Super/Win works as Alt — the closest, I think, to Apple keyboard layout. It event works fine in Wayland (sway).

Considering the terminal, remap your favorite terminal emulator to send control codes via Super+A..Z (physical Ctrl+A..Z), and unmap/remap to the required action Ctrl+A..Z (physical "Cmd"+A..Z). It works fine in Konsole and great in Alacritty. (unfortunately, I also have to add a second set of mappings for my native non-latin keyboard layout, because at toolkit-level keys are translated to latin layout, but remapping works only for a single layout).

Of course, it's only a half of the equation. Another part is Option/Compose. On Mac I used MathUnicode.keylayout. It was great, and it was a pleasure to tweak it for my needs. Xkeyboard with .XCompose (e.g. [1]) has two disadvantages: you can't use a key as both Multi key and e.g. Alt modifier simultaneously, and you don't see the composition preview. On Lenovo at least you can use `compose(prsc)` to make your left Win key an «Option-modifier» and its right PrtSc counterpart an «Option-compose». [1]: https://github.com/kragen/xcompose

Maybe one day I will buy another Mac... but shall we prefer comfort to freedom?

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#164
post #12

The difference between Mac and PC keyboards is a real usability problem. If you're used to PC's or Linux, moving to a Mac and dealing with their shortcuts is painful, and vice-versa. The worst is using a mixture of both Mac's and PC's on a daily basis. Moving back and forth between platforms daily means you either have to get used to hitting the wrong shortcuts or use a hack to swap keys around on one platform so you…

> The PC and Linux worlds are not going to adopt Mac keyboard layouts. As the one oddball computer manufacturer that uses their own layout, perhaps it's time for Apple to offer PC keyboard layouts as an option on their machines out of consideration for people who have to use multiple platforms.

I switch between Mac, Linux, and Windows. The Mac is the only one with a usable, consistent terminal. Linux and Windows both have really fucked up copy/paste. Shift+Insert, Control+Shift+V, right-click, middle-click… what a goddamn mess. For some reason, Windows, which was supposed to have “right-click brings up a contextual menu everywhere” decides to make right-click do some weird almost X11-like copy-pasting in the terminal. Linux at least has the half-sane Control+Shift+C and Control+Shift+V but there’s multiple clipboards, and different applications may only use a subset of those.

Mac? ⌘C copy. ⌘V paste. Everywhere. Terminal, no terminal, same everywhere. Hands stay in center of keyboard where they belong. No reaching for the “insert” key, which is a recipe for typos.

Let’s not make the Mac worse just to make things consistent.

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#165

This is great, btw. Kinto is 100% a sanity saver. Please note the following rant is mostly tongue-in-cheek. 'cuz it turns out, I personally hate how Windows and Linux do things with `ctrl`. Coming from a Mac, my biggest and most consistent annoyance is that the `ctrl` key is fucking useless at best... One of the most common use cases for the `ctrl` key is COPYING shit and followed by PASTING shit and it DOES NOT WORK…

I love the Mac shortcuts because most are centred around the thumb and left hand, instead of having to awkwardly pinky the ctrl key or stretch for a alt-f4.

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#166
post #117

Earlier quoted context omitted.

Usually in Linux (specifically in Xorg) it's select to copy and middle click to paste; which uses a separate buffer from the C-c/C-v clipboard. Personally I find this method much more usable than the traditional windows-style clipboard. Either way, you want to generally avoid C-c for copy in terminals because it's already bound to the all important "send sigterm signal to foreground process". This is on a long list o…

> Either way, you want to generally avoid C-c for copy in terminals because it's already bound to the all important "send sigterm signal to foreground process". This is on a long list of ancient cruft that exists in terminal emulators and shells. stty intr ^X Then ctrl-c will no longer bother you, and your muscle memory will quickly adapt as X is very close to C

I mapped intr to control g some 30 years ago. It's the interrupt key in emacs. I gave up after some months because I still had to use control c on any terminal that I didn't control.

By the way, I don't even know if I could paste with control c or control shift c back then. Maybe there was only middle click.

I could try again now and see what happens.

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#167
post #74

This is great, btw. Kinto is 100% a sanity saver. Please note the following rant is mostly tongue-in-cheek. 'cuz it turns out, I personally hate how Windows and Linux do things with `ctrl`. Coming from a Mac, my biggest and most consistent annoyance is that the `ctrl` key is fucking useless at best... One of the most common use cases for the `ctrl` key is COPYING shit and followed by PASTING shit and it DOES NOT WORK…

I kind of disagree (I mean, ctrl+insert/shift+insert works consistently, right?) The one time I get really frustrated with conflicting keyboard shortcuts is when trying to do terminal work in a web browser, through, like the odd KVM session when SSH is down. The number of times I instinctively pressed Ctrl+W to correct a word in bash and instead close the whole session... Or, depending on emulator, inability to paste…

The insert key is consistent, but it’s so far away that it comes with a bunch of typos. I just can’t consistently hit keys that are so far away from the home row.

Same with the Windows home/end for sending the cursor to the beginning/end of line. That entire block of keys is only useful for navigating documents, they’re just unergonomic to use when you’re also typing.

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#168

This is great, btw. Kinto is 100% a sanity saver. Please note the following rant is mostly tongue-in-cheek. 'cuz it turns out, I personally hate how Windows and Linux do things with `ctrl`. Coming from a Mac, my biggest and most consistent annoyance is that the `ctrl` key is fucking useless at best... One of the most common use cases for the `ctrl` key is COPYING shit and followed by PASTING shit and it DOES NOT WORK…

The ctrl-c for interrupt is a default of terminal, it can be changed with stty. Eg "stty intr ^g" will make the terminal interpret a ctrl-g character as a signal to generate the interrupt signal. (And Linux the OS doesn't have any opinion on GUI terminal keybindings. You may be tempted to point your finger of blame towards X11 next, but X11 traditionally the text selection is mouse based with implicit copy on select…

To me precise about ctrl-c being default of the terminal meant in this context: it's the default of the Linux kernel tty driver. Which is a different thing from the terminal emulation program. So stty manipulates the kernel tty settings with system calls without involvement of the terminal emulation program like xterm or gnome-terminal. And what interprets the ^C / ^G in this case is also the kernel.

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#169
post #94

On a slightly related note: does anyone else map caps lock to control (and vice-versa)? I’ve never really understood why caps lock gets a huge key in the middle of the keyboard, while control gets a regular-sized key at the bottom. Generally speaking, caps lock is used much less than control.

At home (Linux with a PC keyboard), I just map capslock to control, and don't map anything to capslock: I have to type in all caps so little that it doesn't justify a key of its own, and holding down the shift key for several characters once in a while isn't much hardship.

At work (MacBook Pro), things get a little hinkier:

- I map capslock to command

- in iTerm2 only, I swap command and control.

This means I can use the honking big key to the left for my cutting/pasting/window-switching needs when not in the terminal, and still use my muscle memory for Vim and the command line when I am in the terminal.

The (not insignificant) downside is having to remember to use the physical control key (rather than capslock or physical command) for copying/pasting/window-switching when in the terminal: but I can live with that.

I also had to disable iTerm2's default command-W shortcut for closing tabs, as I kept hitting it by accident when trying to ^W on the command-line.

Separate but still (just) related point: I've had to train myself to use ^[ for Escape in the terminal (especially in Vim), as the escape key on the MacBook Pro's touchbar is next to useless. I guess could have just mapped capslock to Escape, but having that big fat control/command key is just too useful.

Re: Kinto: Mac-style shortcut keys for Linux and Windows

#170

This is great, btw. Kinto is 100% a sanity saver. Please note the following rant is mostly tongue-in-cheek. 'cuz it turns out, I personally hate how Windows and Linux do things with `ctrl`. Coming from a Mac, my biggest and most consistent annoyance is that the `ctrl` key is fucking useless at best... One of the most common use cases for the `ctrl` key is COPYING shit and followed by PASTING shit and it DOES NOT WORK…

I love the Mac shortcuts because most are centred around the thumb and left hand, instead of having to awkwardly pinky the ctrl key or stretch for a alt-f4.

The solution that works perfectly for me is to remap the keys, L Alt -> L Ctrl , Win Key -> L Atl , CapsLick -> Esc.

Probably this will not work for many people but is great for me since I have tons of keyboards shortcuts in my IDE and DE that use ctrl and shift . I think I use Alt only for Alt+tab but I don't need it that often because I have 7 virtual desktops that I reach using Ctrl+f1/f7

Post reply on HN