Преглед на файлове

Corrected issue #1203

pull/1222/head
raysan5 преди 4 години
родител
ревизия
72cc3e0530
променени са 1 файла, в които са добавени 5 реда и са изтрити 14 реда
  1. +5
    -14
      src/core.c

+ 5
- 14
src/core.c Целия файл

@ -5076,20 +5076,11 @@ static void *EventThread(void *arg)
// Make sure we got a valid keycode
if ((keycode > 0) && (keycode < sizeof(CORE.Input.Keyboard.currentKeyState)))
{
/* Disabled buffer !!
// Store the key information for raylib to later use
CORE.Input.Keyboard.currentKeyState[keycode] = event.value;
if (event.value > 0)
{
// Add the key int the fifo
CORE.Input.Keyboard.lastKeyPressed.contents[CORE.Input.Keyboard.lastKeyPressed.head] = keycode; // Put the data at the front of the fifo snake
CORE.Input.Keyboard.lastKeyPressed.head = (CORE.Input.Keyboard.lastKeyPressed.head + 1) & 0x07; // Increment the head pointer forwards and binary wraparound after 7 (fifo is 8 elements long)
// TODO: This fifo is not fully threadsafe with multiple writers, so multiple keyboards hitting a key at the exact same time could miss a key (double write to head before it was incremented)
}
*/
CORE.Input.Keyboard.currentKeyState[keycode] = event.value;
if (event.value == 1)
// WARNING: https://www.kernel.org/doc/Documentation/input/input.txt
// Event interface: 'value' is the value the event carries. Either a relative change for EV_REL,
// absolute new value for EV_ABS (joysticks ...), or 0 for EV_KEY for release, 1 for keypress and 2 for autorepeat
CORE.Input.Keyboard.currentKeyState[keycode] = (event.value >= 1)? 1 : 0;
if (event.value >= 1)
{
CORE.Input.Keyboard.keyPressedQueue[CORE.Input.Keyboard.keyPressedQueueCount] = keycode; // Register last key pressed
CORE.Input.Keyboard.keyPressedQueueCount++;

Зареждане…
Отказ
Запис