FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

char-to-key-name

Arguments: char &key return-comtab-event

This function takes a lisp character object as an argument and returns the name of the key that is pressed in order to type that character. This name may be a lisp character object such as #\A or one of the vk-... constants such as vk-period. A second returned value is an integer which is a logior'ed value indicating which shift keys are used with the returned key in order to type the character; the logior'ed values are the values of the symbols shift-key, control-key, and alt-key (whichever of those keys are down).

Examples:

> (char-to-key-name #\*)
#\8
4         (4 is the value of shift-key)
> (char-to-key-name #\>)
vk-period
4

If the keyword argument return-comtab-event is true, then instead of the two returned values detailed above a single value is returned. This value is an event-synonym specifier list in the format that is passed to set-event-function or the :event-synonym initarg of a menu-item.

Examples:

> (char-to-key-name #\* :return-comtab-event t)
(shift-key #\8)
> (char-to-key-name #\> :return-comtab-event t)
(shift-key vk-period)

The association of shifted special characters with unshifted characters is more or less standard on all United States keyboards but can be different (from the US standard) on non-US keyboards. This function may be needed for applications that must work on such non-US-standard keyboards.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version