aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--inc/cub3d_defines.h6
-rw-r--r--src/ft_key_events.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h
index 21ed9fc..1e25302 100644
--- a/inc/cub3d_defines.h
+++ b/inc/cub3d_defines.h
@@ -69,6 +69,9 @@ enum
# define FT_TAB_KEY 48
# define FT_ESC_KEY 53
/* TODO: macOS return key */
+/* TODO: macOS space key */
+/* TODO: macOS one key */
+/* TODO: macOS two key */
# else
# define FT_W_KEY 119
# define FT_A_KEY 97
@@ -80,6 +83,9 @@ enum
# define FT_F1_KEY 65470
# define FT_ESC_KEY 65307
# define FT_RET_KEY 65293
+# define FT_SPC_KEY 32
+# define FT_ONE_KEY 49
+# define FT_TWO_KEY 50
# endif
/*
diff --git a/src/ft_key_events.c b/src/ft_key_events.c
index 317715d..edacc42 100644
--- a/src/ft_key_events.c
+++ b/src/ft_key_events.c
@@ -36,6 +36,8 @@ int
return (ft_exit(0, (clist)));
else if (keycode == FT_F1_KEY || keycode == FT_TAB_KEY)
return (ft_f1_key(clist));
+ else if (keycode == FT_SPC_KEY && clist->plist.handles_weapon > -1)
+ return (ft_space_key(clist));
ft_insert_key(keycode, clist);
return (0);
}