Bug 392989 - Spacebar should always play/pause irrespective of focus
Summary: Spacebar should always play/pause irrespective of focus
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Ashwin Dhakaita
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-11 02:51 UTC by Nate Graham
Modified: 2019-01-15 16:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: elisa 0.3.80


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2018-04-11 02:51:17 UTC
Elisa nightly flatpak from kdeapps repo

Right now, the spacebar follows the typical focus rules: it "clicks" whatever's focused. In a music player, I think a more humane approach is to bind the spacebar to play/pause irrespective of focus.
Comment 1 Diego Gangl 2018-05-16 14:54:29 UTC
Agree, I think we should have far more global hotkeys in Elisa. It would more ergonomic and customizable.

Matthieu, what do you think about making a task in phabricator to track this?
Comment 2 Matthieu Gallien 2018-05-16 15:05:55 UTC
Yes, please. I will follow kdeconnect lead and try to flags junior jobs and communicate about them.
Comment 3 Alexander Stippich 2018-05-19 08:53:17 UTC
I've already played around a little bit with this since I think this is quite useful, but it seems that the buttons from QQC2 have the action to the space key hardcoded into the component? I couldn't get the space key just to react to only the specified shortcut, it always clicked the focused button, too.
Comment 4 Matthieu Gallien 2018-09-05 19:40:57 UTC
(In reply to Nate Graham from comment #0)
> Elisa nightly flatpak from kdeapps repo
> 
> Right now, the spacebar follows the typical focus rules: it "clicks"
> whatever's focused. In a music player, I think a more humane approach is to
> bind the spacebar to play/pause irrespective of focus.

I do not know what other music players are doing here, but I am quite used to pressing spacebar to press buttons in any interface. That would be quite a pity for me if that would be a default.
This is to say that we should add an application global shortcut to do that but I need to be convinced that spacebar is the right default.
Comment 5 Nate Graham 2018-09-05 20:01:16 UTC
I think we could look at what other media player software does. Most dedicated audio and video players use the spacebar for play/pause irrespective of focus (with the exception of when the user is in a text editor view or something).

Basically sometimes an app-specific need ("spacebar does play/pause") should override a general rule ("spacebar clicks focused control"). For years YouTube's player didn't bind spacebar to play/pause and they got no end of complaints about it until they changed the behavior. :)
Comment 6 Matthieu Gallien 2019-01-15 16:23:23 UTC
Git commit 5847d0e03f5ef3bfad0ae8e500c5640122983edb by Matthieu Gallien, on behalf of Ashwin Dhakaita.
Committed on 15/01/2019 at 16:23.
Pushed by mgallien into branch 'master'.

Global shortcut for play/pause action using spacebar key

Summary:
Assign SpaceBar key as the global shortcut for play/pause action.  Most of the media player out there already use spacebar as the global shortcut for play/pause action.  So,  it would be good to do the same for Elisa.
Modified ElisaMainWindow.qml to add the shortcut component.
Modified MediaPlayerControl.qml to prevent elements from getting focus as it causes interference with the shortcut keypressed events.
FIXED-IN:    elisa  0.3.80

Reviewers: #elisa, ngraham, mgallien

Reviewed By: #elisa, ngraham, mgallien

Subscribers: shubham, mgallien, ngraham

Tags: #elisa

Differential Revision: https://phabricator.kde.org/D17994

M  +30   -0    src/elisaapplication.cpp
M  +6    -0    src/elisaapplication.h
M  +6    -0    src/qml/ElisaMainWindow.qml
M  +4    -0    src/qml/FlatButtonWithToolTip.qml
M  +19   -4    src/qml/MediaPlayListView.qml
M  +13   -1    src/qml/MediaPlayerControl.qml
M  +10   -0    src/qml/NavigationActionBar.qml

https://commits.kde.org/elisa/5847d0e03f5ef3bfad0ae8e500c5640122983edb