Why do Macs ask you to press random keys when connecting a new keyboard?
zdw
18 points
23 comments
April 06, 2026
Related Discussions
Found 5 related stories in 52.8ms across 3,752 title embeddings via pgvector HNSW
- I don't know Apple's endgame for the Fn/Globe key–or if Apple does tambourine_man · 94 pts · March 09, 2026 · 48% similar
- Make macOS consistently bad unironically speckx · 357 pts · March 27, 2026 · 47% similar
- My MacBook keyboard is broken and it's insanely expensive to fix TobiasBerg · 129 pts · March 29, 2026 · 47% similar
- Typing and Keyboards jpmitchell · 35 pts · March 29, 2026 · 46% similar
- Why does AI tell you to use Terminal so much? ingve · 35 pts · March 11, 2026 · 46% similar
Discussion Highlights (12 comments)
alsetmusic
Mapping to ensure that it has the correct layout applied.
altairprime
See also the layout identifier manual-elsif/elsif/elsif workflow here, last updated November 2023: https://support.apple.com/en-us/102743
throwaway27448
Random ≠ arbitrary
emeraldd
Honestly, the mac approach makes much more sense from an ease of use perspective for non-experts. On other platforms, you have to know the layout to choose and hope things work until you do or have a second keyboard that's close enough tl the default to get by. On Mac, it just figures it out based on the information you tell it when the keyboard is connected. Much less error prone in the majority of cases.
srean
Ah! Thanks for the stimulation. That's an interesting problem that I had not thought of before. In fact a few related problems. What's the minimum set of requested key presses that will uniquely identify a keyboard layout from a set of known types. Given a budget of k key strokes what's the most informative subset that will reduce the ambiguity about layout. Given the measurement from the requested key strokes find the posterior over the set of known keyboard layouts. Given that the user is typing some free form text in his language how soon can one nail the layout when the user's language, the layout and the text are unknown. Will make a good practice exercise for hobbyist codebreaking.
dirasieb
they don't ask you to press random keys
ginko
I guess the moment has passed by now but I wish there were a USB HID protocol for keyboards to identify their layout, or even better yet make the keyboard protocol layout agnostic so that keyboards send the high-level unicode character / modifier instead of a physical key code.
weinzierl
I think every OS should ask you to press a freshly generated sequence of keys when connecting a keyboard to prevent BadUSB attacks. Does any system do this?
vinni2
Why does it sometimes ask when connecting a HDMI projector?
tomasphan
Apple has to make it annoying to use a non-Apple device with your Apple device. That sort of friction probably nets them 2% in keyboard sales per year.
daft_pink
Thanks I’m always worried. I do the wrong thing when that thing pops up for my mouse.
ch_123
In addition to the three physical keyboard layouts in this post, there's a fourth one which has an extra key on both the right and the left side of the keyboard. An example is the Brazilian Portuguese layout Model M (pic: https://www.clickykeyboards.com/wp-content/uploads/2023/03/I... ). The Apple test would be able to identify it, although I've never tried it in practice. I don't think the modern Brazilian Apple keyboard uses this arrangement.