0
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
72
|
3 |
All Rights Reserved
|
0
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
IdentityDictionary subclass:#KeyboardMap
|
|
14 |
instanceVariableNames:'current'
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Interface-Support'
|
|
18 |
!
|
|
19 |
|
|
20 |
KeyboardMap comment:'
|
46
|
21 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
72
|
22 |
All Rights Reserved
|
54
|
23 |
|
72
|
24 |
$Header: /cvs/stx/stx/libview/KeyboardMap.st,v 1.5 1994-10-10 02:32:37 claus Exp $
|
46
|
25 |
'!
|
0
|
26 |
|
46
|
27 |
!KeyboardMap class methodsFor:'documentation'!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
72
|
32 |
All Rights Reserved
|
0
|
33 |
|
46
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
0
|
42 |
|
46
|
43 |
version
|
|
44 |
"
|
72
|
45 |
$Header: /cvs/stx/stx/libview/KeyboardMap.st,v 1.5 1994-10-10 02:32:37 claus Exp $
|
46
|
46 |
"
|
|
47 |
!
|
0
|
48 |
|
46
|
49 |
documentation
|
|
50 |
"
|
|
51 |
instances of KeyboardMap are used for mapping keystrokes AND sequences
|
|
52 |
of keystrokes to a function key.
|
|
53 |
There is usually only one instance in the system - hold in Display.
|
|
54 |
The setup of this map is usually done in the smalltalk.rc or one of the
|
|
55 |
display.rc files during startup.
|
|
56 |
"
|
|
57 |
! !
|
0
|
58 |
|
|
59 |
!KeyboardMap methodsFor:'accessing'!
|
|
60 |
|
|
61 |
bindValue:anObject to:aKey
|
|
62 |
self at:aKey put:anObject
|
|
63 |
!
|
|
64 |
|
|
65 |
bindValue:anObject to:key1 followedBy:key2
|
|
66 |
|submap|
|
|
67 |
|
|
68 |
submap := self at:key1.
|
|
69 |
submap isNil ifTrue:[
|
72
|
70 |
submap := KeyboardMap new.
|
|
71 |
self at:key1 put:submap.
|
0
|
72 |
].
|
|
73 |
submap at:key2 put:anObject
|
|
74 |
!
|
|
75 |
|
|
76 |
valueFor:aKey
|
|
77 |
|where value|
|
|
78 |
|
|
79 |
where := current notNil ifTrue:[current] ifFalse:[self].
|
|
80 |
|
72
|
81 |
value := where at:aKey ifAbsent:aKey.
|
0
|
82 |
(value isMemberOf:KeyboardMap) ifTrue:[
|
72
|
83 |
current := value.
|
|
84 |
^ nil.
|
0
|
85 |
].
|
|
86 |
current := nil.
|
|
87 |
^ value
|
|
88 |
! !
|