Re: Keyboard Question?
Re: Keyboard Question?
- Subject: Re: Keyboard Question?
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 18 Jan 2001 22:38:45 -0800
On 1/18/01 7:08 AM, "Arthur J Knapp" <email@hidden> wrote:
>
I belive the original poster was looking for a reference that
>
would show a mapping between keyboard keys and ascii codes. This
>
link may be able to help somewhat:
>
>
<http://developer.apple.com/techpubs/mac/Text/Text-516.html>
>
>
Keep poking around at Apple's site. I'm sure you will find what
>
you need.
OK, enough already. The original poster wanted to know how to emulate typing
the down arrow with Sandi's TextType, and also where to find a list of all
the ASCII characters corresponding to their ASCII numbers, presumably to use
in AppleScript since he asked on on AppleScript list, therefore IN DECIMAL
FORM. The hex/octal discussion has been an interesting red herring.
I earlier provided a script which will give you every ASCII character from
32 through 255, but not 0 to 31. I still think it's the easiest way to get
ASCII characters 32-255, but there are other places to find them already
recorded. The usual places recommended by other people will give you the
standard explanations of the 0-31 ASCII numbers, but they do NOT give you
the keypress equivalents on a Mac, such as down arrow, that you can use with
keypress emulators like Sandi's and Sigma's Additions. As John Baxter, I
think, pointed out, ASCII characters 28-31 are normally listed as FS, GS,
RS, and US for File Separator, Group Separator, Record Separator, Unit
Separator, which is what they are. That, however, does nothing to show that
they also happen to work the arrow keys on a Mac keyboard. There are other
special Mac keyboard implementations as well. John Delacour once divulged
that ASCII 28 was left arrow, but could not divulge (or probably didn't
remember) where he had discovered this information.
So I spent several hours tracking it down, eventually finding buried within
Inside Macintosh. I'm sure there are guides which make it easier to discover
this - somewhere. But since no one has come up with a URL for one, here's my
list, with the special Mac implementations in square brackets. Some of them
are my attempts to describe graphic representations (like "lozenge"). Those
"graphic" characters 17-20 (propeller, lozenge, radical, Apple logo) are
only valid in the Mac's System fonts. (There is also a later ASCII character
for Apple logo for all non-symbol fonts: ASCII character 240)
0 NUL Null
1 SOH Start of Heading
2 STX Start of Text
3 ETX End of Text
4 EOT End of Transmission
5 ENQ Enquiry
6 ACK Acknowledge
7 BEL Bell
8 BS Backspace
9 HT Horizontal Tab
10 LF Line Feed
11 VT Vertical Tab
12 FF Form Feed
13 CR Carriage Return
14 SO Shift Out
15 SI Shift In
16 DLE Data Link Escape [F1 to F15]
17 DC1 Device Control 1 [propeller]
18 DC2 Device Control 2 [lozenge]
19 DC3 Device Control 3 [radical]
20 DC4 Device Control 4 [Apple logo]
21 NAK Negative Acknowledge
22 SYN Synchronous Idle
23 ETB End of Transmission Block
24 CAN Cancel
25 EM End of Medium
26 SUB Substitute
27 ESC Escape [clear]
28 FS File Separator [left arrow]
29 GS Group Separator [right arrow]
30 RS Record Separator [up arrow]
31 US Unit Separator [down arrow]
32 SP Space
Here's my script again for the rest of the ASCII characters:
set ls to {}
repeat with i from 33 to 255
set end of ls to ("" & i & tab & tab & ASCII character i)
end repeat
set AppleScript's text item delimiters to {return}
set allAsciis to "" & ls
set AppleScript's text item delimiters to {""}
allAsciis
--
Paul Berkowitz