[vlc-devel] configurable hotkeys

Sigmund Augdal sigmunau at stud.ntnu.no
Tue May 27 16:04:12 CEST 2003


I'm trying to implement configureably hotkeys in vlc and I'm making some
progress. I'll tell here what I've done so far so people get a chance to
shout out if they think I'm doing it the wrong way.

I added a CONFIG_ITEM_KEY type and a add_key() macro to the configuration
system. The key is an integer internally so I modified config_GetInt to
don't complain when called on a CONFIG_ITEM_KEY variable. I also created a
file include/hotkeys.h that contains defines for special keys and masks for
modifiers (shift, alt, ctrl). 

I added a integer variable in p_vlc called "key-pressed". Then I created an
interface module called "hotkeys" that adds a callback to the "key-pressed"
variable, then matches the key-pressed variable with the configured hotkeys,
and does appropriate actions based on this. The hotkeys interface is allways
inserted as a backgroud interface.

I based the hotkeys interface on the lirc interface, since it is allready
quite key-centeric, and I plan to modify the lirc interface to only send
hotkeys to the hotkeys interface. This should reduce the lirc interface to a
minimal piece of code.

I have also added very prototypish code to the wxwindows interface to
demonstrate how a CONFIG_ITEM_KEY could be rendered in a preferences dialog.
Screenshots can be found here: 
http://s55c.studby.ntnu.no/bilder/vlcshots/hotkeys.png

What currently needs to be done:
*fix modifiers in the x11 vout
*add support in all other vouts (and perhaps interfaces)
*add more keys and more actions

Please tell me what you think.

Sigmund
-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list