1 /* asciikeys.c by Adam Rogoyski <apoc@laker.net> Temperanc on EFNet irc
2  * Copyright (C) 1998, 1999 Adam Rogoyski
3  * --- GNU General Public License Disclamer ---
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  */
13 
14 #include "hexedit.h"
15 
16 
17 void
asciiMode(wchar_t in)18 asciiMode (wchar_t in)
19 {
20    switch (in)
21    {
22       case KEY_UP:
23       case KEY_DOWN:
24       case KEY_LEFT:
25       case KEY_RIGHT:
26          break;
27       case CONTROL_L:
28          redraw ();
29          break;
30       case CONTROL_F:
31       case CONTROL_V:
32       case KEY_NPAGE:
33       case KEY_C3:
34          break;
35       case CONTROL_B:
36       case CONTROL_Y:
37       case KEY_PPAGE:
38       case KEY_A3:
39 #ifdef __PDCURSES__
40          case ALT_V:
41 #endif
42          break;
43       case CONTROL_T:
44          popupGotoOffset (Globals.filesize);
45          redraw ();
46          break;
47       case CONTROL_G:
48          popupHelp ();
49          redraw ();
50          break;
51       case CONTROL_O:
52          popupFileSave ();
53          redraw ();
54          break;
55       case CONTROL_R:
56          Globals.charset ^= 1;
57          redraw ();
58          break;
59       case CONTROL_X:
60          if (Globals.modified == MODIFIED)
61             exitSave (popupFileSave ());
62          else
63             exitProgram ();
64          break;
65       case CONTROL_A:
66       case KEY_IC:
67          break;
68       case CONTROL_D:
69       case KEY_DC:
70          break;
71       case KEY_END:
72          break;
73       case KEY_HOME:
74          break;
75       case TAB:
76          break;
77       case CONTROL_E:
78          switchModes ();
79          break;
80       case CONTROL_W:
81          search (0);
82          redraw ();
83          break;
84       case CONTROL_N:
85          search (1);
86          redraw ();
87          break;
88       case ESCAPE_CHARACTER:
89          in = getch ();
90          switch (in)
91          {
92             case ALT_V:
93                break;
94             case 91:
95                in = getch ();
96                switch (in)
97                {
98                   case 49: /* home */
99                      break;
100                   case 50: /* insert */
101                      break;
102                   case 51: /* delete */
103                      break;
104                   case 52: /* end */
105                      break;
106                   case 53: /* page up */
107                      break;
108                   case 54: /* page down */
109                     break;
110                }
111                /* getch (); */ /* returns 126 */
112                break;
113          }
114          break;
115       default:
116          break;
117    }
118 }
119