~benklop/+junk/lcdproc

« back to all changes in this revision

Viewing changes to contrib/patches/lcdprocserverHKEY.diff

  • Committer: Bazaar Package Importer
  • Author(s): Jose Luis Tallon
  • Date: 2006-07-23 20:23:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060723202348-w65hrbvpwniqn9by
Tags: 0.5.0-1
* New upstream version (Closes: #367945)
  - New maintainer. Thank you for your previous work, Jon!
  - Upstream added suport for 'imon' devices (Closes: #365496)
  - Upstream fixed descriptor leak (Closes: #355460)
  - Upstream fixed placing widgets in frame (Closes: #355458)

* Packaging
  - Depend on debconf-2.0; Allow transition (Closes: #331885)
  - Remove dependency on automake (Closes: #376449)
  - Include missing INSTALL instructions (Closes: #365436)
  - Changed most "by hand" installation steps into debhelper-based ones
  - Updated to 3.7.2 standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff --exclude='*.wanjet' --exclude='.??*' --exclude=config.h --exclude='*.orig' --exclude=Makefile --exclude='*.o' --exclude=Doxyfile --exclude='*.a' --exclude=config.log --exclude=config.status --exclude='init-*' -Nuarp server/menu.c server.HKEY/menu.c
 
2
--- server/menu.c       2006-01-26 19:47:59.000000000 -0800
 
3
+++ server.HKEY/menu.c  2006-02-21 09:21:25.000000000 -0800
 
4
@@ -39,6 +39,13 @@
 
5
 #include "screen.h"
 
6
 #include "widget.h"
 
7
 
 
8
+#ifndef HKEY //hybrid keys
 
9
+#include "shared/configfile.h"
 
10
+
 
11
+extern int hybrid_left_key;
 
12
+extern int hybrid_right_key;
 
13
+#endif //HKEY
 
14
+
 
15
 /** Basicly a patched version of LL_GetByIndex() that ignores hidden
 
16
  * entries completely. (But it takes a menu as an argument.) */
 
17
 static void *
 
18
@@ -559,12 +566,86 @@ MenuResult menu_process_input(Menu *menu
 
19
                return MENURESULT_ERROR;
 
20
 
 
21
        switch (token) {
 
22
+         case MENUTOKEN_LEFT:
 
23
+               if (!extended)
 
24
+                       return MENURESULT_NONE;
 
25
+#ifndef HKEY   //hybrid key left
 
26
+               /*
 
27
+                * hybrid left key just fall through to menu key
 
28
+                */
 
29
+               if (!hybrid_left_key) {
 
30
+                       subitem = menu_get_subitem (menu, menu->data.menu.selector_pos);
 
31
+                       if (subitem == NULL)
 
32
+                               break;
 
33
+                       switch (subitem->type) {
 
34
+                         case MENUITEM_CHECKBOX:
 
35
+                               /* note: this dangerous looking code works since
 
36
+                                * CheckboxValue is an enum >= 0. */
 
37
+                               if (subitem->data.checkbox.allow_gray) {
 
38
+                                       subitem->data.checkbox.value = (subitem->data.checkbox.value - 1) % 3;
 
39
+                               }
 
40
+                               else {
 
41
+                                       subitem->data.checkbox.value = (subitem->data.checkbox.value - 1) % 2;
 
42
+                               }
 
43
+                               if (subitem->event_func)
 
44
+                                       subitem->event_func (subitem, MENUEVENT_UPDATE);
 
45
+                               return MENURESULT_NONE;
 
46
+                         case MENUITEM_RING:
 
47
+                               /* ring: jump to the end if beginning is reached */
 
48
+                               subitem->data.ring.value = (subitem->data.ring.value < 1)
 
49
+                                       ? LL_Length (subitem->data.ring.strings) - 1
 
50
+                                       : (subitem->data.ring.value - 1) % LL_Length (subitem->data.ring.strings);
 
51
+                               if (subitem->event_func)
 
52
+                                       subitem->event_func (subitem, MENUEVENT_UPDATE);
 
53
+                               return MENURESULT_NONE;
 
54
+                         default:
 
55
+                               break;
 
56
+                       }
 
57
+                       return MENURESULT_NONE;
 
58
+               }
 
59
+#endif //HKEY
 
60
          case MENUTOKEN_MENU:
 
61
                subitem = menu_get_item_for_predecessor_check(menu);
 
62
                if ( ! subitem)
 
63
                        return MENURESULT_ERROR;
 
64
                return menuitem_predecessor2menuresult(
 
65
                        subitem->predecessor_id, MENURESULT_CLOSE);
 
66
+         case MENUTOKEN_RIGHT:
 
67
+#ifndef HKEY //hybrid key right
 
68
+               /*
 
69
+                * hybrid right key just fall through to enter key
 
70
+                */
 
71
+               if (!hybrid_right_key) {
 
72
+                       if (!extended) /* Can you get a MENUTOKEN_RIGHT w/o a RightKey defined, this code maybe be unecessary */
 
73
+                               return MENURESULT_NONE;
 
74
+               
 
75
+                       subitem = menu_get_subitem(menu, menu->data.menu.selector_pos);
 
76
+                       if (subitem == NULL)
 
77
+                               break;
 
78
+                       switch (subitem->type) {
 
79
+                       case MENUITEM_CHECKBOX:
 
80
+                               if (subitem->data.checkbox.allow_gray) {
 
81
+                                       subitem->data.checkbox.value = (subitem->data.checkbox.value + 1) % 3;
 
82
+                               }
 
83
+                               else {
 
84
+                                       subitem->data.checkbox.value = (subitem->data.checkbox.value + 1) % 2;
 
85
+                               }
 
86
+                               if (subitem->event_func)
 
87
+                                       subitem->event_func (subitem, MENUEVENT_UPDATE);
 
88
+                               return MENURESULT_NONE;
 
89
+                       case MENUITEM_RING:
 
90
+                               subitem->data.ring.value = (subitem->data.ring.value + 1) % LL_Length (subitem->data.ring.strings);
 
91
+                               if (subitem->event_func)
 
92
+                                       subitem->event_func (subitem, MENUEVENT_UPDATE);
 
93
+                               return MENURESULT_NONE;
 
94
+                       case MENUITEM_MENU:
 
95
+                               return MENURESULT_ENTER;
 
96
+                       default:
 
97
+                               break;
 
98
+                       }
 
99
+                       return MENURESULT_NONE;
 
100
+               }
 
101
+#endif //HKEY
 
102
          case MENUTOKEN_ENTER:
 
103
                subitem = menu_get_subitem (menu, menu->data.menu.selector_pos);
 
104
                if (!subitem)
 
105
@@ -609,6 +690,18 @@ MenuResult menu_process_input(Menu *menu
 
106
                                menu->data.menu.scroll --;
 
107
                }
 
108
                else if (menu->data.menu.selector_pos == 0) {
 
109
+#ifndef HKEY //hybrid key left
 
110
+                       if ( hybrid_left_key ) {
 
111
+                               /*
 
112
+                               * If this menu has only checkbox's and/or rings
 
113
+                               *  need a key to get back from this menu on a 4 key pad
 
114
+                               */
 
115
+                               subitem = menu_get_item_for_predecessor_check(menu);
 
116
+                               if ( subitem && ((subitem->type == MENUITEM_CHECKBOX) || (subitem->type == MENUITEM_RING)))
 
117
+                                       return menuitem_predecessor2menuresult(
 
118
+                                               subitem->predecessor_id, MENURESULT_CLOSE);
 
119
+                               }
 
120
+#endif // HKEY
 
121
                        // wrap around to last menu entry
 
122
                        menu->data.menu.selector_pos = menu_visible_item_count(menu) - 1;
 
123
                        menu->data.menu.scroll = menu->data.menu.selector_pos + 2 - display_props->height;
 
124
@@ -626,67 +719,6 @@ MenuResult menu_process_input(Menu *menu
 
125
                        menu->data.menu.scroll = 0;
 
126
                }       
 
127
                return MENURESULT_NONE;
 
128
-         case MENUTOKEN_LEFT:
 
129
-               if (!extended)
 
130
-                       return MENURESULT_NONE;
 
131
-               
 
132
-               subitem = menu_get_subitem (menu, menu->data.menu.selector_pos);
 
133
-               if (subitem == NULL)
 
134
-                       break;
 
135
-               switch (subitem->type) {
 
136
-                 case MENUITEM_CHECKBOX:
 
137
-                       /* note: this dangerous looking code works since
 
138
-                        * CheckboxValue is an enum >= 0. */
 
139
-                       if (subitem->data.checkbox.allow_gray) {
 
140
-                               subitem->data.checkbox.value = (subitem->data.checkbox.value - 1) % 3;
 
141
-                       }
 
142
-                       else {
 
143
-                               subitem->data.checkbox.value = (subitem->data.checkbox.value - 1) % 2;
 
144
-                       }
 
145
-                       if (subitem->event_func)
 
146
-                               subitem->event_func (subitem, MENUEVENT_UPDATE);
 
147
-                       return MENURESULT_NONE;
 
148
-                 case MENUITEM_RING:
 
149
-                       /* ring: jump to the end if beginning is reached */
 
150
-                       subitem->data.ring.value = (subitem->data.ring.value < 1)
 
151
-                               ? LL_Length (subitem->data.ring.strings) - 1
 
152
-                               : (subitem->data.ring.value - 1) % LL_Length (subitem->data.ring.strings);
 
153
-                       if (subitem->event_func)
 
154
-                               subitem->event_func (subitem, MENUEVENT_UPDATE);
 
155
-                       return MENURESULT_NONE;
 
156
-                 default:
 
157
-                       break;
 
158
-               }
 
159
-               return MENURESULT_NONE;
 
160
-         case MENUTOKEN_RIGHT:
 
161
-               if (!extended)
 
162
-                       return MENURESULT_NONE;
 
163
-               
 
164
-               subitem = menu_get_subitem(menu, menu->data.menu.selector_pos);
 
165
-               if (subitem == NULL)
 
166
-                       break;
 
167
-               switch (subitem->type) {
 
168
-                 case MENUITEM_CHECKBOX:
 
169
-                       if (subitem->data.checkbox.allow_gray) {
 
170
-                               subitem->data.checkbox.value = (subitem->data.checkbox.value + 1) % 3;
 
171
-                       }
 
172
-                       else {
 
173
-                               subitem->data.checkbox.value = (subitem->data.checkbox.value + 1) % 2;
 
174
-                       }
 
175
-                       if (subitem->event_func)
 
176
-                               subitem->event_func (subitem, MENUEVENT_UPDATE);
 
177
-                       return MENURESULT_NONE;
 
178
-                 case MENUITEM_RING:
 
179
-                       subitem->data.ring.value = (subitem->data.ring.value + 1) % LL_Length (subitem->data.ring.strings);
 
180
-                       if (subitem->event_func)
 
181
-                               subitem->event_func (subitem, MENUEVENT_UPDATE);
 
182
-                       return MENURESULT_NONE;
 
183
-                 case MENUITEM_MENU:
 
184
-                       return MENURESULT_ENTER;
 
185
-                 default:
 
186
-                       break;
 
187
-               }
 
188
-               return MENURESULT_NONE;
 
189
          case MENUTOKEN_OTHER:
 
190
                /* TODO: move to the selected number and enter it */
 
191
                return MENURESULT_NONE;
 
192
diff --exclude='*.wanjet' --exclude='.??*' --exclude=config.h --exclude='*.orig' --exclude=Makefile --exclude='*.o' --exclude=Doxyfile --exclude='*.a' --exclude=config.log --exclude=config.status --exclude='init-*' -Nuarp server/menuitem.c server.HKEY/menuitem.c
 
193
--- server/menuitem.c   2006-01-26 19:47:59.000000000 -0800
 
194
+++ server.HKEY/menuitem.c      2006-02-21 09:22:53.000000000 -0800
 
195
@@ -84,6 +84,10 @@ const IpSstringProperties IPinfo[] = {
 
196
        { 39, ':', 16, 4, 65535, { 4096, 256, 16, 1, 0 }, "%04x", verify_ipv6, "0:0:0:0:0:0:0:0" }
 
197
 };
 
198
        
 
199
+#ifndef HKEY // hybrid keys
 
200
+extern int hybrid_left_key;
 
201
+extern int hybrid_right_key;
 
202
+#endif //HKEY
 
203
 
 
204
 /******** MENU UTILITY FUNCTIONS ********/
 
205
 
 
206
@@ -983,26 +987,38 @@ MenuResult menuitem_process_input_slider
 
207
                return MENURESULT_ERROR;
 
208
 
 
209
        switch (token) {
 
210
-         case MENUTOKEN_MENU:
 
211
-               return menuitem_predecessor2menuresult(
 
212
-                       item->predecessor_id, MENURESULT_CLOSE);
 
213
-         case MENUTOKEN_ENTER:
 
214
-               return menuitem_successor2menuresult(
 
215
-                       item->successor_id, MENURESULT_CLOSE);
 
216
          case MENUTOKEN_UP:
 
217
          case MENUTOKEN_RIGHT:
 
218
-               item->data.slider.value = min (item->data.slider.maxvalue,
 
219
+#ifndef HKEY //hybrid key right
 
220
+               if ( !hybrid_right_key || token == MENUTOKEN_UP )  {
 
221
+#endif /*HKEY*/
 
222
+                       item->data.slider.value = min (item->data.slider.maxvalue,
 
223
                                item->data.slider.value + item->data.slider.stepsize);
 
224
-               if (item->event_func)
 
225
-                       item->event_func (item, MENUEVENT_PLUS);
 
226
-               return MENURESULT_NONE;
 
227
+                       if (item->event_func)
 
228
+                               item->event_func (item, MENUEVENT_PLUS);
 
229
+                       return MENURESULT_NONE;
 
230
+#ifndef HKEY //hybrid key right
 
231
+               } /* hybrid right key fall through to enter */
 
232
+#endif /*HKEY*/
 
233
+         case MENUTOKEN_ENTER:
 
234
+               return menuitem_successor2menuresult(
 
235
+                       item->successor_id, MENURESULT_CLOSE);
 
236
          case MENUTOKEN_DOWN:
 
237
          case MENUTOKEN_LEFT:
 
238
-               item->data.slider.value = max (item->data.slider.minvalue,
 
239
+#ifndef HKEY //hybrid key left
 
240
+               if ( !hybrid_left_key || token == MENUTOKEN_DOWN )  {
 
241
+#endif /*HKEY*/
 
242
+                       item->data.slider.value = max (item->data.slider.minvalue,
 
243
                                item->data.slider.value - item->data.slider.stepsize);
 
244
-               if (item->event_func)
 
245
-                       item->event_func (item, MENUEVENT_MINUS);
 
246
-               return MENURESULT_NONE;
 
247
+                       if (item->event_func)
 
248
+                               item->event_func (item, MENUEVENT_MINUS);
 
249
+                       return MENURESULT_NONE;
 
250
+#ifndef HKEY //hybrid key left
 
251
+               } /* hybrid left key fall through to menu */
 
252
+#endif /*HKEY*/
 
253
+         case MENUTOKEN_MENU:
 
254
+               return menuitem_predecessor2menuresult(
 
255
+                       item->predecessor_id, MENURESULT_CLOSE);
 
256
          case MENUTOKEN_OTHER:
 
257
           default:
 
258
                break;
 
259
@@ -1037,6 +1053,21 @@ MenuResult menuitem_process_input_numeri
 
260
                item->data.numeric.error_code = 0;
 
261
 
 
262
                switch (token) {
 
263
+                 case MENUTOKEN_LEFT:
 
264
+                       /* The user wants to go to back a digit */
 
265
+                       if (pos > 0) {
 
266
+                               item->data.numeric.edit_pos--;
 
267
+                               if (item->data.numeric.edit_offs > item->data.numeric.edit_pos)
 
268
+                                       item->data.numeric.edit_offs = item->data.numeric.edit_pos;
 
269
+#ifndef HKEY //hybrid key left
 
270
+                               if( hybrid_left_key ) return MENURESULT_NONE;
 
271
+                       }
 
272
+                       if( !hybrid_left_key ) return MENURESULT_NONE;
 
273
+                       /* fall through to MENU */
 
274
+#else
 
275
+                       }       
 
276
+                       return MENURESULT_NONE;
 
277
+#endif /*HKEY*/
 
278
                  case MENUTOKEN_MENU:
 
279
                        if (pos == 0) {
 
280
                                return menuitem_predecessor2menuresult(
 
281
@@ -1047,6 +1078,21 @@ MenuResult menuitem_process_input_numeri
 
282
                                menuitem_reset_numeric(item);
 
283
                        }
 
284
                        return MENURESULT_NONE;
 
285
+                 case MENUTOKEN_RIGHT:
 
286
+                       /* The user wants to go to next digit */
 
287
+                       if (str[pos] != '\0' && pos < max_len) {
 
288
+                               item->data.numeric.edit_pos++;
 
289
+                               if (pos >= display_props->width - 2)
 
290
+                                       item->data.numeric.edit_offs++;
 
291
+#ifndef HKEY //hybrid key right
 
292
+                               if( hybrid_right_key ) return MENURESULT_NONE;
 
293
+                       }
 
294
+                       if( !hybrid_right_key ) return MENURESULT_NONE;
 
295
+                       /* fall through to ENTER */
 
296
+#else
 
297
+                       }
 
298
+                       return MENURESULT_NONE;
 
299
+#endif /*HKEY*/
 
300
                  case MENUTOKEN_ENTER:
 
301
                        if ((extended) || (str[pos] == '\0')) {
 
302
                                int value;
 
303
@@ -1131,22 +1177,6 @@ MenuResult menuitem_process_input_numeri
 
304
                                }
 
305
                        }
 
306
                        return MENURESULT_NONE;
 
307
-                 case MENUTOKEN_RIGHT:
 
308
-                       /* The user wants to go to next digit */
 
309
-                       if (str[pos] != '\0' && pos < max_len) {
 
310
-                               item->data.numeric.edit_pos++;
 
311
-                               if (pos >= display_props->width - 2)
 
312
-                                       item->data.numeric.edit_offs++;
 
313
-                       }
 
314
-                       return MENURESULT_NONE;
 
315
-                 case MENUTOKEN_LEFT:
 
316
-                       /* The user wants to go to back a digit */
 
317
-                       if (pos > 0) {
 
318
-                               item->data.numeric.edit_pos--;
 
319
-                               if (item->data.numeric.edit_offs > item->data.numeric.edit_pos)
 
320
-                                       item->data.numeric.edit_offs = item->data.numeric.edit_pos;
 
321
-                       }
 
322
-                       return MENURESULT_NONE;
 
323
                  case MENUTOKEN_OTHER:
 
324
                        if (pos >= max_len) {
 
325
                                /* We're not allowed to add anything anymore */
 
326
@@ -1196,6 +1226,21 @@ MenuResult menuitem_process_input_alpha 
 
327
                item->data.alpha.error_code = 0;
 
328
 
 
329
                switch (token) {
 
330
+                 case MENUTOKEN_LEFT:
 
331
+                       /* The user wants to go to back a digit */
 
332
+                       if (pos > 0) {
 
333
+                               item->data.alpha.edit_pos--;
 
334
+                               if (item->data.alpha.edit_offs > item->data.alpha.edit_pos)
 
335
+                                       item->data.alpha.edit_offs = item->data.alpha.edit_pos;
 
336
+#ifndef HKEY //hybrid key left
 
337
+                               if( hybrid_left_key ) return MENURESULT_NONE;
 
338
+                       }
 
339
+                       if( !hybrid_left_key ) return MENURESULT_NONE;
 
340
+                       /* fall through to MENU */
 
341
+#else
 
342
+                       }       
 
343
+                       return MENURESULT_NONE;
 
344
+#endif /*HKEY*/
 
345
                  case MENUTOKEN_MENU:
 
346
                        if (pos == 0) {
 
347
                                return menuitem_predecessor2menuresult(
 
348
@@ -1206,6 +1251,22 @@ MenuResult menuitem_process_input_alpha 
 
349
                                menuitem_reset_alpha(item);
 
350
                        }
 
351
                        return MENURESULT_NONE;
 
352
+                 case MENUTOKEN_RIGHT:
 
353
+                       /* The user wants to go to next digit */
 
354
+                       if (str[item->data.alpha.edit_pos] != '\0' &&
 
355
+                           pos < item->data.alpha.maxlength - 1) {
 
356
+                               item->data.alpha.edit_pos++;
 
357
+                               if (pos >= display_props->width - 2)
 
358
+                                       item->data.alpha.edit_offs++;
 
359
+#ifndef HKEY //hybrid key right
 
360
+                               if( hybrid_right_key ) return MENURESULT_NONE;
 
361
+                       }
 
362
+                       if( !hybrid_right_key ) return MENURESULT_NONE;
 
363
+                       /* fall through to ENTER */
 
364
+#else
 
365
+                       }
 
366
+                       return MENURESULT_NONE;
 
367
+#endif /*HKEY*/
 
368
                  case MENUTOKEN_ENTER:
 
369
                        if ((extended) || (str[item->data.alpha.edit_pos] == '\0')) {
 
370
                                /* The user completed his input */
 
371
@@ -1278,23 +1339,6 @@ MenuResult menuitem_process_input_alpha 
 
372
                                }
 
373
                        }
 
374
                        return MENURESULT_NONE;
 
375
-                 case MENUTOKEN_RIGHT:
 
376
-                       /* The user wants to go to next digit */
 
377
-                       if (str[item->data.alpha.edit_pos] != '\0' &&
 
378
-                           pos < item->data.alpha.maxlength - 1) {
 
379
-                               item->data.alpha.edit_pos++;
 
380
-                               if (pos >= display_props->width - 2)
 
381
-                                       item->data.alpha.edit_offs++;
 
382
-                       }
 
383
-                       return MENURESULT_NONE;
 
384
-                 case MENUTOKEN_LEFT:
 
385
-                       /* The user wants to go to back a digit */
 
386
-                       if (pos > 0) {
 
387
-                               item->data.alpha.edit_pos--;
 
388
-                               if (item->data.alpha.edit_offs > item->data.alpha.edit_pos)
 
389
-                                       item->data.alpha.edit_offs = item->data.alpha.edit_pos;
 
390
-                       }       
 
391
-                       return MENURESULT_NONE;
 
392
                  case MENUTOKEN_OTHER:
 
393
                        if (pos >= item->data.alpha.maxlength) {
 
394
                                /* We're not allowed to add anything anymore */
 
395
@@ -1333,7 +1377,24 @@ MenuResult menuitem_process_input_ip (Me
 
396
        item->data.ip.error_code = 0;
 
397
 
 
398
        switch (token) {
 
399
-                 case MENUTOKEN_MENU:
 
400
+               case MENUTOKEN_LEFT:
 
401
+                       /* The user wants to go to back a digit */
 
402
+                       if (pos > 0) {
 
403
+                               item->data.ip.edit_pos--;
 
404
+                               if (str[item->data.ip.edit_pos] == ipinfo->sep)
 
405
+                                       item->data.ip.edit_pos--;
 
406
+                               if (item->data.ip.edit_offs > item->data.ip.edit_pos)
 
407
+                                       item->data.ip.edit_offs = item->data.ip.edit_pos;
 
408
+#ifndef HKEY //hybrid key left
 
409
+                               if( hybrid_left_key ) return MENURESULT_NONE;
 
410
+                       }
 
411
+                       if( !hybrid_left_key ) return MENURESULT_NONE;
 
412
+                       /* fall through to MENU */
 
413
+#else
 
414
+                       }
 
415
+                       return MENURESULT_NONE;
 
416
+#endif /*HKEY*/
 
417
+               case MENUTOKEN_MENU:
 
418
                        if (pos == 0) {
 
419
                                return menuitem_predecessor2menuresult(
 
420
                                        item->predecessor_id, MENURESULT_CLOSE);
 
421
@@ -1343,6 +1404,22 @@ MenuResult menuitem_process_input_ip (Me
 
422
                                menuitem_reset_ip(item);
 
423
                        }
 
424
                        return MENURESULT_NONE;
 
425
+               case MENUTOKEN_RIGHT:
 
426
+                       if (pos < item->data.ip.maxlength - 1) {
 
427
+                               item->data.ip.edit_pos++;
 
428
+                               if (str[item->data.ip.edit_pos] == ipinfo->sep)
 
429
+                                       item->data.ip.edit_pos++;
 
430
+                               while (item->data.ip.edit_pos - item->data.ip.edit_offs > display_props->width - 2)
 
431
+                                       item->data.ip.edit_offs++;
 
432
+#ifndef HKEY //hybrid key right
 
433
+                               if( hybrid_right_key ) return MENURESULT_NONE;
 
434
+                       }
 
435
+                       if( !hybrid_right_key ) return MENURESULT_NONE;
 
436
+                       /* fall through to ENTER */
 
437
+#else
 
438
+                       }
 
439
+                       return MENURESULT_NONE;
 
440
+#endif /*HKEY*/
 
441
                case MENUTOKEN_ENTER:
 
442
                        if (extended || (pos >= item->data.ip.maxlength - 1)) {
 
443
                                // remove the leading spaces/zeros in each octet-representing string
 
444
@@ -1409,25 +1486,6 @@ MenuResult menuitem_process_input_ip (Me
 
445
                        snprintf(numstr, 5, ipinfo->format, num);
 
446
                        memcpy(&str[pos - (pos % (ipinfo->width + 1))], numstr, ipinfo->width);
 
447
                        return MENURESULT_NONE;
 
448
-               case MENUTOKEN_RIGHT:
 
449
-                       if (pos < item->data.ip.maxlength - 1) {
 
450
-                               item->data.ip.edit_pos++;
 
451
-                               if (str[item->data.ip.edit_pos] == ipinfo->sep)
 
452
-                                       item->data.ip.edit_pos++;
 
453
-                               while (item->data.ip.edit_pos - item->data.ip.edit_offs > display_props->width - 2)
 
454
-                                       item->data.ip.edit_offs++;
 
455
-                       }
 
456
-                       return MENURESULT_NONE;
 
457
-               case MENUTOKEN_LEFT:
 
458
-                       /* The user wants to go to back a digit */
 
459
-                       if (pos > 0) {
 
460
-                               item->data.ip.edit_pos--;
 
461
-                               if (str[item->data.ip.edit_pos] == ipinfo->sep)
 
462
-                                       item->data.ip.edit_pos--;
 
463
-                               if (item->data.ip.edit_offs > item->data.ip.edit_pos)
 
464
-                                       item->data.ip.edit_offs = item->data.ip.edit_pos;
 
465
-                       }
 
466
-                       return MENURESULT_NONE;
 
467
                case MENUTOKEN_OTHER:
 
468
                        /* process other keys */
 
469
                        if ((strlen(key) == 1) &&
 
470
diff --exclude='*.wanjet' --exclude='.??*' --exclude=config.h --exclude='*.orig' --exclude=Makefile --exclude='*.o' --exclude=Doxyfile --exclude='*.a' --exclude=config.log --exclude=config.status --exclude='init-*' -Nuarp server/menuscreens.c server.HKEY/menuscreens.c
 
471
--- server/menuscreens.c        2006-01-26 19:47:59.000000000 -0800
 
472
+++ server.HKEY/menuscreens.c   2006-02-21 09:33:21.000000000 -0800
 
473
@@ -48,6 +48,15 @@ char * down_key;
 
474
 char * left_key;
 
475
 char * right_key;
 
476
 
 
477
+#ifndef HKEY //hybrid keys
 
478
+/*
 
479
+ * hybrid left becomes menu key at left edge of screen
 
480
+ * hybrid right becomes enter key at right edge of screen
 
481
+ */
 
482
+int hybrid_left_key = 0;
 
483
+int hybrid_right_key = 0;
 
484
+#endif //HKEY
 
485
+
 
486
 Screen * menuscreen = NULL;
 
487
 MenuItem * active_menuitem = NULL;
 
488
 /** the "real" main_menu */
 
489
@@ -91,6 +100,11 @@ int menuscreens_init()
 
490
        if (tmp)
 
491
                right_key = strdup(tmp);
 
492
     
 
493
+#ifndef HKEY //get hybrid keys from config file
 
494
+       hybrid_right_key = config_get_bool ("menu", "HybridRightKey", 0, 0);
 
495
+       hybrid_left_key = config_get_bool ("menu", "HybridLeftKey", 0, 0);
 
496
+#endif
 
497
+
 
498
         
 
499
        /* Now reserve keys */
 
500
        input_reserve_key (menu_key, true, NULL);
 
501
@@ -186,6 +200,11 @@ void menuscreen_inform_item_modified (Me
 
502
 
 
503
 bool is_menu_key (char * key)
 
504
 {
 
505
+#ifndef HKEY //hybrid keys, any key wake-up menus
 
506
+       /* any key wakes up menus */
 
507
+       if (key && ( hybrid_left_key || hybrid_right_key ))
 
508
+               return true;
 
509
+#endif //HKEY
 
510
        if (menu_key && key && strcmp (key, menu_key) == 0)
 
511
                return true;
 
512
        else
 
513
@@ -466,28 +485,28 @@ void menuscreen_create_menu ()
 
514
                        menu_add_item (options_menu, driver_menu);
 
515
                        if (contrast_avail) {
 
516
                                int contrast = driver->get_contrast(driver);
 
517
-                               
 
518
+
 
519
                                /* menu's client is NULL since we're in the server */
 
520
                                slider = menuitem_create_slider ("contrast", contrast_handler, "Contrast",
 
521
-                                                                NULL, "min", "max", 0, 1000, 25, contrast);
 
522
+                                                               NULL, "min", "max", 0, 1000, 25, contrast);
 
523
                                menu_add_item (driver_menu, slider);
 
524
                        }
 
525
                        if (brightness_avail) {
 
526
                                int onbrightness = driver->get_brightness (driver, BACKLIGHT_ON);
 
527
                                int offbrightness = driver->get_brightness (driver, BACKLIGHT_OFF);
 
528
-                               
 
529
+
 
530
                                slider = menuitem_create_slider ("onbrightness", brightness_handler, "On Brightness",
 
531
-                                                                NULL, "min", "max", 0, 1000, 25, onbrightness);
 
532
+                                                               NULL, "min", "max", 0, 1000, 25, onbrightness);
 
533
                                menu_add_item (driver_menu, slider);
 
534
 
 
535
                                slider = menuitem_create_slider ("offbrightness", brightness_handler, "Off Brightness",
 
536
-                                                                NULL, "min", "max", 0, 1000, 25, offbrightness);
 
537
+                                                               NULL, "min", "max", 0, 1000, 25, offbrightness);
 
538
                                menu_add_item (driver_menu, slider);
 
539
                        }
 
540
                }
 
541
        }
 
542
 
 
543
-#ifdef LCDPROC_TESTMENUS       
 
544
+#ifdef LCDPROC_TESTMENUS
 
545
        test_menu = menu_create ("test", NULL, "Test menu", NULL);
 
546
        menu_add_item (main_menu, test_menu);
 
547