handle X button press events
This commit is contained in:
parent
b100262a15
commit
5e40c33eda
@ -205,18 +205,18 @@ void Window::handle_event(Jtk_Event & event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case SDL_MOUSEWHEEL:
|
case JTK_EVENT_BUTTON_PRESS:
|
||||||
if (event.wheel.y > 0)
|
if (event.button.button == 4)
|
||||||
{
|
{
|
||||||
m_focused_buffer_pane->scroll_window_up(ScrollMode::WHEEL);
|
m_focused_buffer_pane->scroll_window_up(ScrollMode::WHEEL);
|
||||||
}
|
}
|
||||||
else
|
else if (event.button.button == 5)
|
||||||
{
|
{
|
||||||
m_focused_buffer_pane->scroll_window_down(ScrollMode::WHEEL);
|
m_focused_buffer_pane->scroll_window_down(ScrollMode::WHEEL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,6 +276,16 @@ static bool ProcessXKeyReleaseEvent(XEvent * x_event, Jtk_Event * event)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process an X button press event.
|
||||||
|
*/
|
||||||
|
static bool ProcessXButtonPressEvent(XEvent * x_event, Jtk_Event * event)
|
||||||
|
{
|
||||||
|
event->type = JTK_EVENT_BUTTON_PRESS;
|
||||||
|
event->button.button = x_event->xbutton.button;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process an X configure event.
|
* Process an X configure event.
|
||||||
*
|
*
|
||||||
@ -316,7 +326,7 @@ static bool ProcessXEvent(XEvent * x_event, Jtk_Event * event)
|
|||||||
return ProcessXKeyReleaseEvent(x_event, event);
|
return ProcessXKeyReleaseEvent(x_event, event);
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
break;
|
return ProcessXButtonPressEvent(x_event, event);
|
||||||
|
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user