From b0ade6dc9838d4112cbc3093ac3033aa81ef172d Mon Sep 17 00:00:00 2001 From: coderkun Date: Wed, 28 Dec 2016 20:08:45 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20return=20value=20of=20hex=5Fto=5Fkeycode(?= =?UTF-8?q?)=20function=20in=20keymap=20=E2=80=9Ccoderkun=5Fneo2=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyboards/ergodox/keymaps/coderkun_neo2/keymap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c index b62b14449fc..9b33bbd6d01 100644 --- a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c +++ b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c @@ -294,11 +294,10 @@ void unicode_input_start (void) { // Override method to use NEO_A instead of KC_A uint16_t hex_to_keycode(uint8_t hex) { - if (hex == 0x0) { + if(hex == 0x0) { return KC_0; - } else if (hex < 0xA) { - return KC_1 + (hex - 0x1); - } else { + } + else if(hex >= 0xA) { switch(hex) { case 0xA: return NEO_A; @@ -314,4 +313,6 @@ uint16_t hex_to_keycode(uint8_t hex) return NEO_F; } } + + return KC_1 + (hex - 0x1); }