Index: kernel/genarch/src/kbrd/scanc_sun.c
===================================================================
--- kernel/genarch/src/kbrd/scanc_sun.c	(revision 411b6a6f0339f865eaac5f492f2277fdfbbd5fcc)
+++ kernel/genarch/src/kbrd/scanc_sun.c	(revision f049eec2e8912b45680161e172155481212b2b38)
@@ -27,46 +27,48 @@
  */
 
-/** @addtogroup genarch	
+/** @addtogroup genarch
  * @{
  */
 /**
  * @file
- * @brief	Scan codes for Sun keyboards.
+ * @brief Scan codes for Sun keyboards.
  */
 
 #include <genarch/kbrd/scanc.h>
+#include <typedefs.h>
+#include <string.h>
 
 /** Primary meaning of scancodes. */
-char sc_primary_map[] = {
-	[0x00] = SPECIAL,
-	[0x01] = SPECIAL,
-	[0x02] = SPECIAL,
-	[0x03] = SPECIAL,
-	[0x04] = SPECIAL,
-	[0x05] = SPECIAL,	/* F1 */
-	[0x06] = SPECIAL,	/* F2 */
-	[0x07] = SPECIAL,	/* F10 */
-	[0x08] = SPECIAL,	/* F3 */
-	[0x09] = SPECIAL,	/* F11 */
-	[0x0a] = SPECIAL,	/* F4 */
-	[0x0b] = SPECIAL,	/* F12 */
-	[0x0c] = SPECIAL,	/* F5 */
-	[0x0d] = SPECIAL,	/* RAlt */
-	[0x0e] = SPECIAL,	/* F6 */
-	[0x0f] = SPECIAL,
-	[0x10] = SPECIAL,	/* F7 */
-	[0x11] = SPECIAL,	/* F8 */
-	[0x12] = SPECIAL,	/* F9 */
-	[0x13] = SPECIAL,	/* LAlt */
-	[0x14] = SPECIAL,	/* Up Arrow */
-	[0x15] = SPECIAL,	/* Pause */
-	[0x16] = SPECIAL,
-	[0x17] = SPECIAL,	/* Scroll Lock */
-	[0x18] = SPECIAL,	/* Left Arrow */
-	[0x19] = SPECIAL,
-	[0x1a] = SPECIAL,
-	[0x1b] = SPECIAL,	/* Down Arrow */
-	[0x1c] = SPECIAL,	/* Right Arrow */
-	[0x1d] = SPECIAL,	/* Esc */
+wchar_t sc_primary_map[SCANCODES] = {
+	[0x00] = U_SPECIAL,
+	[0x01] = U_SPECIAL,
+	[0x02] = U_SPECIAL,
+	[0x03] = U_SPECIAL,
+	[0x04] = U_SPECIAL,
+	[0x05] = U_SPECIAL,      /* F1 */
+	[0x06] = U_SPECIAL,      /* F2 */
+	[0x07] = U_SPECIAL,      /* F10 */
+	[0x08] = U_SPECIAL,      /* F3 */
+	[0x09] = U_SPECIAL,      /* F11 */
+	[0x0a] = U_SPECIAL,      /* F4 */
+	[0x0b] = U_SPECIAL,      /* F12 */
+	[0x0c] = U_SPECIAL,      /* F5 */
+	[0x0d] = U_SPECIAL,      /* Right Alt */
+	[0x0e] = U_SPECIAL,      /* F6 */
+	[0x0f] = U_SPECIAL,
+	[0x10] = U_SPECIAL,      /* F7 */
+	[0x11] = U_SPECIAL,      /* F8 */
+	[0x12] = U_SPECIAL,      /* F9 */
+	[0x13] = U_SPECIAL,      /* Left Alt */
+	[0x14] = U_UP_ARROW,     /* Up Arrow */
+	[0x15] = U_SPECIAL,      /* Pause */
+	[0x16] = U_SPECIAL,
+	[0x17] = U_SPECIAL,      /* Scroll Lock */
+	[0x18] = U_LEFT_ARROW,   /* Left Arrow */
+	[0x19] = U_SPECIAL,
+	[0x1a] = U_SPECIAL,
+	[0x1b] = U_DOWN_ARROW,   /* Down Arrow */
+	[0x1c] = U_RIGHT_ARROW,  /* Right Arrow */
+	[0x1d] = U_ESCAPE,       /* Esc */
 	[0x1e] = '1',
 	[0x1f] = '2',
@@ -82,15 +84,15 @@
 	[0x29] = '=',
 	[0x2a] = '`',
-	[0x2b] = '\b',		/* Backspace */
-	[0x2c] = SPECIAL,	/* Insert */
-	[0x2d] = SPECIAL,
-	[0x2e] = '/',		/* numeric keypad */
-	[0x2f] = '*',		/* numeric keypad */
-	[0x30] = SPECIAL,
-	[0x31] = SPECIAL,
-	[0x32] = '.',		/* numeric keypad */
-	[0x33] = SPECIAL,
-	[0x34] = SPECIAL,	/* Home */
-	[0x35] = '\t',		/* Tab */
+	[0x2b] = '\b',           /* Backspace */
+	[0x2c] = U_SPECIAL,      /* Insert */
+	[0x2d] = U_SPECIAL,
+	[0x2e] = '/',            /* Numpad / */
+	[0x2f] = '*',            /* Numpad * */
+	[0x30] = U_SPECIAL,
+	[0x31] = U_SPECIAL,
+	[0x32] = '.',            /* Numpad . */
+	[0x33] = U_SPECIAL,
+	[0x34] = U_HOME_ARROW,   /* Home */
+	[0x35] = '\t',           /* Tab */
 	[0x36] = 'q',
 	[0x37] = 'w',
@@ -105,15 +107,15 @@
 	[0x40] = '[',
 	[0x41] = ']',
-	[0x42] = SPECIAL,	/* Del */
-	[0x43] = SPECIAL,
-	[0x44] = '7',		/* numeric keypad */
-	[0x45] = '8',		/* numeric keypad */
-	[0x46] = '9',		/* numeric keypad */
-	[0x47] = '-',		/* numeric keypad */
-	[0x48] = SPECIAL,
-	[0x49] = SPECIAL,
-	[0x4a] = SPECIAL,	/* End */
-	[0x4b] = SPECIAL,
-	[0x4c] = SPECIAL,	/* Control */
+	[0x42] = U_DELETE,       /* Delete */
+	[0x43] = U_SPECIAL,
+	[0x44] = '7',            /* Numpad 7 */
+	[0x45] = '8',            /* Numpad 8 */
+	[0x46] = '9',            /* Numpad 9 */
+	[0x47] = '-',            /* Numpad - */
+	[0x48] = U_SPECIAL,
+	[0x49] = U_SPECIAL,
+	[0x4a] = U_END_ARROW,    /* End */
+	[0x4b] = U_SPECIAL,
+	[0x4c] = U_SPECIAL,      /* Control */
 	[0x4d] = 'a',
 	[0x4e] = 's',
@@ -128,15 +130,15 @@
 	[0x57] = '\'',
 	[0x58] = '\\',
-	[0x59] = '\n',		/* Enter */
-	[0x5a] = '\n',		/* Enter on numeric keypad */
-	[0x5b] = '4',		/* numeric keypad */
-	[0x5c] = '5',		/* numeric keypad */
-	[0x5d] = '6',		/* numeric keypad */
-	[0x5e] = '0',		/* numeric keypad */
-	[0x5f] = SPECIAL,
-	[0x60] = SPECIAL,	/* Page Up */
-	[0x61] = SPECIAL,
-	[0x62] = SPECIAL,	/* Num Lock */
-	[0x63] = SPECIAL,	/* LShift */
+	[0x59] = '\n',           /* Enter */
+	[0x5a] = '\n',           /* Numpad Enter */
+	[0x5b] = '4',            /* Numpad 4 */
+	[0x5c] = '5',            /* Numpad 5 */
+	[0x5d] = '6',            /* Numpad 6 */
+	[0x5e] = '0',            /* Numpad 0 */
+	[0x5f] = U_SPECIAL,
+	[0x60] = U_PAGE_UP,      /* Page Up */
+	[0x61] = U_SPECIAL,
+	[0x62] = U_SPECIAL,      /* NumLock */
+	[0x63] = U_SPECIAL,      /* Left Shift */
 	[0x64] = 'z',
 	[0x65] = 'x',
@@ -149,56 +151,56 @@
 	[0x6c] = '.',
 	[0x6d] = '/',
-	[0x6e] = SPECIAL,	/* RShift */
-	[0x6f] = SPECIAL,
-	[0x70] = '1',		/* numeric keypad */
-	[0x71] = '2',		/* numeric keypad */
-	[0x72] = '3',		/* numeric keypad */
-	[0x73] = SPECIAL,
-	[0x74] = SPECIAL,
-	[0x75] = SPECIAL,
-	[0x76] = SPECIAL,
-	[0x77] = SPECIAL,	/* Caps Lock */
-	[0x78] = SPECIAL,
+	[0x6e] = U_SPECIAL,      /* Right Shift */
+	[0x6f] = U_SPECIAL,
+	[0x70] = '1',            /* Numpad 1 */
+	[0x71] = '2',            /* Numpad 2 */
+	[0x72] = '3',            /* Numpad 3 */
+	[0x73] = U_SPECIAL,
+	[0x74] = U_SPECIAL,
+	[0x75] = U_SPECIAL,
+	[0x76] = U_SPECIAL,
+	[0x77] = U_SPECIAL,      /* CapsLock */
+	[0x78] = U_SPECIAL,
 	[0x79] = ' ',
-	[0x7a] = SPECIAL,
-	[0x7b] = SPECIAL,	/* Page Down */
-	[0x7c] = SPECIAL,
-	[0x7d] = '+',		/* numeric key pad */
-	[0x7e] = SPECIAL,
-	[0x7f] = SPECIAL
+	[0x7a] = U_SPECIAL,
+	[0x7b] = U_PAGE_DOWN,    /* Page Down */
+	[0x7c] = U_SPECIAL,
+	[0x7d] = '+',            /* Numpad + */
+	[0x7e] = U_SPECIAL,
+	[0x7f] = U_SPECIAL
 };
 
 /** Secondary meaning of scancodes. */
-char sc_secondary_map[] = {
-	[0x00] = SPECIAL,
-	[0x01] = SPECIAL,
-	[0x02] = SPECIAL,
-	[0x03] = SPECIAL,
-	[0x04] = SPECIAL,
-	[0x05] = SPECIAL,	/* F1 */
-	[0x06] = SPECIAL,	/* F2 */
-	[0x07] = SPECIAL,	/* F10 */
-	[0x08] = SPECIAL,	/* F3 */
-	[0x09] = SPECIAL,	/* F11 */
-	[0x0a] = SPECIAL,	/* F4 */
-	[0x0b] = SPECIAL,	/* F12 */
-	[0x0c] = SPECIAL,	/* F5 */
-	[0x0d] = SPECIAL,	/* RAlt */
-	[0x0e] = SPECIAL,	/* F6 */
-	[0x0f] = SPECIAL,
-	[0x10] = SPECIAL,	/* F7 */
-	[0x11] = SPECIAL,	/* F8 */
-	[0x12] = SPECIAL,	/* F9 */
-	[0x13] = SPECIAL,	/* LAlt */
-	[0x14] = SPECIAL,	/* Up Arrow */
-	[0x15] = SPECIAL,	/* Pause */
-	[0x16] = SPECIAL,
-	[0x17] = SPECIAL,	/* Scroll Lock */
-	[0x18] = SPECIAL,	/* Left Arrow */
-	[0x19] = SPECIAL,
-	[0x1a] = SPECIAL,
-	[0x1b] = SPECIAL,	/* Down Arrow */
-	[0x1c] = SPECIAL,	/* Right Arrow */
-	[0x1d] = SPECIAL,	/* Esc */
+wchar_t sc_secondary_map[SCANCODES] = {
+	[0x00] = U_SPECIAL,
+	[0x01] = U_SPECIAL,
+	[0x02] = U_SPECIAL,
+	[0x03] = U_SPECIAL,
+	[0x04] = U_SPECIAL,
+	[0x05] = U_SPECIAL,      /* F1 */
+	[0x06] = U_SPECIAL,      /* F2 */
+	[0x07] = U_SPECIAL,      /* F10 */
+	[0x08] = U_SPECIAL,      /* F3 */
+	[0x09] = U_SPECIAL,      /* F11 */
+	[0x0a] = U_SPECIAL,      /* F4 */
+	[0x0b] = U_SPECIAL,      /* F12 */
+	[0x0c] = U_SPECIAL,      /* F5 */
+	[0x0d] = U_SPECIAL,      /* Right Alt */
+	[0x0e] = U_SPECIAL,      /* F6 */
+	[0x0f] = U_SPECIAL,
+	[0x10] = U_SPECIAL,      /* F7 */
+	[0x11] = U_SPECIAL,      /* F8 */
+	[0x12] = U_SPECIAL,      /* F9 */
+	[0x13] = U_SPECIAL,      /* Left Alt */
+	[0x14] = U_UP_ARROW,     /* Up Arrow */
+	[0x15] = U_SPECIAL,      /* Pause */
+	[0x16] = U_SPECIAL,
+	[0x17] = U_SPECIAL,      /* Scroll Lock */
+	[0x18] = U_LEFT_ARROW,   /* Left Arrow */
+	[0x19] = U_SPECIAL,
+	[0x1a] = U_SPECIAL,
+	[0x1b] = U_DOWN_ARROW,   /* Down Arrow */
+	[0x1c] = U_RIGHT_ARROW,  /* Right Arrow */
+	[0x1d] = U_ESCAPE,       /* Esc */
 	[0x1e] = '!',
 	[0x1f] = '@',
@@ -214,15 +216,15 @@
 	[0x29] = '+',
 	[0x2a] = '~',
-	[0x2b] = SPECIAL,	/* Backspace */
-	[0x2c] = SPECIAL,	/* Insert */
-	[0x2d] = SPECIAL,
-	[0x2e] = '/',		/* numeric keypad */
-	[0x2f] = '*',		/* numeric keypad */
-	[0x30] = SPECIAL,
-	[0x31] = SPECIAL,
-	[0x32] = '.',		/* numeric keypad */
-	[0x33] = SPECIAL,
-	[0x34] = SPECIAL,	/* Home */
-	[0x35] = SPECIAL,	/* Tab */
+	[0x2b] = '\b',           /* Backspace */
+	[0x2c] = U_SPECIAL,      /* Insert */
+	[0x2d] = U_SPECIAL,
+	[0x2e] = '/',            /* Numpad / */
+	[0x2f] = '*',            /* Numpad * */
+	[0x30] = U_SPECIAL,
+	[0x31] = U_SPECIAL,
+	[0x32] = '.',            /* Numpad . */
+	[0x33] = U_SPECIAL,
+	[0x34] = U_HOME_ARROW,   /* Home */
+	[0x35] = '\t',           /* Tab */
 	[0x36] = 'Q',
 	[0x37] = 'W',
@@ -237,15 +239,15 @@
 	[0x40] = '{',
 	[0x41] = '}',
-	[0x42] = SPECIAL,	/* Del */
-	[0x43] = SPECIAL,
-	[0x44] = '7',		/* numeric keypad */
-	[0x45] = '8',		/* numeric keypad */
-	[0x46] = '9',		/* numeric keypad */
-	[0x47] = '-',		/* numeric keypad */
-	[0x48] = SPECIAL,
-	[0x49] = SPECIAL,
-	[0x4a] = SPECIAL,	/* End */
-	[0x4b] = SPECIAL,
-	[0x4c] = SPECIAL,	/* Control */
+	[0x42] = U_DELETE,       /* Delete */
+	[0x43] = U_SPECIAL,
+	[0x44] = '7',            /* Numpad 7 */
+	[0x45] = '8',            /* Numpad 8 */
+	[0x46] = '9',            /* Numpad 9 */
+	[0x47] = '-',            /* Numpad - */
+	[0x48] = U_SPECIAL,
+	[0x49] = U_SPECIAL,
+	[0x4a] = U_END_ARROW,    /* End */
+	[0x4b] = U_SPECIAL,
+	[0x4c] = U_SPECIAL,      /* Control */
 	[0x4d] = 'A',
 	[0x4e] = 'S',
@@ -260,15 +262,15 @@
 	[0x57] = '"',
 	[0x58] = '|',
-	[0x59] = SPECIAL,	/* Enter */
-	[0x5a] = SPECIAL,	/* Enter on numeric keypad */
-	[0x5b] = '4',		/* numeric keypad */
-	[0x5c] = '5',		/* numeric keypad */
-	[0x5d] = '6',		/* numeric keypad */
-	[0x5e] = '0',		/* numeric keypad */
-	[0x5f] = SPECIAL,
-	[0x60] = SPECIAL,	/* Page Up */
-	[0x61] = SPECIAL,
-	[0x62] = SPECIAL,	/* Num Lock */
-	[0x63] = SPECIAL,	/* LShift */
+	[0x59] = '\n',           /* Enter */
+	[0x5a] = '\n',           /* Numpad Enter */
+	[0x5b] = '4',            /* Numpad 4 */
+	[0x5c] = '5',            /* Numpad 5 */
+	[0x5d] = '6',            /* Numpad 6 */
+	[0x5e] = '0',            /* Numpad 0 */
+	[0x5f] = U_SPECIAL,
+	[0x60] = U_PAGE_UP,      /* Page Up */
+	[0x61] = U_SPECIAL,
+	[0x62] = U_SPECIAL,      /* NumLock */
+	[0x63] = U_SPECIAL,      /* Left Shift */
 	[0x64] = 'Z',
 	[0x65] = 'X',
@@ -281,22 +283,22 @@
 	[0x6c] = '>',
 	[0x6d] = '?',
-	[0x6e] = SPECIAL,	/* RShift */
-	[0x6f] = SPECIAL,
-	[0x70] = '1',		/* numeric keypad */
-	[0x71] = '2',		/* numeric keypad */
-	[0x72] = '3',		/* numeric keypad */
-	[0x73] = SPECIAL,
-	[0x74] = SPECIAL,
-	[0x75] = SPECIAL,
-	[0x76] = SPECIAL,
-	[0x77] = SPECIAL,	/* Caps Lock */
-	[0x78] = SPECIAL,
+	[0x6e] = U_SPECIAL,      /* Right Shift */
+	[0x6f] = U_SPECIAL,
+	[0x70] = '1',            /* Numpad 1 */
+	[0x71] = '2',            /* Numpad 2 */
+	[0x72] = '3',            /* Numpad 3 */
+	[0x73] = U_SPECIAL,
+	[0x74] = U_SPECIAL,
+	[0x75] = U_SPECIAL,
+	[0x76] = U_SPECIAL,
+	[0x77] = U_SPECIAL,      /* CapsLock */
+	[0x78] = U_SPECIAL,
 	[0x79] = ' ',
-	[0x7a] = SPECIAL,
-	[0x7b] = SPECIAL,	/* Page Down */
-	[0x7c] = SPECIAL,
-	[0x7d] = '+',		/* numeric key pad */
-	[0x7e] = SPECIAL,
-	[0x7f] = SPECIAL
+	[0x7a] = U_SPECIAL,
+	[0x7b] = U_PAGE_DOWN,    /* Page Down */
+	[0x7c] = U_SPECIAL,
+	[0x7d] = '+',            /* Numpad + */
+	[0x7e] = U_SPECIAL,
+	[0x7f] = U_SPECIAL
 };
 
