-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard media controls not working #90
Comments
Hello thanks for your feedback! Are you talking about DBus controls or shortcuts in the app ? What terminal are you using? Can you send the ytermusic log? |
Not sure what is DBus controls, I'm referring to physical keyboard buttons (sometimes fn+key buttons) to pause/play, next track I actually cloned your repo and tried to implement this myself but couldn't get it to work, even though I think it should work, here is what I tried: Added line pub fn run(&mut self, updater: &Receiver<ManagerMessage>) -> Result<(), io::Error> {
// setup terminal
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
// create app and run it
let tick_rate = Duration::from_millis(250);
// V Added this line here V
PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES);
// ^ Added this line here ^
let mut last_tick = Instant::now();
'a: loop { Added lines in fn on_key_press(&mut self, key: KeyEvent, _: &ratatui::layout::Rect) -> EventResponse {
match key.code {
KeyCode::Media(media_key) => match media_key {
MediaKeyCode::PlayPause => {
SoundAction::PlayPause.apply_sound_action(self);
EventResponse::None
}
_ => EventResponse::None,
},
... I'm actually not that familiar with Rust, so I tried making a new empty Rust project just to see if I could at all capture these Where is the log file? I'll happily send it. |
I don't know how FN + FX keys are handled but it think they should use DBus too (A linux protocol for media actions cross-desktop). To confirm I've been using souvlaki underneath so maybe you should look there. Thanks for the investigation! |
Created a |
While playing a song, trying to pause/play songs, skip forward to the next stop, or going back to the start of the song (or last song if pressed twice quickly) via keyboard buttons doesn't work.
I'm on Ubuntu.
The text was updated successfully, but these errors were encountered: