Live data from Hacker News

Keyboard tricks from a macOS app dev

notes.alinpanaitiu.com

101–110 of 153 posts

Re: Keyboard tricks from a macOS app dev

#101
post #99

I was hoping this was about lesser known macOS keyboard shortcuts. Alas. Apple has a pretty exhaustive list of so-called document shortcuts that I find particularly useful: https://support.apple.com/en-us/HT201236#text Ctrl+A and Ctrl+E in particular to jump to the beginning and end of a line are a pair that I use dozens of times per day. Same with Opt+Delete to delete the previous word. I use Opt+Left Arrow and Opt+…

I find it fascinating that your examples are actually the readline/emacs shortcuts, or the workarounds that had to be implemented for the lack of PC keys (Home/End/PgUp/PgDown) The more I got familiar with MacOS, the more I realized all those feature pictures ople praise MacOS for are just workarounds / copies from other systems, and (even power-) users just aren't familiar with other systems hence their amaze. The i…

It all depends on where one got their start in computing. I started on a Mac in 1996, and though the keyboard that it came with had home/end/etc I never learned to use them because I didn’t do much that was keyboard intensive, with most of my computer usage being drawing/graphics, games, or web browsing.

By the time I’d started working as a dev fulltime where those keys might’ve been useful, laptops had taken over and my work machine was a MacBook Air which wasn’t large enough to fit those keys even if they’d wanted to, and so I learned the built in macOS text nav shortcuts. They were never a workaround for me because I’d never used the home/end/etc cluster in the first place.

Even today when using Windows or Linux it’s with a 60/65% keyboard without those keys because that’s what’s comfortable. Reaching over to hit home/end on a larger keyboard would feel odd with how far removed it is from the rest of the board.

Re: Keyboard tricks from a macOS app dev

#102

This post and thread are terrific, and the day I learned common Emacs bindings work in most corners of macOS was momentous, but… Whenever advanced keyboard shortcuts are under discussion, I’m reminded of something I read, I think by Bruce Tognazzini, on an early Apple study of keyboard vs. mouse. They had set up the usual usability test—run through these common spreadsheet tasks or whatever—and compared skilled users…

You might want to read this about that study: https://danluu.com/keyboard-v-mouse/

It's a counter-intuitive conclusion because it's a wrong conclusion.

Re: Keyboard tricks from a macOS app dev

#103

This might be the place to ask, since half an hour of searching the other day came up empty for Apple Silicon Macs: does anyone know how to diagnose hotkey conflicts? I use hyper (caps) + q, e to navigate between spaces but hyper + q recently stopped working, so … I can only go right.

Try Shortcut Detective. https://www.irradiatedsoftware.com/labs/

I haven’t used it for a couple of years, so it may be flakey, but worth a shot.

Re: Keyboard tricks from a macOS app dev

#104

Big fan and long-time user of rcmd, Hyperkey, Rectangle, BTT - all lovingly-crafted by independent developers. All solo, I believe. I know Raycast is getting a lot of attention right now but isn’t this a VC-backed SaaS? How do people feel about inviting them on to their desktop - aren’t you worried about the inevitable other shoe dropping?

Author here, glad you like rcmd! About Raycast, I was a longtime fan of Alfred, and still bought version 5 and use it all the time for file search and navigation, as Raycast is severely lacking here.

But I really like what Raycast has become for the rest of the stuff. For example the calculator is just amazing, it replaced Soulver and Alfred completely for me, doing the currency and datetime operations a lot more intuitively.

And for now, Raycast is a full fledged app whose binary I own completely and works offline. So even if the Raycast company had problems, I can keep using the current binary forever. There's not much functionality that would go extinct with OS updates.

I'd say it's worth the risk.

Re: Keyboard tricks from a macOS app dev

#105

You can configure the zoom function in the accessibility settings, too. And zoom in and out using the two finger scroll gesture. I use it daily.

