Browse Source

delete folders who were not linked to 3d

master
milang 10 months ago
parent
commit
d2ce3c3e3a
No known key found for this signature in database GPG Key ID: D287C9D6C33D9035
2 changed files with 0 additions and 60 deletions
  1. +0
    -27
      include/fxengine/event/keyboard.h
  2. +0
    -33
      src/keyboard/keyboard.c

+ 0
- 27
include/fxengine/event/keyboard.h View File

@@ -1,27 +0,0 @@
#ifndef FE_KEYBOARD
#define FE_KEYBOARD

#include <gint/keyboard.h>
#include <gint/keycodes.h>
#include <stdint.h>

/* FE_keyboard: gestion evenementielle du clavier
on peut assigner des callbacks à certains evènements définis dans gint
les arguments envoyés sont le code de la touche en question (event.key)
le type d'evenement (event.type)
void (*callback)(void)
la fonction à exécuter en cas de pression sur une touche
la fonction reload est appelée à la demande de l'utilisateur et appelle tous les callbacks dans l'ordre */

typedef void (*callback)(void);

void event_keyboard_set_key(uint32_t matrix_code, uint32_t ev_type, callback function);

// reload all key events and call callbacks
void event_keyboard_reload();

//void event_keyboard_start();

//void event_keyboard_stop();

#endif

+ 0
- 33
src/keyboard/keyboard.c View File

@@ -1,33 +0,0 @@
#include <fxengine/event/keyboard.h>

static callback callbacks[3][6][10]={0};

static inline uint32_t get_x(const uint32_t matrix_code)
{
return (matrix_code-1) % 0x10;
}

static inline uint32_t get_y(const uint32_t matrix_code)
{
return (matrix_code-1) / 0x10;
}

void FE_keyboard_reload()
{
key_event_t event;
while (1)
{
event=pollevent();
event.type--;
if (event.type==-1)
break;
callback action = callbacks[event.type][get_x(event.key)][get_y(event.key)];
if (action)
action();
}
}

void FE_keyboard_set_key(uint32_t matrix_code, uint32_t ev_type, callback function)
{
callbacks[ev_type-1][get_x(matrix_code)][get_y(matrix_code)]=function;
}

Loading…
Cancel
Save