1
0
Fork 0

unicode working, i think

This commit is contained in:
Jack Humbert 2015-09-14 23:54:49 -04:00
parent 5bb7ef0012
commit 6ec03b2218
6 changed files with 383 additions and 2 deletions

View file

@ -28,6 +28,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static action_t keycode_to_action(uint16_t keycode);
uint16_t hextokeycode(int hex) {
if (hex == 0x0) {
return KC_0;
} else if (hex < 0xA) {
return KC_1 + (hex - 0x1);
} else {
return KC_A + (hex - 0xA);
}
}
/* converts key to action */
action_t action_for_key(uint8_t layer, keypos_t key)
{
@ -78,6 +88,11 @@ action_t action_for_key(uint8_t layer, keypos_t key)
action_t action;
action.code = ACTION_FUNCTION_OPT(keycode & 0xFF, (keycode & 0x0F00) >> 8);
return action;
} else if (keycode >= 0x8000 && keycode < 0x9000) {
action_t action;
uint16_t unicode = keycode & ~(0x8000);
action.code = ACTION_FUNCTION_OPT(unicode & 0xFF, (unicode & 0xFF00) >> 8);
return action;
}
switch (keycode) {