diff --git a/src/drawing_demo/main.cpy b/src/drawing_demo/main.cpy index 07e6614..4cb0d0b 100644 --- a/src/drawing_demo/main.cpy +++ b/src/drawing_demo/main.cpy @@ -13,10 +13,16 @@ class Note: public ui::Widget: void on_mouse_up(input::SynMotionEvent &ev): prevx = prevy = -1 - void on_mouse_move(input::SynMotionEvent &ev): - if input::is_touch_event(ev): - return + bool ignore_event(input::SynMotionEvent &ev): + if not ui::MainLoop::in.has_stylus: + ev.pressure = 0.5 + ev.tilt_x = 0.5 + ev.tilt_y = 0.5 + return false + return input::is_touch_event(ev) != NULL + + void on_mouse_move(input::SynMotionEvent &ev): if not mouse_down: return diff --git a/src/sharenote/main.cpy b/src/sharenote/main.cpy index cee25a3..2250b5d 100644 --- a/src/sharenote/main.cpy +++ b/src/sharenote/main.cpy @@ -204,6 +204,12 @@ class Note: public ui::Widget: prevx = prevy = -1 bool ignore_event(input::SynMotionEvent &ev): + if not ui::MainLoop::in.has_stylus: + ev.pressure = 0.5 + ev.tilt_x = 0.5 + ev.tilt_y = 0.5 + return false + return input::is_touch_event(ev) != NULL void on_mouse_move(input::SynMotionEvent &ev):