Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hp-pcd!hpcvlx!everett From: everett@hpcvlx.HP.COM (Everett Kaser) Newsgroups: comp.sys.ibm.pc Subject: Re: Why CTRL-2 and CTRL-6 and not others??? Message-ID: <101000048@hpcvlx.HP.COM> Date: 21 Apr 89 15:21:25 GMT References: <1673@blake.acs.washington.edu> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 47 djo7613@blake.acs.washington.edu (Dick O'Connor) writes... >While playing with macro-building in PC Tools Deluxe's Macro Editor, >I tried all of the -number combinations using the top row number >keys and could only assign CTRL-2 and CTRL-6 as hot-keys. It didn't >seem to recognize the other eight potential CTRL-digit combinations. >I don't know much about XT keyboard scan codes (it's a Zenith Z159, if >it matters). Is this a result of something PC Tools is doing, or is it >related to those particular scan codes regardless of application? >Dick O'Connor No, it's normal to all PC's. If you look at an ASCII character table, you should notice (with a little prodding :-) that the ASCII character codes that are generated when you hold down the CTRL key are simply the ASCII code of the key WITHOUT the CTRL key, minus 64. Yea, I know that was a poorly written sentence and difficult to understand. So, a small example: -------CTRL-------- -------NORMAL-------- char ASCII-code char ASCII-code ^@ 0 @ 64 ^A 1 A 65 ^B 2 B 66 ^C 3 C 67 . . . . . . ^Z 26 Z 90 ^[ 27 [ 91 ^\ 28 \ 92 ^] 29 ] 93 ^^ 30 ^ 94 ^_ 31 _ 95 Now, the PC BIOS pretty much ignores the shift key when the CTRL key is down. The BIOS only uses one 'shift' key (SHIFT, CTRL, ALT) at a time, and CTRL seems to take precedence over SHIFT. So, CTRL-A is the same as CTRL-a (CTRL-SHIFT-A) and CTRL-2 is the same as CTRL-@ (CTRL-SHIFT-2). Ditto for CTRL-6 versus CTRL-SHIFT-6 = CTRL-^. None of the other number keys have a symbol as the shifted character that lies in the range from 64 to 95. Understand now? Perfectly simple? Nothing is simple when it comes to keyboards. Trust me. I know. :-) Everett Kaser !hplabs!hp-pcd!everett everett%hpcvlx@hplabs.hp.com