23 #include <linux/keyboard.h>
31 static u_short masks[] = { 32, 16, 8, 4, 2, 1 };
33 static short letter_offsets[26] = {
34 -1, -1, -1, -1, -1, -1, -1, -1,
35 -1, -1, -1, -1, -1, -1, -1, -1,
36 -1, -1, -1, -1, -1, -1, -1, -1,
39 static u_char funcvals[] = {
60 static int cur_item, nstates;
62 static void build_key_data(
void)
67 nstates = (
int)(state_tbl[-1]);
68 memset(counters, 0,
sizeof(counters));
69 memset(key_offsets, 0,
sizeof(key_offsets));
70 kp = state_tbl + nstates + 1;
73 for (i = 0; i < nstates; i++, kp++) {
76 if ((state_tbl[i]&16) != 0 && *kp ==
SPK_KEY)
85 offset += (counters[
i]+1);
93 kp = state_tbl + nstates + 1;
94 while ((ch = *kp++)) {
95 for (i = 0; i < nstates; i++) {
99 if ((state_tbl[i]&16) != 0 && ch1 ==
SPK_KEY)
101 key = (state_tbl[
i] << 8) + ch;
103 offset = key_offsets[ch1];
106 p_key = key_data + offset + counters[ch1];
112 static void say_key(
int key)
116 for (i = 0; i < 6; i++) {
117 if (state & masks[i])
120 if ((key > 0) && (key <= num_key_names))
124 static int help_init(
void)
131 char *cur_funcname =
msg_get(MSG_FUNCNAMES_START + i);
132 if (start == *cur_funcname)
134 start = *cur_funcname;
135 letter_offsets[(start&31)-1] = i;
146 if (letter_offsets[0] == -1)
155 if (ch < 'a' || ch >
'z')
157 if (letter_offsets[ch-
'a'] == -1) {
162 cur_item = letter_offsets[ch-
'a'];
163 }
else if (type ==
KT_CUR) {
165 && (MSG_FUNCNAMES_START + cur_item + 1) <=
168 else if (ch == 3 && cur_item > 0)
179 if ((type !=
KT_SPKUP) && (key > 0) && (key <= num_key_names)) {
184 for (i = 0; funcvals[
i] != 0 && !
name; i++) {
185 if (ch == funcvals[i])
186 name =
msg_get(MSG_FUNCNAMES_START + i);
191 for (i = 0; i < nstates; i++) {
195 key += (state_tbl[
i] << 8);
201 name =
msg_get(MSG_FUNCNAMES_START + cur_item);
202 func = funcvals[cur_item];
204 if (key_offsets[func] == 0) {
208 p_keys = key_data + key_offsets[
func];
209 for (n = 0; p_keys[
n]; n++) {