Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / akbd
1 ;
2 ; akbd.sh
3 ;
4 ; Keyboard handling
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Functions provided:
30 ;
31 ; akbd_test
32 ; akbd_translate
33 ; akbd_pollKey
34
35 [ :LNOT::DEF:akbd__dfn
36 GBLL akbd__dfn
37
38 ; --- akbd_test ---
39 ;
40 ; On entry: R0 == internal key number to test
41 ;
42 ; On exit: CS if key was pressed, CC otherwise
43 ;
44 ; Use: Informs you whether a given key is currently being pressed.
45
46 IMPORT akbd_test
47
48 ; --- akbd_translate ---
49 ;
50 ; On entry: R0 == Wimp key number
51 ;
52 ; On exit: R0 == Straylight extended keyset key number
53 ;
54 ; Use: Translates a Wimp key number into one of the more specific
55 ; Straylight key numbers.
56
57 IMPORT akbd_translate
58
59 ; --- akbd_pollKey ---
60 ;
61 ; On entry: --
62 ;
63 ; On exit: CC if a key was in the buffer and
64 ; R0 == wimp translated key code
65 ; else CS and
66 ; R0 corrupted
67 ;
68 ; Use: Reports whether the user has typed ahead, and if so what the ; keypress. Note that the keypresses returned are WIMP-type,
69 ; not Straylight extended ones so you will have to use
70 ; akbd_translate if you need the extended type.
71 ;
72 ; This call could be used to allow buffering of keypresses:
73 ; on a Key_Pressed event you would call this routine until
74 ; it returns FALSE and store the codes it returns in a buffer
75 ; along with the code from the event.
76
77 IMPORT akbd_pollKey
78
79 ]
80
81 ;----- That's all, folks ----------------------------------------------------
82
83 END