mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-30 02:48:10 +03:00
Advance messages by scrolling mouse wheel down
Now the 'A' command accepts mouse wheel down events in addition to keyboard and mouse buttons.
This commit is contained in:
+12
-1
@@ -21,7 +21,7 @@ enum TouchState {
|
||||
};
|
||||
|
||||
extern SDL_Window* g_window;
|
||||
static int mousex, mousey;
|
||||
static int mousex, mousey, wheel;
|
||||
static TouchState touch_state = TOUCH_NONE;
|
||||
|
||||
void NACT::handle_event(SDL_Event e)
|
||||
@@ -47,6 +47,10 @@ void NACT::handle_event(SDL_Event e)
|
||||
mousey = e.motion.y * ags->screen_height / ags->window_height;
|
||||
break;
|
||||
|
||||
case SDL_MOUSEWHEEL:
|
||||
wheel += e.wheel.y * (e.wheel.direction == SDL_MOUSEWHEEL_FLIPPED ? -1 : 1);
|
||||
break;
|
||||
|
||||
case SDL_FINGERDOWN:
|
||||
case SDL_FINGERUP:
|
||||
case SDL_FINGERMOTION:
|
||||
@@ -154,6 +158,13 @@ void NACT::set_cursor(int x, int y)
|
||||
SDL_WarpMouseInWindow(g_window, x, y);
|
||||
}
|
||||
|
||||
int NACT::get_wheel()
|
||||
{
|
||||
int val = wheel;
|
||||
wheel = 0;
|
||||
return val;
|
||||
}
|
||||
|
||||
void NACT::show_quit_dialog()
|
||||
{
|
||||
const SDL_MessageBoxButtonData buttons[] = {
|
||||
|
||||
Reference in New Issue
Block a user