summaryrefslogtreecommitdiff
path: root/applications/goldman/source/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'applications/goldman/source/input.cpp')
-rw-r--r--applications/goldman/source/input.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/applications/goldman/source/input.cpp b/applications/goldman/source/input.cpp
new file mode 100644
index 0000000..0cd6922
--- /dev/null
+++ b/applications/goldman/source/input.cpp
@@ -0,0 +1,21 @@
+#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();
+ }
+
+ }
+
+}