chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Steel / h / keyString
1 /*
2  * keyString
3  *  Converts keypresses to strings
4  *
5  * © 1992-1998 Straylight
6  */
7
8 /*----- Licensing note ----------------------------------------------------*
9  *
10  * This file is part of Straylight's Steel library.
11  *
12  * Steel is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2, or (at your option)
15  * any later version.
16  *
17  * Steel is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with Steel.  If not, write to the Free Software Foundation,
24  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25  */
26
27 #ifndef __keyString_h
28 #define __keyString_h
29
30 /*
31  * char *keyString(int key)
32  *
33  * Use
34  *  Converts a keypress as returned by the WIMP into a string suitable for
35  *  displaying to the user, for example as a keyboard shortcut.  The routine
36  *  handles the following cases:
37  *
38  *  * Function keys and Print, possibly with <Shift> and/or <Ctrl>
39  *  * Alphabetic keys with <Ctrl>
40  *
41  *  Note: f12 is not trapped; neither is <Ctrl> M, since this is <Return>.
42  *
43  * Parameters
44  *  int key == the key pressed
45  *
46  * Returns
47  *  A pointer to a READ-ONLY string, or 0 if the key was invalid.
48  */
49
50 char *keyString(int key);
51
52 /*
53  * char *keyString_convert(int key,BOOL mnu)
54  *
55  * Use
56  *  Converts a STEEL extended keypress into a string suitable for displaying
57  *  either as a short-cut string in a dialogue box or in a menu
58  *
59  * Parameters
60  *  int key == the keypress to translate
61  *  BOOL mnu == TRUE to create menu shortcut string, FALSE for dbox
62  *
63  * Returns
64  *  A pointer to the string, or 0
65  */
66
67 char *keyString_convert(int key,BOOL mnu);
68
69 #endif