From f24fd14814addbead14f108439bb38a5e75f95e9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 18 Jan 2016 12:05:10 +0100 Subject: [PATCH] Note on RPI inputs --- src/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core.c b/src/core.c index 6314941b..7b7d65fc 100644 --- a/src/core.c +++ b/src/core.c @@ -1963,7 +1963,7 @@ static void PollInputEvents(void) int key = keysBuffer[i]; - if (keyboardMode == 2) + if (keyboardMode == 2) // scancodes { // NOTE: If (key == 0x1b), depending on next key, it could be a special keymap code! // Up -> 1b 5b 41 / Left -> 1b 5b 44 / Right -> 1b 5b 43 / Down -> 1b 5b 42 @@ -1998,9 +1998,13 @@ static void PollInputEvents(void) // Detect ESC to stop program if ((key == 0x1b) && (numKeysBuffer == 1)) windowShouldClose = true; } - else if (keyboardMode == 1) + else if (keyboardMode == 1) // keycodes (K_MEDIUMRAW mode) { TraceLog(DEBUG, "Pressed key (keycode): 0x%02x", key); + + // NOTE: Each key is 7-bits (high bit in the byte is 0 for down, 1 for up) + + // TODO: Review (or rewrite) this code... not clear... replace by events! int asciiKey = -1;