Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | \ ========== Copyright Header Begin ========================================== |
2 | \ | |
3 | \ Hypervisor Software File: tablecode.fth | |
4 | \ | |
5 | \ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | \ | |
7 | \ - Do no alter or remove copyright notices | |
8 | \ | |
9 | \ - Redistribution and use of this software in source and binary forms, with | |
10 | \ or without modification, are permitted provided that the following | |
11 | \ conditions are met: | |
12 | \ | |
13 | \ - Redistribution of source code must retain the above copyright notice, | |
14 | \ this list of conditions and the following disclaimer. | |
15 | \ | |
16 | \ - Redistribution in binary form must reproduce the above copyright notice, | |
17 | \ this list of conditions and the following disclaimer in the | |
18 | \ documentation and/or other materials provided with the distribution. | |
19 | \ | |
20 | \ Neither the name of Sun Microsystems, Inc. or the names of contributors | |
21 | \ may be used to endorse or promote products derived from this software | |
22 | \ without specific prior written permission. | |
23 | \ | |
24 | \ This software is provided "AS IS," without a warranty of any kind. | |
25 | \ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | |
26 | \ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | |
27 | \ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | |
28 | \ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | |
29 | \ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
30 | \ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN | |
31 | \ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR | |
32 | \ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | |
33 | \ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | |
34 | \ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | |
35 | \ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
36 | \ | |
37 | \ You acknowledge that this software is not designed, licensed or | |
38 | \ intended for use in the design, construction, operation or maintenance of | |
39 | \ any nuclear facility. | |
40 | \ | |
41 | \ ========== Copyright Header End ============================================ | |
42 | \ id: @(#)tablecode.fth 1.2 99/02/25 | |
43 | \ purpose: | |
44 | \ copyright: Copyright 1997 Sun Microsystems, Inc. All Rights Reserved | |
45 | \ | |
46 | ||
47 | : do-keyboard does> set-keytable ; | |
48 | ||
49 | ||
50 | \ The compiler for creating keymaps | |
51 | ||
52 | : keyboard: ( id -- ) \ name | |
53 | dup diff-encoding new-kbd-table c, diff-encoding c, | |
54 | do-keyboard | |
55 | ; | |
56 | : full-keyboard: ( id -- ) \ name | |
57 | dup table-encoding new-kbd-table c, table-encoding c, | |
58 | do-keyboard | |
59 | ; | |
60 | : alias-keyboard: ( id alias-id -- ) \ name | |
61 | over alias-encoding new-kbd-table c, alias-encoding c, | |
62 | do-keyboard | |
63 | ; | |
64 | ||
65 | \ The next five following words are used to store the positions and their | |
66 | \ associate keys which are different than the default keyboard (Spain keybd) | |
67 | \ In front of each position#, there will be stored a flag byte which | |
68 | \ indicates which of the three keys are to be changed. If bit 0 is high, | |
69 | \ then the alternate key is being changed, \ if bit 1 is high, then the | |
70 | \ shifted key is being changed; and if bit 2 is high then the normal key | |
71 | \ is being changed. | |
72 | ||
73 | \ allk is used to replace all three normal/shifted/altg keys associate with | |
74 | \ this postition. | |
75 | : allk ( normal-key shifted-key altg-key position -- ) | |
76 | 7 c, c, c, c, c, | |
77 | ; | |
78 | ||
79 | \ sak is used to replace the shifted and altg keys which are associated with | |
80 | \ this postition. | |
81 | : sak ( shifted-key altg-key position -- ) | |
82 | 3 c, c, c, c, | |
83 | ; | |
84 | ||
85 | \ nsk is used to replace the normal and shifted keys which are associated with | |
86 | \ this postition. | |
87 | : nsk ( normal-key shifted-key position -- ) | |
88 | 6 c, c, c, c, | |
89 | ; | |
90 | ||
91 | \ nak is used to replace the normal and altg keys which are associated with | |
92 | \ this postition. | |
93 | : nak ( normal-key altg-key position -- ) | |
94 | 5 c, c, c, c, | |
95 | ; | |
96 | ||
97 | \ nk is used to replace the normal key which is associated with this postition. | |
98 | : nk ( normal-key position -- ) | |
99 | 4 c, c, c, | |
100 | ; | |
101 | ||
102 | \ ak is used to replace the altg key which is associated with this postition. | |
103 | : ak ( altg-key position -- ) | |
104 | 1 c, c, c, | |
105 | ; | |
106 | ||
107 | \ ak is used to replace the shift key which is associated with this postition. | |
108 | : sk ( shifted-key position -- ) | |
109 | 2 c, c, c, | |
110 | ; | |
111 | ||
112 | \ kend is used to marked the end of the list. | |
113 | : kend ( -- ) d# 255 c, build-table ; | |
114 | ||
115 | : kend-alias ( -- ) build-alias ; | |
116 | ||
117 | : 8keys ( key1 key2 ... key8 -- ) 0 7 do i roll c, -1 +loop ; | |
118 |