News for hackers. Stuff that matters.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by yakubin on Friday August 19, 2022 @07:53PM (#32527526)
I started using macOS with Big Sur (still on it) and I don't understand why Apple would remove the ability to select buttons in dialog windows with the keyboard. I've googled it and it seems you used to be able to do that on macOS, but when I follow the instructions on Big Sur, I can't move the selection from the button active by default to the other one (e.g. "Ok" vs "Cancel"). That means my right hand is making runs between keyboard and mouse all the time. Very unergonomic.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by sixstringtheory on Saturday August 20, 2022 @01:29AM (#32529379)
There’s an option in Keyboard settings > Shortcuts > “Use keyboard navigation to move focus…”. There are a couple security based dialogs it don’t work in but the majority of things it does work for me.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by bobbylarrybobby on Saturday August 20, 2022 @03:17PM (#32534486)
As others have said "use keyboard for navigation" works, but also you can generally press any button with the shortcut cmd-first-letter-of-button-text. E.G., if the dialog is "delete" and "cancel" and cancel is the default, cmd-D should press "delete". "replace" and "cancel", cmd-R should press "replace". Etc
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by grishka on Friday August 19, 2022 @09:16PM (#32528080)
The enter key activates the blue (default) button, the spacebar activates the one with the focus ring around it. You can move the focus ring with tab.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by yakubin on Friday August 19, 2022 @09:56PM (#32528304)
Experiment:

1. Open TextEdit.app

2. Type some random characters.

3. Attempt to quit with Cmd+Q.

4. A dialog box shows up, prompting you to save the file. Hitting Tab just cycles between the "Save As" and "Tags" text fields. There is no way for me to select the "Delete" button with Tab.

Challenge: quit TextEdit.app in that situation with they keyboard, without using the mouse, and without saving a file.

That's a broader topic btw: Apple's apps often make the Tab button only cycle between text fields. In Safari when logging into Spotify I can't reach the "Remember me" checkbox with Tab. It only cycles between the login and password textfields and the URL bar. Luckily, other browsers don't have this flaw.

Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by Shank on Friday August 19, 2022 @09:59PM (#32528312)
I believe this is possible if you turn on "Use keyboard navigation to move focus between controls" in System Preferences -> Keyboard -> Shortcuts. I have no idea why this isn't on by default.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by yakubin on Friday August 19, 2022 @10:10PM (#32528363)
That works, thanks! Although there is a weird bug that going forward with Tab cycles through everything and goes back to the first field, whereas going back with Shift+Tab stops at the first field.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by ykhan6 on Saturday August 20, 2022 @12:34AM (#32529110)
Thanks for this. I thought I was losing my mind having to grab my mouse every time I tried to quit a text editor and not save.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by cr__ on Friday August 19, 2022 @10:12PM (#32528371)
CMD-Delete almost always serves to press the Delete button or the equivalent in those dialogs. Not sure how you're supposed to find that out though!
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by musicale on Saturday August 20, 2022 @01:23AM (#32529353)
> CMD-Delete

This^. It used to be command-D for "Delete/Don't Save" but at some point they changed it to command-delete; maybe someone thought it made more sense and was harder to type by accident?

    <Delete> command-delete (backspace, not forward delete)
    <Cancel> esc
    <Save/Default> return/enter
I actually prefer command-D precisely because it is easier to type: on the home row and you can type it with your left hand while mousing with the right.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by yakubin on Friday August 19, 2022 @10:17PM (#32528391)
TIL. Thanks!
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by uranusjr on Saturday August 20, 2022 @12:43AM (#32529142)
For “Delete” specifically you can also simply press ⌘backspace when the save dialog is activated to trigger the button. In some dialogs where the button is “Don’t Save” (i.e. autosave not active) the combo may be ⌘D
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by jbverschoor on Saturday August 20, 2022 @01:58AM (#32529535)
I just press space instead of enter. However:

Home: you can only cycle between de navlist on the left, and the top toolbar. The complete app does not respond to the keyboard, probably because they are not buttons, but clickable rects. There's this boilderplate menu "Format". cmd-nr nav behaves weird.

Reminders: you can only cycle between de navlist on the left, and the top toolbar. The complete app does not respond to the keyboard, probably because they are not buttons, but clickable rects.

Stocks: you can only cycle between de navlist on the left, and the top toolbar, and it get towards some articles, but it simply doesn't work properly. Arrows have weird behavior, can't nav to "more data". But this is a lot better than the previous two.

Everything feels just like some one-person solo project recreating the OSX experience, but only focusses on how things look.

Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by yakubin on Saturday August 20, 2022 @04:34AM (#32530395)
Hitting space in the example I gave would actually be pretty useless, since it would just put a space in the textfield.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by jcampbell1 on Friday August 19, 2022 @10:56PM (#32528591)
Cmd+the first letter of the button works.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by grishka on Saturday August 20, 2022 @12:42PM (#32533340)
Doesn't work for me, probably because my system language is Russian. The button is "Удалить" but neither Cmd+D nor Cmd+У work, regardless of the current keyboard layout.
Re:Apple’s Use of AppKit, Mac Catalyst and SwiftUI in macOS by musicale on Saturday August 20, 2022 @01:32AM (#32529401)
Does it work in TextEdit?