[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
SMPlayer Support Forum • View topic - Certain Multimedia Keys - Not working, they work fine in ...

This forum is deprecated. Please visit https://github.com/smplayer-dev/smplayer/discussions

Certain Multimedia Keys - Not working, they work fine in ...

Problems, bugs, suggestions... anything related to SMPlayer.

Certain Multimedia Keys - Not working, they work fine in ...

Postby ghost_zero » Wed Aug 25, 2010 10:27 pm

Hi,

I am using Ubuntu 10.04 and I have certain Multimedia Keys that don't work.
Either the ones from my Keyboard (Logitech Media Elite) or those from a IR receiver and remote (from Cyberlink).
The same keys work fine in Rhythmbox but I can't even detect them in SMPlayer (0.6.9-r3447).

From the Keyboard those Keys show (through scankey -s when doing both pressing and releasing afterwards):
Play/Pause 0xe0 0x22 0xe0 0xa2 or with scankey -k: 164
Stop 0xe0 0x24 0xe0 0xa4 or with scankey -k: 166
Forward 0xe0 0x19 0xe0 0x99 or with scankey -k: 163 (in Rhythmbox this one is used for next track which makes sense as the Keyboard has no button for next track)
Backward 0xe0 0x10 0xe0 0x90 or with scankey -k: 165 (in Rhythmbox this one is used for previous track which makes sense as the Keyboard has no button for previous track)


Regarding the remote:
Play 0xe0 0x33 0xe0 0xb3 or with scankey -k: 207
Pause 0xe1 0x1d 0x45 0xe1 0x9d 0xc5 or with scankey -k: 119 (actually that one isn't used by Ryhtmbox as the Play Button is used for Pause too; which makes sense, of course)
Forward 0xe0 0x34 0xe0 0xb4 or with scankey -k: 208 (not used by Rhytmbox as the remote has an individual next track button)
Backward 0xe0 0x18 0xe0 0x98 or with scankey -k: 168 (not used by Rhytmbox as the remote has an individual previous track button)
Next Track 0xe0 0x19 0xe0 0x99 or with scankey -k: 163
Previous Track 0xe0 0x10 0xe0 0x90 or with scankey -k: 165


It would be great if those keys could be supported by SMPlayer in the next version.
ghost_zero
 

Re: Certain Multimedia Keys - Not working, they work fine in ...

Postby rvm » Thu Aug 26, 2010 1:22 am

Keys are handled by Qt. If it fails to detect those keys, there's nothing I can do.
rvm
Site Admin
 
Posts: 3787
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: Certain Multimedia Keys - Not working, they work fine in ...

Postby ghost_zero » Thu Aug 26, 2010 10:03 pm

Actually it is interesting.
I have started Ubuntu with KDE and there the STOP Key works but not the Play Key.

HOWEVER, in Amarok BOTH Keys work fine and that one should use QT too, shouldn't it?
ghost_zero
 

Re: Certain Multimedia Keys - Not working, they work fine in ...

Postby ghost_zero » Sun Aug 29, 2010 9:37 am

Correction:
Media Play (at least from the Keyboard - haven't tested the other one) does work too when I am in KDE.
The key just wasn't set in the SMPlayer options because I was trying some things before under GNOME.

Does anyone know why does keys might not work under GNOME?

Not that it matters much as I will switch to KDE with the upcoming Ubuntu 10.10 anyway but still ...
ghost_zero
 

Re: Certain Multimedia Keys - Not working, they work fine in ...

Postby ghost_zero » Sun Aug 29, 2010 9:46 am

OK. One more information regarding Amarok I found the following script to get Multimedia Keys working under GNOME v2.22 and higher:
http://kde-apps.org/content/show.php?content=103448

Could this be modified somehow to work with SMPlayer or directly embedded into it?
ghost_zero
 

Re: Certain Multimedia Keys - Not working, they work fine in ...

Postby ghost_zero » Wed Nov 17, 2010 10:37 pm

ghost_zero
 

Re: Certain Multimedia Keys - Not working, they work fine in ...

Postby ghost_zero » Thu Feb 24, 2011 4:34 pm

I have now created a python script + a small part bash script that can be used to either forward the keys to smplayer or another one (v2.0) which
has the advantage to keep the normal Multimedia Key Handling in tact for SMPlayer.
The first one sends "different" commands to SMPlayer (only if SMPlayer is active) and also disables (if any SMPlayer is active) or enables (if any SMPlayer is not active) rhythmbox's Multimedia Key support.
The second one basically improves what the other did with rhytmbox and disables if SMPlayer is active the Multimedia key support in gnome (through gconftool) and re-enables it once it isn't active anymore. That way all other application and also the normal Gnome desktop still handle the keys correctly and only if SMPlayer is active Gnome doesn't handle the keys at all (which it isn't required to do in this case anyway) and therefore the keys pass through to SMPlayer like they should anyway. The part with rhytmbox is still in it, so that I don't have to make rhythmbox the active window for the player to resume it's multimedia keys (that way I can be in another program or the desktop, if it is open).

Also with the small bash-file you can change the Gnome menu shortcuts to something like this:
bash -c "/pathtoscript/SMPlayer-Mulitemedia-Keys/SMPlayer \'%U\'"

and it will also be capable of playing through double click with using that script. I also added an option that the script doesn't run more than once (by checking for a temporary file I create).

The command to add something to the playlist would look like this:
bash -c "/home/andreas/Software/SMPlayer-Mulitemedia-Keys/SMPlayer -add-to-playlist \'%U\'"

The requirements for those scripts should be something like this (but I am not sure if this is everything):
python
python-gtk2
xautomation (not required for v2.0 as we don't send any keys to SMPlayer anymore)
xdotool
xargs
gconf2
python-wnck

I uploaded these scripts here (both versions), so if somebody else wants them or if you intend to implement a support like this directly into SMPlayer:


Thanks for those scripts goes partly to the one used for Amarok and Gnome Multimedia keys (especially for v1.0) and to various sites on the internet - e.g. regarding the Active window changed event (didn't know how to do this in python).
ghost_zero
 


Return to General

Who is online

Users browsing this forum: No registered users and 42 guests