This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
hilbert-os/applications/goldman/source/input.cpp

21 lines
483 B
C++

#include "input.hpp"
#include "main.hpp"
[[noreturn]] void input_thread_main() {
euler::syscall::set_thread_name("input thread");
while (true) {
auto result = euler::syscall::get_input_packet();
if (std::holds_alternative<euler::syscall::mouse_packet>(result)) {
auto packet = std::get<euler::syscall::mouse_packet>(result);
r->lock();
r->bump_cursor(packet.x_changed, packet.y_changed);
r->unlock();
r->dispatch_render();
}
}
}