fix: input *
Now it never misses any press on a key
This commit is contained in:
parent
a7e8cdc0c1
commit
45622cf647
5 changed files with 58 additions and 31 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 15:26:13 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/03/28 12:50:14 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/03/29 18:27:02 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -28,11 +28,7 @@ typedef struct s_env
|
|||
void *mlx;
|
||||
void *win;
|
||||
t_room room;
|
||||
|
||||
bool up;
|
||||
bool down;
|
||||
bool left;
|
||||
bool right;
|
||||
bool input[4];
|
||||
} t_env;
|
||||
|
||||
extern t_env g_env;
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/26 12:16:32 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/03/26 13:26:27 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/03/29 18:32:38 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef INPUT_H
|
||||
# define INPUT_H
|
||||
|
||||
void input_init(void);
|
||||
int key_press_hook(int keycode);
|
||||
int key_release_hook(int keycode);
|
||||
void input_loop(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue