I'm trying to insert a non-breaking hyphen into a web app in Google Chrome. The key sequence is ⌘⇧-. Whenever I type this key sequence into a program (tested Notes, Textedit, and Chrome itself), it is interpreted as ⌘-, which is mapped to either reduce text size or zoom out. How can I enter non-breaking hyphens without using the character viewer and why does this peculiar behaviour occur?
MacOS – Non-Breaking Hyphen Sequence Interpreted as Cmd-hyphen (Zoom out)
google-chromekeyboardmacos
Related Question
- IOS – How to enter a non-breaking space on iOS
- MacOS – Disable non-breaking space (Option-Space) specifically in Xcode
- CMD + = shortcut on non standard USA keyboard (bluetooth)
- MacOS – zoom in and out in macOS / Finder
- MacOS – Make apps smaller / “zoom out” apps
- IPhone – How to decrease the font size / zoom out in Chrome on a mobile device
Best Answer
To enter a non-breaking hyphen in Google Chrome just enter
‑
: ‑ (<- check the source by opening my answer in the edit mode).The underlaying web app has to support this though.
A universal method to enter a non-breaking hyphen for all apps is to enable "Unicode Hex Input" from System Preferences -> Keyboard -> Input Source, choose it in the menubar and enter alt2011.
For Apple and probably some other apps you may set up an auto correct entry like nbhy -> ‑. You have to type nbhyspacedelete to add a non-breaking hyphen then.
With apps like Karabiner or Ukelele you may reduce the effort by remapping key strokes.
I still have to investigate the behavior to add an explanation why this happens.