From 38ab4fa52ebd318f9f38d469603e5cee8c0f43c9 Mon Sep 17 00:00:00 2001 From: Nathalia Vitoria Buchholz Date: Thu, 20 Feb 2025 01:48:08 -0300 Subject: [PATCH] refactor[utils.c]: key and mouse event handling --- src/utils.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/utils.c b/src/utils.c index e69de29..d1cb9b1 100644 --- a/src/utils.c +++ b/src/utils.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* utils.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: nbuchhol +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* 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); +}