X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=videoplayer%2Fsrc%2Fmain.rs;h=d60f4395b1217f59a7c08053a86c51b2535d592c;hb=2ef3529c3c4445ef99b0c2c1afadcb98803fa517;hp=e3d2d002a1ddba0514859aada31504f043760825;hpb=e2ca0dbe4e8c92c3c95cda0cf1dc57da164b1c8a;p=nihav-player.git diff --git a/videoplayer/src/main.rs b/videoplayer/src/main.rs index e3d2d00..d60f439 100644 --- a/videoplayer/src/main.rs +++ b/videoplayer/src/main.rs @@ -13,7 +13,7 @@ use std::sync::atomic::{AtomicU8, Ordering}; use sdl2::event::{Event, WindowEvent}; use sdl2::keyboard::{Keycode, Mod}; -use sdl2::mouse::MouseButton; +use sdl2::mouse::{MouseButton, MouseWheelDirection}; use sdl2::render::{Canvas, Texture, TextureCreator}; use sdl2::pixels::PixelFormatEnum; use sdl2::video::{Window, WindowContext}; @@ -480,6 +480,9 @@ impl Player { _ => {}, }; } + if let Event::MouseWheel {direction: MouseWheelDirection::Normal, x: 0, y, ..} = event { + self.seek(10, y > 0, dmx, disp_queue)?; + } if let Event::KeyDown {keycode: Some(keycode), keymod, ..} = event { match keycode { Keycode::Escape => { @@ -487,7 +490,7 @@ impl Player { println!(); return Ok(true); }, - Keycode::Q if matches!(keymod, Mod::RSHIFTMOD | Mod::LSHIFTMOD) => { + Keycode::Q if keymod.contains(Mod::RSHIFTMOD) || keymod.contains(Mod::LSHIFTMOD) => { self.end = true; println!(); return Ok(true);