Cub3D
 
Loading...
Searching...
No Matches
ft_keys.h
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_keys.h :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: ppontet <ppontet@student.42lyon.fr> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/01/20 15:59:08 by ppontet #+# #+# */
9/* Updated: 2025/09/27 00:58:16 by ppontet ### ########lyon.fr */
10/* */
11/* ************************************************************************** */
12
13#ifndef FT_KEYS_H
14# define FT_KEYS_H
15
21
22# include <stdbool.h>
23
29
40
44# define KEY_ESCAPE 65307
48# define KEY_ENTER 65293
52# define KEY_SPACE 32
56# define KEY_ARROW_LEFT 65361
60# define KEY_ARROW_UP 65362
64# define KEY_ARROW_RIGHT 65363
68# define KEY_ARROW_DOWN 65364
72# define KEY_A 97
76# define KEY_W 119
80# define KEY_D 100
84# define KEY_S 115
85
89# define KEY_C 99
90
94# define KEY_M 109
95
99# define KEY_F 102
103# define KEY_V 118
107# define KEY_X 120
109
115
124bool is_mv_key(enum e_movement expected, int keycode);
132void set_key(int keycode, t_input *input, bool set);
139void toggle_key(int keycode, t_input *input);
146void change_fov(t_data *data, int keycode);
148
149#endif
struct s_data t_data
Definition data_structure.h:32
struct s_input t_input
Definition data_structure.h:42
void set_key(int keycode, t_input *input, bool set)
Set the input according to the keycode and the set value.
Definition ft_keys.c:18
bool is_mv_key(enum e_movement expected, int keycode)
Check if a keycode is a movement key.
Definition ft_keys.c:59
void toggle_key(int keycode, t_input *input)
Toggle the input according to the keycode.
Definition ft_keys.c:34
void change_fov(t_data *data, int keycode)
Change the FOV according to the keycode.
Definition ft_keys.c:75
e_movement
Structure used to define the type of movement with directions.
Definition ft_keys.h:34
@ MV_RIGHT
Definition ft_keys.h:37
@ MV_UP
Definition ft_keys.h:35
@ MV_LEFT
Definition ft_keys.h:36
@ MV_DOWN
Definition ft_keys.h:38