Cub3D
 
Loading...
Searching...
No Matches
Key functions

All the functions used to manage key inputs. More...

Functions

bool is_mv_key (enum e_movement expected, int keycode)
 Check if a keycode is a movement key.
 
void set_key (int keycode, t_input *input, bool set)
 Set the input according to the keycode and the set value.
 
void toggle_key (int keycode, t_input *input)
 Toggle the input according to the keycode.
 
void change_fov (t_data *data, int keycode)
 Change the FOV according to the keycode.
 

Detailed Description

All the functions used to manage key inputs.

Function Documentation

◆ change_fov()

void change_fov ( t_data * data,
int keycode )

Change the FOV according to the keycode.

Parameters
[in,out]datadata structure
[in]keycodekey pressed

◆ is_mv_key()

bool is_mv_key ( enum e_movement expected,
int keycode )

Check if a keycode is a movement key.

Parameters
[in]expectedexpected key
[in]keycodekey pressed
Returns
true is_mv_key
false isn't

◆ set_key()

void set_key ( int keycode,
t_input * input,
bool set )

Set the input according to the keycode and the set value.

Parameters
[in]keycodekey pressed
[out]inputstructure containing all inputs
[in]setvalue to set

◆ toggle_key()

void toggle_key ( int keycode,
t_input * input )

Toggle the input according to the keycode.

Parameters
[in]keycodekey pressed
[out]inputstructure containing all inputs