2018-02-15 19:07:47 +08:00
|
|
|
#ifndef INPUTMANAGER_H
|
|
|
|
#define INPUTMANAGER_H
|
|
|
|
|
2019-03-03 06:52:22 +08:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2019-09-30 04:36:56 +08:00
|
|
|
#include "config.h"
|
2018-02-15 19:07:47 +08:00
|
|
|
#include "common.h"
|
|
|
|
#include "controller.h"
|
2018-08-15 23:01:54 +08:00
|
|
|
#include "fps_counter.h"
|
2019-03-02 22:16:55 +08:00
|
|
|
#include "video_buffer.h"
|
2018-02-15 19:07:47 +08:00
|
|
|
#include "screen.h"
|
|
|
|
|
|
|
|
struct input_manager {
|
|
|
|
struct controller *controller;
|
2019-03-02 22:16:55 +08:00
|
|
|
struct video_buffer *video_buffer;
|
2018-02-15 19:07:47 +08:00
|
|
|
struct screen *screen;
|
2019-11-08 02:01:35 +08:00
|
|
|
bool prefer_text;
|
2018-02-15 19:07:47 +08:00
|
|
|
};
|
|
|
|
|
2019-03-03 03:09:56 +08:00
|
|
|
void
|
2019-10-20 17:51:54 +08:00
|
|
|
input_manager_process_text_input(struct input_manager *im,
|
2019-03-03 03:09:56 +08:00
|
|
|
const SDL_TextInputEvent *event);
|
|
|
|
|
|
|
|
void
|
2019-10-20 17:51:54 +08:00
|
|
|
input_manager_process_key(struct input_manager *im,
|
2019-03-03 18:05:26 +08:00
|
|
|
const SDL_KeyboardEvent *event,
|
|
|
|
bool control);
|
2019-03-03 03:09:56 +08:00
|
|
|
|
|
|
|
void
|
2019-10-20 17:51:54 +08:00
|
|
|
input_manager_process_mouse_motion(struct input_manager *im,
|
2019-03-03 03:09:56 +08:00
|
|
|
const SDL_MouseMotionEvent *event);
|
|
|
|
|
2019-09-23 03:30:05 +08:00
|
|
|
void
|
2019-10-20 17:51:54 +08:00
|
|
|
input_manager_process_touch(struct input_manager *im,
|
2019-09-23 03:30:05 +08:00
|
|
|
const SDL_TouchFingerEvent *event);
|
|
|
|
|
2019-03-03 03:09:56 +08:00
|
|
|
void
|
2019-10-20 17:51:54 +08:00
|
|
|
input_manager_process_mouse_button(struct input_manager *im,
|
2019-03-03 18:05:26 +08:00
|
|
|
const SDL_MouseButtonEvent *event,
|
|
|
|
bool control);
|
2019-03-03 03:09:56 +08:00
|
|
|
|
|
|
|
void
|
2019-10-20 17:51:54 +08:00
|
|
|
input_manager_process_mouse_wheel(struct input_manager *im,
|
2019-03-03 03:09:56 +08:00
|
|
|
const SDL_MouseWheelEvent *event);
|
2018-02-15 19:07:47 +08:00
|
|
|
|
|
|
|
#endif
|