Re: unicode values for keyboard keys?

From: Kenneth Whistler (kenw@sybase.com)
Date: Tue Jul 29 1997 - 19:17:12 EDT


Michael Baldwin asked:
>
> are there any unicode values defined for the common keys on keyboards:
>
> home, end, insert, page up/down, left/right/up/down arrow
> function keys 1-12, print, scroll, pause

There is a rather haphazard collection of such things:

See the arrows section of the Unicode Standard, where a number of
the arrows are identified with keyboard functions and/or keys, although
the semantic for these characters is not constrained to mean *only*
those functions or keys:

U+2190..U+2193 basic directional arrows, associated with cursor movement
U+21A1 = form feed
U+21B4 = line feed
U+21B5 = carriage return
U+21B8 = home
U+21B9 = tab/shift tab
U+21DE = page up
U+21DF = page down
U+21E4 = leftward tab
U+21E5 = rightward tab
U+21E7 = shift
U+21EA = caps lock

The problem is that these arrows really only represent their shapes, but
these shapes are conventionally associated with many of these functions
on keyboards. For example, U+21B9 is the character for the glyph often
found printed on a Tab key on a keyboard (including the one I am using
now), but it isn't a single function. The glyph is mnemonic for the fact
that there are two different functions associated with the key, depending
on whether the shift key is depressed when I tab or not. And in any
case, this is different from U+0009 HORIZONTAL TABULATION (representing the
real TAB character itself) and U+2409 SYMBOL FOR HORIZONTAL TABULATION
(representing an arbitrary paste-your-graphic here character for symbolizing
a TAB character, rather than the TAB character itself).

Then there is another set of keyboard symbols, buried among the
miscellaneous technical symbols:

U+2318 = command key
U+2324 = enter key (on different keyboards than U+21B5 !)
U+2325 = option key
U+2326 = delete to the right (i.e. delete)
U+2327 = clear key
U+232B = delete to the left (i.e. backspace)

And you should know that there is another passle of these animals
being herded through the ISO stockyards even now, to round out the
collection of keyboard symbol glyph characters to match one or
more ISO keyboard standards, including another 8 arrow shapes,
and another 20 misc. shapes, including everything from continuous
underline to pause to undo to help and screen print.

Nobody has yet proposed separate symbol characters for the
12 functions keys (whew!)--I guess because you can represent
them by "F1", "F2", etc.

>
> for systems that return a unicode stream for keyboard input, it would
> be nice to have well-defined unicode values to return for them.
> glyphs could be defined for them as well. but if they exist already,
> then that would be even better...

I wouldn't recommend encoding another set of characters
just for mapping to keyboard return codes. This is, in fact,
an excellent use of private-user-space. The problem with trying to
standardize keyboard return codes as a set of standard
characters is that there are so many different keyboards
with so many different drivers specialized in so many ways.
What works for a typical PC keyboard working on a Windows
system won't be the same as what a typical Macintosh keyboard
requires. Or what about the "Stop", "Props", "Front", "Open",
"Find", "Again", "Undo", "Meta", "Compose", and "Alt Graph"
keys on my Solaris workstation keyboard? Or who would like to do the
work to specify mappings for the Data General editing keys or
for 3270 terminal return codes or ... ?

--Ken Whistler



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:36 EDT