summaryrefslogtreecommitdiff
path: root/i386/i386at
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-03-20 17:40:41 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-03-20 17:40:41 +0100
commitdb8d7fae8417a28ac2925e90fd16f870108b2db9 (patch)
tree8ec55c7be91b3de20ba602fe402c162a34589bc6 /i386/i386at
parentd96ea910f11eeaf09d1a7d0afbfd43b0b3a3b056 (diff)
Clean kd.[ch]
* i386/i386at/kd.h (NUMSTATES): Fix comment about NORM_STATE. * i386/i386at/kd.c (key_map): Use K_* macros instead of numeric values.
Diffstat (limited to 'i386/i386at')
-rw-r--r--i386/i386at/kd.c116
-rw-r--r--i386/i386at/kd.h2
2 files changed, 59 insertions, 59 deletions
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index eaeea1b..7c8310f 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -225,63 +225,63 @@ u_char *esc_spt = (u_char *)0;
unsigned char key_map[NUMKEYS][WIDTH_KMAP] = {
{NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC},
{K_ESC,NC,NC, K_ESC,NC,NC, K_ESC,NC,NC, 0x1b,K_ESC,NC, K_ESC,NC,NC},
-{K_ONE,NC,NC, K_BANG,NC,NC, K_ONE,NC,NC, 0x1b,0x31,NC, 0x1b,0x4e,0x21},
-{K_TWO,NC,NC, K_ATSN,NC,NC, K_NUL,NC,NC, 0x1b,0x32,NC, 0x1b,0x4e,0x40},
-{K_THREE,NC,NC, K_POUND,NC,NC, K_THREE,NC,NC, 0x1b,0x33,NC, 0x1b,0x4e,0x23},
-{K_FOUR,NC,NC, K_DOLLAR,NC,NC, K_FOUR,NC,NC, 0x1b,0x34,NC, 0x1b,0x4e,0x24},
-{K_FIVE,NC,NC, K_PERC,NC,NC, K_FIVE,NC,NC, 0x1b,0x35,NC, 0x1b,0x4e,0x25},
-{K_SIX,NC,NC, K_CARET,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NC,NC, K_LTHN,NC,NC, K_COMMA,NC,NC, 0x1b,K_COMMA,NC, 0x1b,0x4e,K_LTHN},
+{K_PERIOD,NC,NC,K_GTHN,NC,NC, K_PERIOD,NC,NC,0x1b,K_PERIOD,NC, 0x1b,0x4e,K_GTHN},
+{K_SLASH,NC,NC, K_QUES,NC,NC, K_SLASH,NC,NC, 0x1b,K_SLASH,NC, 0x1b,0x4e,K_QUES},
{K_SCAN,K_RSHSC,NC, K_SCAN,K_RSHSC,NC, K_SCAN,K_RSHSC,NC, K_SCAN,K_RSHSC,NC,
K_SCAN,K_RSHSC,NC},
-{K_ASTER,NC,NC, K_ASTER,NC,NC, K_ASTER,NC,NC, 0x1b,0x4e,0x2a,0x1b,0x4e,0x2a},
+{K_ASTER,NC,NC, K_ASTER,NC,NC, K_ASTER,NC,NC, 0x1b,K_ASTER,NC, 0x1b,0x4e,K_ASTER},
{K_SCAN,K_ALTSC,NC, K_SCAN,K_ALTSC,NC, K_SCAN,K_ALTSC,NC, K_SCAN,K_ALTSC,NC,
K_SCAN,K_ALTSC,NC},
{K_SPACE,NC,NC, K_SPACE,NC,NC, K_NUL,NC,NC, 0x1b,K_SPACE,NC, K_SPACE,NC,NC},
@@ -300,22 +300,22 @@ unsigned char key_map[NUMKEYS][WIDTH_KMAP] = {
{K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC,
K_SCAN,K_NLCKSC,NC, K_SCAN,K_NLCKSC,NC},
{K_SCRL, K_NUL,NC,NC, K_SCRL, K_SCRL, K_NUL,NC,NC},
-{K_HOME, K_SEVEN,NC,NC, K_HOME, K_HOME, 0x1b,0x4e,0x37},
-{K_UA, K_EIGHT,NC,NC, K_UA, K_UA, 0x1b,0x4e,0x38},
-{K_PUP, K_NINE,NC,NC, K_PUP, K_PUP, 0x1b,0x4e,0x39},
+{K_HOME, K_SEVEN,NC,NC, K_HOME, K_HOME, 0x1b,0x4e,K_SEVEN},
+{K_UA, K_EIGHT,NC,NC, K_UA, K_UA, 0x1b,0x4e,K_EIGHT},
+{K_PUP, K_NINE,NC,NC, K_PUP, K_PUP, 0x1b,0x4e,K_NINE},
{0x1b,0x5b,0x53, K_MINUS,NC,NC, 0x1b,0x5b,0x53, 0x1b,0x5b,0x53,
0x1b,0x4e,0x2d},
-{K_LA, K_FOUR,NC,NC, K_LA, K_LA, 0x1b,0x4e,0x34},
+{K_LA, K_FOUR,NC,NC, K_LA, K_LA, 0x1b,0x4e,K_FOUR},
{0x1b,0x5b,0x47, K_FIVE,NC,NC, 0x1b,0x5b,0x47, 0x1b,0x5b,0x47,
0x1b,0x4e,0x35},
-{K_RA, K_SIX,NC,NC, K_RA, K_RA, 0x1b,0x4e,0x36},
+{K_RA, K_SIX,NC,NC, K_RA, K_RA, 0x1b,0x4e,K_SIX},
{0x1b,0x5b,0x54, K_PLUS,NC,NC, 0x1b,0x5b,0x54, 0x1b,0x5b,0x54,
0x1b,0x4e,0x2b},
-{K_END, K_ONE,NC,NC, K_END, K_END, 0x1b,0x4e,0x31},
-{K_DA, K_TWO,NC,NC, K_DA, K_DA, 0x1b,0x4e,0x32},
-{K_PDN, K_THREE,NC,NC, K_PDN, K_PDN, 0x1b,0x4e,0x33},
-{K_INS, K_ZERO,NC,NC, K_INS, K_INS, 0x1b,0x4e,0x30},
-{0x1b,0x5b,0x39, K_PERIOD,NC,NC, K_DEL,NC,NC, K_DEL,NC,NC, 0x1b,0x4e,0x2e},
+{K_END, K_ONE,NC,NC, K_END, K_END, 0x1b,0x4e,K_ONE},
+{K_DA, K_TWO,NC,NC, K_DA, K_DA, 0x1b,0x4e,K_TWO},
+{K_PDN, K_THREE,NC,NC, K_PDN, K_PDN, 0x1b,0x4e,K_THREE},
+{K_INS, K_ZERO,NC,NC, K_INS, K_INS, 0x1b,0x4e,K_ZERO},
+{0x1b,0x5b,0x39, K_PERIOD,NC,NC, K_DEL,NC,NC, K_DEL,NC,NC, 0x1b,0x4e,K_PERIO},
{NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC},
{NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC},
{NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC, NC,NC,NC},
diff --git a/i386/i386at/kd.h b/i386/i386at/kd.h
index 9048ce5..98c8bfe 100644
--- a/i386/i386at/kd.h
+++ b/i386/i386at/kd.h
@@ -238,7 +238,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define CURRENT_COLUMN(pos) (((pos) % ONE_LINE) / ONE_SPACE)
#define NUMKEYS 89
-#define NUMSTATES 5 /* NORMAL_STATE, ... */
+#define NUMSTATES 5 /* NORM_STATE, ... */
#define NUMOUTPUT 3 /* max size of byte seq from key */
#define WIDTH_KMAP (NUMSTATES * NUMOUTPUT)