changed onscroll to onwheel

This commit is contained in:
Evan Almloff committed 2022-02-05 16:45:40 -06:00
1 parent 6f50da162b
commit ff92df73bd
2 files changed
+9 -2

No files matched your search

+7
View File
@@ -1,3 +1,4 @@
use dioxus::events::WheelEvent;
use dioxus::prelude::*;
use dioxus_html::on::{KeyboardEvent, MouseEvent};
use dioxus_html::KeyCode;
@@ -31,6 +32,12 @@ fn app(cx: Scope) -> Element {
}
set_key(evt.key_code);
},
onwheel: move |evt: WheelEvent| {
set_count(count + evt.data.delta_y as i64);
},
ondrag: move |evt: MouseEvent| {
set_mouse((evt.data.screen_x, evt.data.screen_y));
},
onmousedown: move |evt: MouseEvent| {
set_mouse((evt.data.screen_x, evt.data.screen_y));
set_buttons(evt.data.buttons);