2021-11-30 21:29:18 -06:00
|
|
|
#ifndef INPUT_H
|
|
|
|
#define INPUT_H
|
|
|
|
|
2023-08-31 02:05:06 -05:00
|
|
|
#include "sokol/sokol_app.h"
|
|
|
|
|
2023-05-12 13:22:05 -05:00
|
|
|
#include "script.h"
|
2022-02-06 10:14:57 -06:00
|
|
|
#include "window.h"
|
2023-02-02 17:52:15 -06:00
|
|
|
#include <chipmunk/chipmunk.h>
|
2023-05-12 13:22:05 -05:00
|
|
|
#include <stdint.h>
|
2022-12-19 18:15:38 -06:00
|
|
|
|
2023-11-14 09:20:09 -06:00
|
|
|
extern HMM_Vec2 mousewheel;
|
|
|
|
extern HMM_Vec2 mouse_pos;
|
|
|
|
extern HMM_Vec2 mouse_delta;
|
2023-02-02 17:52:15 -06:00
|
|
|
|
2023-08-31 02:05:06 -05:00
|
|
|
#define INPUT_DOWN 0
|
|
|
|
#define INPUT_UP 1
|
|
|
|
#define INPUT_REPEAT 2
|
|
|
|
|
2022-02-06 10:14:57 -06:00
|
|
|
void input_init();
|
2022-08-12 14:03:56 -05:00
|
|
|
void input_poll(double wait);
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2022-02-06 10:14:57 -06:00
|
|
|
void cursor_hide();
|
|
|
|
void cursor_show();
|
2023-02-19 11:16:35 -06:00
|
|
|
void set_mouse_mode(int mousemode);
|
2022-02-06 10:14:57 -06:00
|
|
|
|
2023-09-12 17:19:46 -05:00
|
|
|
void input_mouse(int btn, int state, uint32_t mod);
|
2023-09-15 22:40:19 -05:00
|
|
|
void input_mouse_move(float x, float y, float dx, float dy, uint32_t mod);
|
|
|
|
void input_mouse_scroll(float x, float y, uint32_t mod);
|
2023-09-02 06:53:52 -05:00
|
|
|
void input_btn(int btn, int state, uint32_t mod);
|
2023-09-21 19:51:38 -05:00
|
|
|
void input_key(uint32_t key, uint32_t mod);
|
2023-08-31 02:05:06 -05:00
|
|
|
|
|
|
|
const char *keyname_extd(int key);
|
|
|
|
int action_down(int key);
|
2022-02-06 10:14:57 -06:00
|
|
|
|
2023-04-19 15:16:35 -05:00
|
|
|
void register_pawn(struct callee c);
|
2023-04-25 16:59:12 -05:00
|
|
|
void register_gamepad(struct callee c);
|
2023-04-19 15:16:35 -05:00
|
|
|
|
2022-12-16 11:54:05 -06:00
|
|
|
void quit();
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
#endif
|