[General Questions and Answers] mr.100percent:
After some Work i finally finished my keymap and keychar files for my elive KB250 Micro keyboard (see Amazon for pictures). There are some pitfalls in making these files which nobody mentions so i want to write my experiences.

The first File which gets parsed is the .kl File, the Keyboard Layout which maps the scancodes to Android keycodes. Problem is it is not clear which keycodes Android understands. Here's a list:

static const KeycodeLabel KEYCODES[] = {

{ "SOFT_LEFT", 1 },

{ "SOFT_RIGHT", 2 },

{ "HOME", 3 },

{ "BACK", 4 },

{ "CALL", 5 },

{ "ENDCALL", 6 },

{ "0", 7 },

{ "1", 8 },

{ "2", 9 },

{ "3", 10 },

{ "4", 11 },

{ "5", 12 },

{ "6", 13 },

{ "7", 14 },

{ "8", 15 },

{ "9", 16 },

{ "STAR", 17 },

{ "POUND", 18 },

{ "DPAD_UP", 19 },

{ "DPAD_DOWN", 20 },

{ "DPAD_LEFT", 21 },

{ "DPAD_RIGHT", 22 },

{ "DPAD_CENTER", 23 },

{ "VOLUME_UP", 24 },

{ "VOLUME_DOWN", 25 },

{ "POWER", 26 },

{ "CAMERA", 27 },

{ "CLEAR", 28 },

{ "A", 29 },

{ "B", 30 },

{ "C", 31 },

{ "D", 32 },

{ "E", 33 },

{ "F", 34 },

{ "G", 35 },

{ "H", 36 },

{ "I", 37 },

{ "J", 38 },

{ "K", 39 },

{ "L", 40 },

{ "M", 41 },

{ "N", 42 },

{ "O", 43 },

{ "P", 44 },

{ "Q", 45 },

{ "R", 46 },

{ "S", 47 },

{ "T", 48 },

{ "U", 49 },

{ "V", 50 },

{ "W", 51 },

{ "X", 52 },

{ "Y", 53 },

{ "Z", 54 },

{ "COMMA", 55 },

{ "PERIOD", 56 },

{ "ALT_LEFT", 57 },

{ "ALT_RIGHT", 58 },

{ "SHIFT_LEFT", 59 },

{ "SHIFT_RIGHT", 60 },

{ "TAB", 61 },

{ "SPACE", 62 },

{ "SYM", 63 },

{ "EXPLORER", 64 },

{ "ENVELOPE", 65 },

{ "ENTER", 66 },

{ "DEL", 67 },

{ "GRAVE", 68 },

{ "MINUS", 69 },

{ "EQUALS", 70 },

{ "LEFT_BRACKET", 71 },

{ "RIGHT_BRACKET", 72 },

{ "BACKSLASH", 73 },

{ "SEMICOLON", 74 },

{ "APOSTROPHE", 75 },

{ "SLASH", 76 },

{ "AT", 77 },

{ "NUM", 78 },

{ "HEADSETHOOK", 79 },

{ "FOCUS", 80 },

{ "PLUS", 81 },

{ "MENU", 82 },

{ "NOTIFICATION", 83 },

{ "SEARCH", 84 },

{ "MEDIA_PLAY_PAUSE", 85 },

{ "MEDIA_STOP", 86 },

{ "MEDIA_NEXT", 87 },

{ "MEDIA_PREVIOUS", 88 },

{ "MEDIA_REWIND", 89 },

{ "MEDIA_FAST_FORWARD", 90 },

{ "MUTE", 91 },

{ "PAGE_UP", 92 },

{ "PAGE_DOWN", 93 },

{ "PICTSYMBOLS", 94 },

{ "SWITCH_CHARSET", 95 },

{ "BUTTON_A", 96 },

{ "BUTTON_B", 97 },

{ "BUTTON_C", 98 },

{ "BUTTON_X", 99 },

{ "BUTTON_Y", 100 },

{ "BUTTON_Z", 101 },

{ "BUTTON_L1", 102 },

{ "BUTTON_R1", 103 },

{ "BUTTON_L2", 104 },

{ "BUTTON_R2", 105 },

{ "BUTTON_THUMBL", 106 },

{ "BUTTON_THUMBR", 107 },

{ "BUTTON_START", 108 },

{ "BUTTON_SELECT", 109 },

{ "BUTTON_MODE", 110 },

#if defined(VISION_KEYPAD)

{ "USER1", 92 },

{ "USER2", 93 },

{ "USER3", 94 },

{ "USER4", 95 },

{ "USER5", 96 },

{ "FUNC_1", 97 },

{ "FUNC_2", 98 },

{ "FUNC_3", 99 },

{ "FUNC_4", 100 },

{ "FUNC_5", 101 },

{ "FUNC_6", 102 },

{ "FUNC_7", 103 },

{ "FUNC_8", 104 },

{ "QUECHAR", 105 },

#elif defined(LATTE_KEYPAD)

{ "FUNC_1", 92 },

{ "FUNC_2", 93 },

{ "FUNC_3", 94 },

{ "FUNC_4", 95 },

{ "FUNC_5", 96 },

{ "FUNC_6", 97 },

{ "FUNC_7", 98 },

{ "FUNC_8", 99 },

{ "QUECHAR", 100 },

#endif

// NOTE: If you add a new keycode here you must also add it to several other files.

// Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.

{ NULL, 0 }

};

If you write a keycode in this file which won't be understood, android stops parsing the file and everything after the error wont be parsed. So it is a really good idea to put all the stuff which is unclear at the END of the file.

After that android maps the keycodes AND the modifier (Shift, ALT) with the .kcm.bin to the actual character. The Problem here is the keycodes MUST be increasing and it is difficult to edit. I wrote two MATLAB Scripts for this purpose, one converts the binary to text format and the other one converts it back to binary. After that i found the kcm_utils_v2 on this site which is fine too but many special characters won't get recognized so the hexcode is necsessary.

Hope somebody can use them.