forked from Bananymous/banan-os
Kernel: Combine consecutive mouse move and scroll events
This makes mouse work much smoother when running without kvm.
This commit is contained in:
parent
caa0111c79
commit
d4903caafa
|
@ -165,6 +165,22 @@ namespace Kernel::Input
|
|||
|
||||
for (int i = 0; i < event_count; i++)
|
||||
{
|
||||
if (!m_event_queue.empty() && m_event_queue.back().type == events[i].type)
|
||||
{
|
||||
if (events[i].type == MouseEventType::MouseMoveEvent)
|
||||
{
|
||||
m_event_queue.back().move_event.rel_x += events[i].move_event.rel_x;
|
||||
m_event_queue.back().move_event.rel_y += events[i].move_event.rel_y;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (events[i].type == MouseEventType::MouseScrollEvent)
|
||||
{
|
||||
m_event_queue.back().scroll_event.scroll += events[i].scroll_event.scroll;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_event_queue.full())
|
||||
{
|
||||
dwarnln("PS/2 event queue full");
|
||||
|
|
Loading…
Reference in New Issue