Skip to content

Commit

Permalink
refactor[utils.c]: key and mouse event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathalia Vitoria Buchholz committed Feb 20, 2025
1 parent db2c01d commit 38ab4fa
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/utils.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nbuchhol <nbuchhol@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/20 00:45:00 by nbuchhol #+# #+# */
/* Updated: 2025/02/20 01:32:55 by nbuchhol ### ########.fr */
/* */
/* ************************************************************************** */

#include "../includes/so_long.h"

int key_handle(int keycode)
{
if (keycode == 65307)
exit(0);
return (0);
}

int mouse_handle(t_classMlx *mlx)
{
mlx_destroy_window(mlx->mlx, mlx->win);
exit(0);
return (0);
}

0 comments on commit 38ab4fa

Please sign in to comment.