2017-12-14 11:38:44 +01:00
|
|
|
#ifndef CONVERT_H
|
|
|
|
#define CONVERT_H
|
|
|
|
|
|
|
|
#include <SDL2/SDL_stdinc.h>
|
|
|
|
#include <SDL2/SDL_events.h>
|
2018-08-15 17:01:54 +02:00
|
|
|
#include "control_event.h"
|
2017-12-14 11:38:44 +01:00
|
|
|
|
2018-01-22 16:50:08 +01:00
|
|
|
struct complete_mouse_motion_event {
|
|
|
|
SDL_MouseMotionEvent *mouse_motion_event;
|
|
|
|
struct size screen_size;
|
|
|
|
};
|
|
|
|
|
2017-12-14 11:38:44 +01:00
|
|
|
struct complete_mouse_wheel_event {
|
|
|
|
SDL_MouseWheelEvent *mouse_wheel_event;
|
2018-01-22 16:50:08 +01:00
|
|
|
struct point position;
|
2017-12-14 11:38:44 +01:00
|
|
|
};
|
|
|
|
|
2019-03-02 20:09:56 +01:00
|
|
|
SDL_bool
|
|
|
|
input_key_from_sdl_to_android(const SDL_KeyboardEvent *from,
|
|
|
|
struct control_event *to);
|
|
|
|
|
|
|
|
SDL_bool
|
|
|
|
mouse_button_from_sdl_to_android(const SDL_MouseButtonEvent *from,
|
|
|
|
struct size screen_size,
|
|
|
|
struct control_event *to);
|
|
|
|
|
|
|
|
// the video size may be different from the real device size, so we need the
|
|
|
|
// size to which the absolute position apply, to scale it accordingly
|
|
|
|
SDL_bool
|
|
|
|
mouse_motion_from_sdl_to_android(const SDL_MouseMotionEvent *from,
|
|
|
|
struct size screen_size,
|
|
|
|
struct control_event *to);
|
2018-01-22 16:50:08 +01:00
|
|
|
|
|
|
|
// on Android, a scroll event requires the current mouse position
|
2019-03-02 20:09:56 +01:00
|
|
|
SDL_bool
|
|
|
|
mouse_wheel_from_sdl_to_android(const SDL_MouseWheelEvent *from,
|
|
|
|
struct position position,
|
|
|
|
struct control_event *to);
|
2017-12-14 11:38:44 +01:00
|
|
|
|
|
|
|
#endif
|