Yep, Apple added a lot of options for configuring zooming. I went through all the Accessibility settings multiple times to find something that works for me. I used three-finger-double-tap for a while, but I really like three-finger-tap for middle click so it clashed with that.

That's why I eventually settled for the rcmd-lcmd sequence, it's much more convenient for me and doesn't clash with my other bindings.

Re: Keyboard tricks from a macOS app dev

#106
post #38

Ah this is from the creator of the 'rcmd' tool. I absolutely love it. Press the right command key + the first letter of an app and it switches right to it! (rcmd + for firefox, i for iTerm, s for Slack, ...) I came from i3 with 8 predefined windows, but the simplicity of rcmd is really amazing.

Thank you, I'm really happy to read you find rcmd so useful ^_^ Also came from i3wm and missed it sorely until I finally settled on rcmd + single-space.

Using multiple spaces on macOS is nowhere as easy as on i3.

Re: Keyboard tricks from a macOS app dev

#107
post #92
post #89

Earlier quoted context omitted.

It's much better to rebind all of those to more ergonomic alternatives that match your other apps using the tools listed (eg, to similar cursor keys you use in a text editor), which is also useful for non Macs you use (where you could do the same rebunds), rather then learning yet another set of bad old combos

The defaults can be changed (DefaultKeyBindings.dict). However, those keybindings are not just “yet another set of bad old combos”; the same keybindings are used by default in Emacs on any platform, and by most POSIX shells and interpreters (Bash, Zsh, Fish, IPython, etc.). On Mac, they’re inherited by most other GUI text editors (e.g. Sublime).

These are exactly another set of bad old combos, and the fact that their use is widespread is just another example of how bad very common things are:

  -  it doesn't make sense to have a/e as beginning/end, there is a symmetry in the commands, but there is no symmetry in the a/e keybindings, they are on different rows

  - likewise, it doesn't make sense to use the less convenient ⌃ for such a frequent command (and this is also the rightful criticism of all the bad Emacs pinky defaults)
For example, you could use right ⌘ (a thumb key) as your text movement key (or even Space), then you have home keys

  - JKL; for cursor movements and

  - DF for your word movements (instead of having to move your whole hand to ⌥◀/▶)

  - A/⇧A for line start/end movements or maybe A/G if it's frequent enough to not warrant using ⇧
And then that would match your text editor keybinds, so you don't have to waste time remembering platform-specific keys.

And re. those other apps - it's better to rebind them all (or, rather, use a tool to have the keybinds work in all of them) as well to use something good rather that stick with the bad just because someone lacked good design chops in the past

Re: Keyboard tricks from a macOS app dev

#108

I recently purchased a MacBook, and while I'm thoroughly impressed with the hardware, I find the keyboard navigation in the desktop environment somewhat lacking in comparison to my previous experience. Having used Linux Pop OS for many years, I've grown accustomed to the intuitive and powerful tiling window manager and keyboard navigation shortcuts it offers. I'm struggling to find a comparable solution on the macOS…

I've been using https://www.hammerspoon.org/ for more than 5 years and it's perfect.

Re: Keyboard tricks from a macOS app dev

#109
post #106
post #38

Ah this is from the creator of the 'rcmd' tool. I absolutely love it. Press the right command key + the first letter of an app and it switches right to it! (rcmd + for firefox, i for iTerm, s for Slack, ...) I came from i3 with 8 predefined windows, but the simplicity of rcmd is really amazing.

Thank you, I'm really happy to read you find rcmd so useful ^_^ Also came from i3wm and missed it sorely until I finally settled on rcmd + single-space. Using multiple spaces on macOS is nowhere as easy as on i3.

Do you plan to make a post about your flute-making? Most interested.

Re: Keyboard tricks from a macOS app dev

#110
I guess this is only of tangential relevance to the post, but Ctrl+n (which should work the same as arrow down) has been broken in Spotlight as of macOS Ventura.

The fact that this completely standard binding has been broken in a crucial macOS app for 5 months basically tells me that Apple does not care about the "Emacs-style" shortcuts in macOS.

Post reply on HN