aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_convert_keycode.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-14 18:55:43 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-14 18:55:43 +0100
commitcaa6cc5bc81278f446d852f73422af36c4c846c5 (patch)
tree58bcdba2ef530c6c1ab423209964b1b4e8877135 /src/ft_convert_keycode.c
parentCan't death hook (diff)
download42-cub3d-caa6cc5bc81278f446d852f73422af36c4c846c5.tar.gz
42-cub3d-caa6cc5bc81278f446d852f73422af36c4c846c5.tar.bz2
42-cub3d-caa6cc5bc81278f446d852f73422af36c4c846c5.tar.xz
42-cub3d-caa6cc5bc81278f446d852f73422af36c4c846c5.tar.zst
42-cub3d-caa6cc5bc81278f446d852f73422af36c4c846c5.zip
Perfect but leaks
Diffstat (limited to '')
-rw-r--r--src/ft_convert_keycode.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/ft_convert_keycode.c b/src/ft_convert_keycode.c
index 5a037c5..899dae9 100644
--- a/src/ft_convert_keycode.c
+++ b/src/ft_convert_keycode.c
@@ -19,17 +19,18 @@ int32_t
uint16_t keycode;
keycode = UINT16_MAX;
- (tmp_code == FT_W_KEY) ? (keycode = 0) : 0;
- (tmp_code == FT_A_KEY) ? (keycode = 1) : 0;
- (tmp_code == FT_S_KEY) ? (keycode = 2) : 0;
- (tmp_code == FT_D_KEY) ? (keycode = 3) : 0;
- (tmp_code == FT_L_ARR_KEY) ? (keycode = 4) : 0;
- (tmp_code == FT_R_ARR_KEY) ? (keycode = 5) : 0;
- (tmp_code == 3) ? (keycode = UINT16_MAX) : 0;
- (tmp_code == 4) ? (keycode = UINT16_MAX) : 0;
- (tmp_code == 5) ? (keycode = UINT16_MAX) : 0;
- (tmp_code == FT_ESC_KEY) ? (keycode = FT_ESC_KEY) : 0;
- (tmp_code == FT_F1_KEY) ? (keycode = FT_F1_KEY) : 0;
- (tmp_code == FT_TAB_KEY) ? (keycode = FT_TAB_KEY) : 0;
+ keycode = (tmp_code == FT_W_KEY) ? (0) : (keycode);
+ keycode = (tmp_code == FT_A_KEY) ? (1) : (keycode);
+ keycode = (tmp_code == FT_S_KEY) ? (2) : (keycode);
+ keycode = (tmp_code == FT_D_KEY) ? (3) : (keycode);
+ keycode = (tmp_code == FT_L_ARR_KEY) ? (4) : (keycode);
+ keycode = (tmp_code == FT_R_ARR_KEY) ? (5) : (keycode);
+ keycode = (tmp_code == 3) ? (UINT16_MAX) : (keycode);
+ keycode = (tmp_code == 4) ? (UINT16_MAX) : (keycode);
+ keycode = (tmp_code == 5) ? (UINT16_MAX) : (keycode);
+ keycode = (tmp_code == FT_ESC_KEY) ? (FT_ESC_KEY) : (keycode);
+ keycode = (tmp_code == FT_F1_KEY) ? (FT_F1_KEY) : (keycode);
+ keycode = (tmp_code == FT_TAB_KEY) ? (FT_TAB_KEY) : (keycode);
+ keycode = (tmp_code == FT_RET_KEY) ? (FT_RET_KEY) : (keycode);
return (keycode);
}