mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
config: support <mouse><default />
This loads default mousebinds and provides a way to keep config files
simpler whilst allowing user specific binds.
Note that if no rc.xml is found, or if no <mouse><mousebind> entries
exist, the same default mousebinds will be loaded even if the <default />
element is not provided.
Example usage:
<mouse>
<default />
<context name="Root">
<mousebind button="Right" action="Press">
<action name="Execute" command="my-menu-application" />
</mousebind>
</context>
</mouse>
This commit is contained in:
parent
edc5338af4
commit
3d337857b7
3 changed files with 13 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ enum font_place {
|
|||
};
|
||||
|
||||
static void load_default_key_bindings(void);
|
||||
static void load_default_mouse_bindings(void);
|
||||
|
||||
static void
|
||||
fill_keybind(char *nodename, char *content)
|
||||
|
|
@ -333,6 +334,9 @@ entry(xmlNode *node, char *nodename, char *content)
|
|||
if (!strcmp(nodename, "default.keyboard")) {
|
||||
load_default_key_bindings();
|
||||
return;
|
||||
} else if (!strcmp(nodename, "default.mouse")) {
|
||||
load_default_mouse_bindings();
|
||||
return;
|
||||
}
|
||||
|
||||
/* handle the rest */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue