Live data from Hacker News

Keyboard tricks from a macOS app dev

notes.alinpanaitiu.com

121–130 of 153 posts

Re: Keyboard tricks from a macOS app dev

#121

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…

Yeah I find some of the shortcuts confusing, like if I want to enter a directory in Finder I push ENTER and that's ... rename? Instead I'm meant to push PLACE OF INTEREST SIGN + O

Oh yeah, that's a stupid keybind, made worse by the fact you can't reliably change it since you can't differentiate when you're in a text field

But then you can mostly get by with a finder alternative

Re: Keyboard tricks from a macOS app dev

#122
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…

> or the workarounds that had to be implemented for the lack of PC keys (Home/End/PgUp/PgDown)

Those keys are not lacking, but on laptop keyboards they are hidden behind the fn+arrow keys. But they also are not workarounds or replacements for those keys. On macOS Home and End scroll the document to the beginning or end, not the cursor to the beginning or end of the line. That can be done with cmd-arrow.

Re: Keyboard tricks from a macOS app dev

#123

I used to have a clipboard manager that gave me access to my last X copied items, as well as a navigable list of snippets. A few years back, a MacOS update broke whatever tool I was using, and I ended up buying BetterTouchTool. BTT does give me my clipboard history, and it appears to be very powerful in general, but I can't figure out an easy way to replicate the navigable list of snippets. I do use the MacOS text ex…

Just FYI: you can use hyperlinks etc. in the BetterTouchTool expanded snippet. You just need to select the appropriate "Paste Type". You can also enter raw HTML and then select the "Paste Format: Interpret entered text as HTML source" option. When pasted it will then output the formatted text instead of the HTML source.

Re: Keyboard tricks from a macOS app dev

#124

One of the best things I’ve configured with BTT is to remove the global Quit application (cmd+Q) and global Hide application (cmd+H) keybindings. I use cmd+W all the time to shut tabs and a slight miss click would close the entire app.

With Karabiner Elements you could also bind quit to double Cmd+Q, I do that for "important" apps where accidental quit is bad, but for others (or for apps that don't have tabs) I leave quit to a single Cmd+Q

Re: Keyboard tricks from a macOS app dev

#125
post #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.

Thank you! Unfortunately it hasn’t been updated in a while and is very flaky on M1 Macs. Recognises some keys and not others - unfortunately not the one I need in this instance.

Re: Keyboard tricks from a macOS app dev

#126
post #28

BTT is great man, it just allows you to configure any shortcut for any app. But the one key I use the most is assigning “`” key as the back button. You keep your hand on that key while surfing web or any app that has a back navigation, it’s just so much better than clicking or remembering each apps back shortcut. If you really need to type ` then you assign fn-` it’s really rarely used

It's better to assign literal ` to double tap than requiring a hard to reach modifier

Re: Keyboard tricks from a macOS app dev

#127
By the way, is there a good trick to detect whether there is a currently active text field with your cursor in it? That's one crucial missing piece of context for all of the keyboard trick apps I am aware of, and that prevents fixing some rather annoying app bugs (like finder's enter not working to rename)

These utilities are only able to detect which app is running, but no what's going on inside the app

Re: Keyboard tricks from a macOS app dev

#128
post #42

Earlier quoted context omitted.

As a more general suggestion, macOS likely isn’t good at imitating what you previously had, try to understand the workflow they’re proposing, adapt and learn it, it generally gets second nature and pretty decent soon enough, getting to work the way you envision is not apple’s strong suit.

Do you know some good ressources to learn how to use macOS the productive way, using mostly keyboard shortcuts instead of the trackpad?

Apple maintains a list of macOS keyboard shortcuts that might be useful: https://support.apple.com/en-us/HT201236

Re: Keyboard tricks from a macOS app dev

#129

Earlier quoted context omitted.

Just a heads up — you can solve that one annoyance; there are terminal commands that will reduce that animation to instantaneous.

I tried changing various defaults but lots of them seemed to no longer work. Maybe I only tried the options to increase the speed or I didn’t restart enough things or I spelled something wrong. I also tried looking at the binaries for relevant-looking names of defaults to change and didn’t find any (including the options that old internet advice recommended changing)

The keyboard shortcuts to do this animate much quicker than the swipe does. In the past I've set up BetterTouchTool to press the corresponding key on left and right swipes.

The only disadvantage is that there is no way to "peek" the previous desktop like you can with the built in swipes.

Post reply on HN