[HN Gopher] The history of Alt+number sequences
       ___________________________________________________________________
        
       The history of Alt+number sequences
        
       Author : ingve
       Score  : 98 points
       Date   : 2024-07-02 14:33 UTC (8 hours ago)
        
 (HTM) web link (devblogs.microsoft.com)
 (TXT) w3m dump (devblogs.microsoft.com)
        
       | rob74 wrote:
       | > _This means that whether the Alt+... value is taken mod 256
       | depends on what kind of control you are typing into.
       | 
       | By default, the value is taken mod 256, and Alt+9731 gives you a
       | heart.
       | 
       | But if you happen to be using a RichEdit control, then the
       | Alt+... value is taken mod 65536, and Alt+9731 gives you a
       | snowman._
       | 
       | And that is why some people hate Windows with so much passion.
       | Not that other OSes don't have their peculiarities of course...
        
       | ttrrooppeerr wrote:
       | > For example, you could enter n by holding Alt and typing
       | Numpad1 Numpad6 Numpad4, then releasing the Alt key.
       | 
       | To this day, this remains the best way to insert the character, I
       | have tried the PowerToys Quick Accent [1] but I had so many
       | missed characters when typing fast.
       | 
       | [1] https://learn.microsoft.com/en-us/windows/powertoys/quick-
       | ac...
        
         | Frieren wrote:
         | > this remains the best way to insert the character
         | 
         | The best way is to use a Spanish-layout keyboard. Otherwise,
         | Alt is a useful hack.
        
         | Sharlin wrote:
         | On many Euro keyboards it's just ~n, as ~ is a dead (modifier)
         | key. But on Windows I do miss the way on macOS and iOS you get
         | access to variants of a basic letter by pressing and holding
         | the respective key.
        
         | robertoandred wrote:
         | I prefer holding n and then pressing 1.
        
       | theonealtair wrote:
       | I learned about the Alt characters a long time ago when I wanted
       | to type "Pokemon" in the gamefaqs message boards. I never knew
       | until now why higher numbers didn't do anything different.
        
       | Workaccount2 wrote:
       | TIL that the reason these alt+ sequences never worked for me is
       | because you have to use the number pad...
        
         | rep_lodsb wrote:
         | Fun fact: On a DOS PC, typing these codes was possible even on
         | a keyboard without a number pad, by using the cursor keys
         | instead. This works because those keys produce the same scan
         | codes (with the only difference being either the presence or
         | absence of some prefix byte, depending on the NumLock state).
         | 
         | 0 = Ins, 1 = End, 2 = Down, 3 = PgDn, 4 = Left, 6 = Right, 7 =
         | Home, 8 = Up, 9 = PgUp (and by exploiting the mod 256 parsing,
         | it should always be possible to find a code that doesn't
         | contain the digit 5)
         | 
         | Don't know if Windows emulates this, probably not. I wouldn't
         | be surprised though if some part of the Windows keyboard driver
         | translates the (different) scancodes sent by an USB keyboard
         | into the legacy ones, just like the Alt+number handling does
         | expect codepage 437 when there is no leading zero :)
         | 
         | Some might say that this kind of "cruft" is what makes Windows
         | a horrible OS - but IMHO it's really cool to find such
         | backwards compatibility, and sad when it goes away for no good
         | reason, to be replaced with entirely new cruft that logs
         | everything you do on your "Personal" Computer and sends it to
         | some cloud service...
        
         | novagameco wrote:
         | Some laptops will map 789uiojkl to the keypad with fn
        
       | Aardwolf wrote:
       | It would be great to make this feature relevant again but use
       | decimal unicode codes, and have it work in linux too this way; it
       | can be really useful now and then (as an alternative to looking
       | up the unicode character on the internet and copypasting it)
       | 
       | I remember using this back in the day for ALT+0160 to type non
       | breaking space, which could do funny things in forums and chat
       | programs like MSN and ICQ
        
         | Tblue468 wrote:
         | > It would be great to make this feature relevant again but use
         | decimal unicode codes, and have it work in linux too this way
         | [...]
         | 
         | IBus[1] can (apparently) do that!
         | 
         | [1] https://wiki.archlinux.org/title/IBus#Unicode_input
        
         | _flux wrote:
         | I think urxvt has this feature, but it's also available via the
         | Universal Input Method System in many widget sets and it is
         | supported by both Gtk and Qt (might need some additional
         | packages to be installed/setup). So I can just type the symbol
         | in hexadecimal with Ctrl+Shift+U 2 6 0 3 Enter to enter .
         | 
         | I used to remember the unicode symbol for long dash--but now
         | that I use EUR keymap I don't need to, and I've forgotten it
         | :).
         | 
         | edit: oh crud, HN filters snowmans :(.
        
           | Freak_NL wrote:
           | Just enable the compose key and forget all about having to
           | memorize numbers. Just tap [compose][-][-][-] for --, and
           | [compose][-][-][.] for -.
        
             | kps wrote:
             | Compose is nicely user-extensible (~/.XCompose) for those
             | with domain-specific needs; it's one of the few
             | workstation-era holdovers that DesktopLinux(tm) hasn't
             | ruined yet.
        
             | Lammy wrote:
             | This is by far the most intuitive way to me. I rely on it
             | even on Windows thanks to WinCompose instead of trying to
             | memorize these alt-codes.
             | 
             | https://raw.githubusercontent.com/mirror/libX11/master/nls/
             | e...
             | 
             | http://wincompose.info/
        
               | TylerE wrote:
               | The way Mac does it is even easier. You just hold down
               | the lay, and you get a popup with numbered options.
        
               | Lammy wrote:
               | I like being able to type them without looking :)
        
               | ziml77 wrote:
               | That's easier if you don't know the keybinds, but the
               | faster way is using the Option key to type the accented
               | letter in 2 parts. You first press Option along with one
               | of: `, e, u, i, n. And then just press the letter you
               | want to apply the corresponding accent to.
        
               | TylerE wrote:
               | On the rare occasions I need one of them, it's rarely one
               | of the common ones. I work with a lot of music scores
               | with lots of weird French and Germany characters that are
               | a little more involved.
        
               | kps wrote:
               | On the Mac, it's quite easy to have customized keyboard
               | layouts to make it easy to type characters you use
               | frequently. If you want to have Option-f and Option-p to
               | give you  and , you can.
               | https://software.sil.org/ukelele/ is a nice GUI that lets
               | you start from your current preferred layout and make
               | changes.
        
             | bradrn wrote:
             | I made my own cross-platform keyboard layout for this:
             | https://github.com/bradrn/Conkey. The compose key is nice,
             | but especially on Windows, I find that an actual keyboard
             | layout gives a better experience.
        
               | 1oooqooq wrote:
               | this is beautiful. but soo many dead keys.
        
             | _flux wrote:
             | I used to use compose key a long time ago (indeed some
             | keyboards had an actual "compose" key), but then it just
             | seems that I so rarely need to use the many characters
             | available through it, that plain Gnome search for the
             | unicode character name (that sticks the character to the
             | keyboard) serves me fine.
             | 
             | Besides, there's no compose sequence for snowman, is there?
        
               | kps wrote:
               | Not by default, but put in your ~/.XCompose:
               | <Multi_key> <O> <o> : ""   U2603 # SNOWMAN
               | 
               | or whatever it is you want, where "" contains a snowman
               | that HN strips. (Depending on your system, you may then
               | need an `ibus restart` or some such thing to have your
               | change picked up.)
        
             | Findecanor wrote:
             | I love the Compose key  and use it all the time.
             | 
             | I wish it had interactive dialog box for better
             | discoverability of compose sequences, showing you a list of
             | possible alternatives based on the characters you have
             | already typed.
        
             | codedokode wrote:
             | In default configuration in Gnome there are too few
             | combinations and you cannot enter many important
             | characters.
        
         | jimbobthrowawy wrote:
         | Is decimal really that important? Hitting ctrl+u <codepoint in
         | hexadecimal> Enter has worked on every desktop linux machine
         | I've tried it on. e.g. U+A0 instead of ALT+0160 for no-break
         | space.
         | 
         | U+fdfd is probably the character I use it with the most.
        
       | wojtczyk wrote:
       | My first keyboard on a 286 didn't have: alt+039:' alt+060:<
       | alt+062:> They are still burned in my memory.
        
       | K7PJP wrote:
       | Ah, is this one of the reasons Windows users are so attached to
       | full-sized keyboards with numpads? In any discussion of TKL-or-
       | smaller keyboards, there's a cohort of people baffled at how any
       | keyboard without a numpad could be fit for purpose. I take it
       | this Windows feature is among the reasons why.
        
         | TylerE wrote:
         | My biggest beef with TKL is not having a full sized, edge
         | places enter key to thwack.
        
         | novagameco wrote:
         | I doubt it; you can insert unicode symbols with Win-. now, so
         | the alt keys aren't as important.
         | 
         | Personally I used to see coworkers with 65 or 60% mechanical
         | keyboard and I have no clue how they could code without arrow,
         | home, or page up/down keys. They must have been _really_
         | committed to vim keys or something.
        
           | immibis wrote:
           | Fun fact about Win-. (the emoji keyboard): this is an Input
           | Method Editor, something formerly used by writers of
           | ideographic languages for example, so now we all have no
           | excuse not to test our Win32 code for IME support.
        
         | SOTGO wrote:
         | There's a significant contingent of people who find typing
         | numbers with the number row cumbersome (me included). If, for
         | whatever reason, you need to type a lot of numbers, it can be
         | quite inconvenient to not have a numpad.
        
       | novagameco wrote:
       | alt-255 alt-255 alt-30
       | 
       | alt-30 alt-255 alt-30
       | 
       | new friends can't triforce
        
         | Sabinus wrote:
         | What a blast from the past. This was my introduction to alt
         | codes.
        
       | UI_at_80x24 wrote:
       | Back in my BBS days I would use ALT+255 to create a <null> blank
       | character. Windows couldn't display it, but the FTP programs I
       | used could. That made it fun/easy to "hide" an FTP server dump
       | location on a windows server.
       | 
       | The windows admin could see that the drive was filling up but not
       | which directory was the cause.
       | 
       | Linux could see it. And so could my FTP client. (Enter fond
       | memories of using FXP here too)
       | 
       | For multiple layers of chaos I might create multiple "blank"
       | directories but only store the 'real' files multiple layers deep.
       | For added "legitimacy" I might include the contents of \system or
       | \print or something. I can't remember exactly.
        
         | TimTheTinker wrote:
         | We used the Alt+255 trick in my high school computer lab
         | (windows 3.1) to hide games like Doom and Descent. It worked
         | great because for some reason, if I recall correctly, the `dir
         | /s` command would not traverse into directories with that name,
         | so recursive directory searches for "DOOM.EXE" would turn up
         | nothing. Also, folders with that name wouldn't appear in
         | Windows.
         | 
         | To break out of the managed environment, someone figured out
         | they could hit Ctrl+Break at the text-mode login screen - this
         | would drop you to a DOS prompt. But the lab admin got wise to
         | that and blocked that key combination.
         | 
         | I figured out a workaround: Alt+3. It would send an ASCII code
         | that the input would interpret identically to Ctrl+Break, and
         | we were back in business :-)
        
           | rep_lodsb wrote:
           | I'm somewhat skeptical about folders not appearing, the
           | Alt+255 character is just a non-breaking space, and should
           | display as such: the name will appear to be blank, but with a
           | clickable folder icon.
           | 
           | However, I can confirm that DIR /S doesn't enter directories
           | starting with that character - TIL!
           | 
           | From reading the source code[1], this happens because it
           | requires the name to be alphabetically below something called
           | the "temp name", which is initialized to start with this
           | character.
           | 
           | What the code seems to be doing is selection sort, finding
           | the first (alphabetically lowest) subdirectory that hasn't
           | been entered yet, by reading the entire directory each time
           | and comparing all the names. Not very efficient, but
           | excusable if it saved some memory.
           | 
           | [1] https://github.com/Hengle/ms_dos_6_0_source_code/blob/mas
           | ter... -- temp name init is at line 1767
        
             | ale42 wrote:
             | As far as I remember (I also used the Alt+255 trick at the
             | high school to hide stuff), Windows 3.1 could not open
             | folders containing the blank 255 character, which was
             | displayed as an underscore for some reason, and not
             | properly translated to the windows code point for the same
             | character (160). So it was not possible to open those
             | folders, although they were visible in the File manager.
        
               | TimTheTinker wrote:
               | Yeah, just checked- this is correct. They appear, but
               | with an underscore, and they can't be navigated to or
               | deleted from within the UI.
        
               | rep_lodsb wrote:
               | Really interesting! There is leaked source code for
               | WINFILE from NT 3.5, maybe the answer for why this
               | happens can be found in there: https://github.com/Hengle/
               | windows_nt_3_5_source_code/tree/ma...
               | 
               | (anyone working on ReactOS or Wine probably shouldn't
               | click this link...)
        
       | TuringNYC wrote:
       | When we were learning typing in high school, some of the geekier
       | kids were using alt-224, etc to selectively replace some English
       | chars with Greek ones. The not-so-techy teacher were scratching
       | her head on how we were typing in Greek.
        
       | felideon wrote:
       | Fond memories of having a handy cheatsheet printed out for doing
       | homework and chatting on MSN Messenger, until of course I
       | memorized them (or maybe I printed it for the benefit of others).
       | 
       | It was always odd to me that e was out of sequence:
       | Alt+160 => a       Alt+130 => e       Alt+161 => i       Alt+162
       | => o       Alt+163 => u       Alt+164 => n       Alt+165 => N
       | 
       | Most people with US keyboards had no idea how to type n/N, the
       | most important out of the bunch.
        
       | criddell wrote:
       | I wonder why they made this work only on the numpad?
       | 
       | Are these sequences available on laptop keyboards or some of the
       | smaller keyboards that have no numpad? I'm working on a Lenovo
       | Trackpoint II keyboard and alt-0176 should create the degrees
       | sign but I can't figure out how to do it.
        
         | ale42 wrote:
         | Some laptops have (had?) ways of entering numpad keystrokes
         | using Fn+something (usually some letters), but I dind't see
         | that in many years. I guess they used that because Alt+ normal
         | numbers can be used as a hotkey in normal software (not sure
         | what DOS software was using as keyboard shortcuts when they
         | introduced this back in old BIOeSs...)
        
       ___________________________________________________________________
       (page generated 2024-07-02 23:01 UTC)