mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
src/config/rcxml.c: Add support for <devault /> mousebinds
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 <devault />
element is not provided.
Example usage (with a slight spelling error):
<mouse>
<default />
<context name="Root">
<mousebind button="Right" action="Press">
<action name="ShowMenu" menu="desktop-menu" />
</mousebind>
</context>
</mouse>
Co-Authored-By: @johanmalm
Fixes #416
This commit is contained in:
parent
3afd666cc4
commit
ea6007d34c
2 changed files with 13 additions and 0 deletions
|
|
@ -219,6 +219,13 @@ The rest of this man page describes configuration options.
|
||||||
- DoubleClick: Two presses within the doubleClickTime.
|
- DoubleClick: Two presses within the doubleClickTime.
|
||||||
- Drag: Pressing the button within the context, then moving the cursor
|
- Drag: Pressing the button within the context, then moving the cursor
|
||||||
|
|
||||||
|
*<mouse><default />*
|
||||||
|
Load default mousebinds. This is an addition to the openbox
|
||||||
|
specification 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.
|
||||||
|
|
||||||
## LIBINPUT
|
## LIBINPUT
|
||||||
|
|
||||||
*<libinput><device category="">*
|
*<libinput><device category="">*
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ enum font_place {
|
||||||
};
|
};
|
||||||
|
|
||||||
static void load_default_key_bindings(void);
|
static void load_default_key_bindings(void);
|
||||||
|
static void load_default_mouse_bindings(void);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fill_keybind(char *nodename, char *content)
|
fill_keybind(char *nodename, char *content)
|
||||||
|
|
@ -335,6 +336,11 @@ entry(xmlNode *node, char *nodename, char *content)
|
||||||
load_default_key_bindings();
|
load_default_key_bindings();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!strcmp(nodename, "devault.mouse")
|
||||||
|
|| !strcmp(nodename, "default.mouse")) {
|
||||||
|
load_default_mouse_bindings();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* handle the rest */
|
/* handle the rest */
|
||||||
if (!content) {
|
if (!content) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue