mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-30 06:12:20 -06:00
LinuxFrameBuffer: mouse wheel support
git-svn-id: svn://ultimatepp.org/upp/trunk@14579 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ff84bc48ce
commit
653b225866
1 changed files with 12 additions and 0 deletions
|
|
@ -99,6 +99,18 @@ bool LinuxFrameBuffer::ProcessEvent(bool *quit)
|
|||
}
|
||||
break;
|
||||
|
||||
case LIBINPUT_EVENT_POINTER_AXIS:
|
||||
{
|
||||
struct libinput_event_pointer *axis_event = libinput_event_get_pointer_event (event);
|
||||
auto source = libinput_event_pointer_get_axis_source(axis_event);
|
||||
const auto axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
|
||||
if (libinput_event_pointer_has_axis(axis_event, axis) && source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL){
|
||||
auto delta = libinput_event_pointer_get_axis_value_discrete(axis_event, axis);
|
||||
Ctrl::DoMouseFB(Ctrl::MOUSEWHEEL, input.mouse.pos, -120*delta);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
libinput_event_destroy(event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue