aboutsummaryrefslogtreecommitdiff
path: root/minilibx/mlx_int_param_event.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-08 22:53:57 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-08 22:53:57 +0100
commitfafabad0906ff9641b0c6183fda8b07745579dfb (patch)
tree64e57f2b72b3986aa3869924567ce459a1da5433 /minilibx/mlx_int_param_event.c
parentf52b4ad77158b52fad161e98e116059ac5b68d3d (diff)
downloadcub3d-linux.tar.gz
cub3d-linux.tar.bz2
cub3d-linux.zip
Linux versionlinux
Diffstat (limited to 'minilibx/mlx_int_param_event.c')
-rwxr-xr-xminilibx/mlx_int_param_event.c100
1 files changed, 100 insertions, 0 deletions
diff --git a/minilibx/mlx_int_param_event.c b/minilibx/mlx_int_param_event.c
new file mode 100755
index 0000000..37f27e6
--- /dev/null
+++ b/minilibx/mlx_int_param_event.c
@@ -0,0 +1,100 @@
+/*
+** mlx_int_param_event.c for MinilibX in
+**
+** Made by Charlie Root
+** Login <ol@epitech.net>
+**
+** Started on Mon Jul 31 16:37:50 2000 Charlie Root
+** Last update Wed Oct 6 13:14:52 2004 Olivier Crouzet
+*/
+
+#include "mlx_int.h"
+
+int mlx_int_param_undef()
+{
+}
+
+int mlx_int_param_KeyPress(t_xvar *xvar, XEvent *ev, t_win_list *win)
+{
+ win->hooks[KeyPress].hook(XkbKeycodeToKeysym(xvar->display,
+ ev->xkey.keycode, 0, 0),
+ win->hooks[KeyPress].param);
+}
+
+int mlx_int_param_KeyRelease(t_xvar *xvar, XEvent *ev, t_win_list *win)
+{
+ win->hooks[KeyRelease].hook(XkbKeycodeToKeysym(xvar->display,
+ ev->xkey.keycode, 0, 0),
+ win->hooks[KeyRelease].param);
+}
+
+int mlx_int_param_ButtonPress(t_xvar *xvar, XEvent *ev, t_win_list *win)
+{
+ win->hooks[ButtonPress].hook(ev->xbutton.button,ev->xbutton.x,ev->xbutton.y,
+ win->hooks[ButtonPress].param);
+}
+
+int mlx_int_param_ButtonRelease(t_xvar *xvar, XEvent *ev, t_win_list *win)
+{
+ win->hooks[ButtonRelease].hook(ev->xbutton.button,
+ ev->xbutton.x, ev->xbutton.y,
+ win->hooks[ButtonRelease].param);
+}
+
+int mlx_int_param_MotionNotify(t_xvar *xvar, XEvent *ev, t_win_list *win)
+{
+ win->hooks[MotionNotify].hook(ev->xbutton.x,ev->xbutton.y,
+ win->hooks[MotionNotify].param);
+}
+
+int mlx_int_param_Expose(t_xvar *xvar, XEvent *ev, t_win_list *win)
+{
+ if (!ev->xexpose.count)
+ win->hooks[Expose].hook(win->hooks[Expose].param);
+}
+
+
+int mlx_int_param_generic(t_xvar *xvar, XEvent *ev, t_win_list *win)
+{
+ win->hooks[ev->type].hook(win->hooks[ev->type].param);
+}
+
+int (*(mlx_int_param_event[]))() =
+{
+ mlx_int_param_undef, /* 0 */
+ mlx_int_param_undef,
+ mlx_int_param_KeyPress,
+ mlx_int_param_KeyRelease, /* 3 */
+ mlx_int_param_ButtonPress,
+ mlx_int_param_ButtonRelease,
+ mlx_int_param_MotionNotify, /* 6 */
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_Expose, /* 12 */
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic,
+ mlx_int_param_generic
+};