[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] Mixer control key bindings

lok wrote:
On Fri, 29 Dec 2006 19:52:31 +0000
Aleksej Struk <astruk@gmail.com> wrote:

Hi Nick,

The implementation of the key binding in mixer module is similar to
the implementation in language module. iirc, it was taken exactly from
that module.

The idea is, that module has to define the following things:

1) the action, which will be executed on key press, For example
2) the function, which is associated with the action.
3) The 'human readable' name of the action. For example "Mute The
Mixer". This name will appear in keybinding dialog.
4) The keybinding that uses the "mixer_mute" action. Actually this is optional. And has to be
done if you want to have default binding.
5) Finally, you have to do reverse actions on module unload.

1) and 2) are done by those several lines of code:

E_Actoin *a;
a = e_action_add("mixer_mute");
if (a) a->func.go = _some_binding_callback_funcition

3) is done basically by calling e_action_predef_name_set function (see

4) You have to define a E_Config_Binding_Key *eb variable and fill it
in with the correct values. After doing that, you have to: (i) insert
eb into e_config->key_bindings, and (ii) call to e_bindings_key_add to
make the binding active. Note, that you have to enclose (i) and (ii)
between e_manager_keys_ungrab() and e_managers_keys_grab() after.

For further information look into language madule e_mod_keybindigs.c
Feel free to contact me on IRC if you need more detailed explanation.


On Fri, Dec 29, 2006 at 04:12:15PM +0100, Nikolas Arend wrote:

the key bindings for "Decrease/Increase Volume" and "Mute mixer" don't seem to work for me (SuSE 10.1). Could somebody give me a short explanation of how they are implemented? I guess they are supposed to work and it's a problem on my side?

Thanks a lot,  Nick.


thanks to all for your elaborate explanations!

as sndev said, the keybinding code in mixer was taken from the language module.
The bindings in the mixer modules need at least one gadcon instance of the mixer
in order to work. The mixer initialize is configuration only if an instance is created.
Once the configuration is filled with the right mixer then the keybinding can works.
So you need to put the mixer module in a shelf to have keybindings working.

Ah, that of course explains a lot. I don't have the mixer module running, in fact I defined the key bindings for volume increase/decrease and muting in order to _NOT_ have the need of running the mixer module (or any other mixer gui) ;-) Now that I added it to a shelf, it all works. But I'd rather like it if one wouldn't have to actually put the module into a shelf.

I could have move a part of the configuration code in order to make it works right after the module is loaded. But at that time I wasn't really seeing the point.

As I said above, I'd consider this a good thing. A hint somewhere that the module must be enabled/loaded to have the key bindings working maybe couldn't hurt either, IMHO.

Thanks again and best regards,   Nick.