SafeEyes icon indicating copy to clipboard operation
SafeEyes copied to clipboard

Enable MediaKeys pass through

Open stdedos opened this issue 6 years ago • 9 comments

Hi there,

Although mentioned here https://github.com/slgobinath/SafeEyes/issues/103 (and closed), Media Keys were not passed-through. Is that intentional?

Regardless, would you consider adding that?

stdedos avatar Nov 10 '17 14:11 stdedos

Not intentional but this is a feature I also looking for :-) Earlier I found it something hard to achieve according to the current implementation but will consider again.

slgobinath avatar Nov 10 '17 15:11 slgobinath

Isn't there a

'catch' keystroke, if X in []: ; send_key_globally(x)

?

(really rough lines from python/curses and some windows AHK scripting)

stdedos avatar Nov 10 '17 15:11 stdedos

I don't know whether there is a send_key_globally or similar function. FYI: This is how the Skip and Postpone shortcuts are handled by Safe Eyes: https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/BreakScreen.py#L229

slgobinath avatar Nov 10 '17 15:11 slgobinath

Not python code per se (quick search reveals that it is kinda-of problematic in Unix), but you could execute xdotool https://askubuntu.com/questions/218496/sending-keyboard-commands-to-ubuntu-through-python-remote-for-my-blackberry

stdedos avatar Nov 10 '17 15:11 stdedos

really looking forward to this improvement

r2rstep avatar Dec 15 '17 08:12 r2rstep

Yes, sending some keys is hard, however it may be easier to use MPRIS interface.

Vavooon avatar Feb 16 '18 22:02 Vavooon

Implemented in #295. Now there is a new plugin named: Media Control which supports pausing currently playing media players using dbus calls.

According to this implementation, if there is a media player playing while you take a break, you will get a pause button on the top right corner as shown in these screenshots. Currently, I have implemented only the Pause button assuming this is the most wanted option.

screenshot from 2019-01-12 16-01-53 screenshot from 2019-01-12 16-02-25

slgobinath avatar Jan 12 '19 21:01 slgobinath

Well, certainly a much different angle than the one expected.

However, if/when I finish this one, I will still push it (as I feel it would be much more useful than re-inventing the wheel)

stdedos avatar Jan 12 '19 21:01 stdedos

@stdedos definitely +1 for your direction. If that works, we can remove this plugin.

slgobinath avatar Jan 12 '19 21:01 slgobinath