fix: add missing .h
This commit is contained in:
parent
a9fdae695a
commit
e6587a4d29
3 changed files with 80 additions and 0 deletions
67
src/event.h
Normal file
67
src/event.h
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
#ifndef EVENT_USER
|
||||||
|
#define EVENT_USER
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Structure containing informations about events.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
/*
|
||||||
|
* X00T 00ZZ
|
||||||
|
*
|
||||||
|
* Where:
|
||||||
|
* * X = press (1) or release (0)
|
||||||
|
* * T = keyboard (1) or mouse (0)
|
||||||
|
* * ZZ (only for mouse events) = button
|
||||||
|
* * left (01)
|
||||||
|
* * right (10)
|
||||||
|
* * middle (11)
|
||||||
|
*/
|
||||||
|
unsigned char infos;
|
||||||
|
/* Key pressed (not use if mouse event) */
|
||||||
|
unsigned char key;
|
||||||
|
/* X coordinate of click (not use if keyboard event) */
|
||||||
|
signed short x;
|
||||||
|
/* Y coordinate of click (not use if keyboard event) */
|
||||||
|
signed short y;
|
||||||
|
} event;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
LEFT = 0x01,
|
||||||
|
RIGHT = 0x10,
|
||||||
|
MIDDLE = 0x11
|
||||||
|
} mouse_button;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create a new event, the caller must free it after use.
|
||||||
|
*/
|
||||||
|
event * new_event();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Put all fields at 0.
|
||||||
|
*/
|
||||||
|
void reset(event *event);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Init a basic event and set if the key/button is pressed or not.
|
||||||
|
*/
|
||||||
|
void init_event(event *event, char is_pressed);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Init a mouse event and set if the button is pressed or not.
|
||||||
|
* The caller must indicate coordonates.
|
||||||
|
*/
|
||||||
|
void mouse_event(event *event, mouse_button button);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Init a mouse event and set if the button is pressed or not.
|
||||||
|
* It sets also the coordinates.
|
||||||
|
*/
|
||||||
|
void mouse_event_coord(event *event, mouse_button button, signed short x,
|
||||||
|
signed short y);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Init a keyboard event and set if the key is pressed or not.
|
||||||
|
*/
|
||||||
|
void kb_event(event *event, char key, char is_pressed);
|
||||||
|
#endif
|
9
src/read_events.h
Normal file
9
src/read_events.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef READ_EVENTS
|
||||||
|
#define READ_EVENTS
|
||||||
|
#include "event.h"
|
||||||
|
|
||||||
|
void write_event(event *new_event, FILE *file);
|
||||||
|
|
||||||
|
/* Just listen the input and write them in the parameter file. */
|
||||||
|
int listen(FILE *file);
|
||||||
|
#endif
|
4
src/read_file.h
Normal file
4
src/read_file.h
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#ifndef READ_FILE
|
||||||
|
#define READ_FILE
|
||||||
|
void readfile(FILE *file);
|
||||||
|
#endif
|
Loading…
Reference in a new issue