introduce mouse section in config file

This commit is contained in:
Julien Danjou 2007-11-11 13:17:23 +01:00
parent 799da178b0
commit 7604fa70b5
2 changed files with 14 additions and 4 deletions

View File

@ -112,9 +112,13 @@ rules
} }
} }
keys mouse
{ {
modkey = "Mod4" modkey = "Mod4"
}
keys
{
key key
{ {
modkey = {"Mod4"} modkey = {"Mod4"}

View File

@ -225,19 +225,24 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
}; };
static cfg_opt_t keys_opts[] = static cfg_opt_t keys_opts[] =
{ {
CFG_STR((char *) "modkey", (char *) "Mod4", CFGF_NONE),
CFG_SEC((char *) "key", key_opts, CFGF_MULTI), CFG_SEC((char *) "key", key_opts, CFGF_MULTI),
CFG_END() CFG_END()
}; };
static cfg_opt_t mouse_opts[] =
{
CFG_STR((char *) "modkey", (char *) "Mod4", CFGF_NONE),
CFG_END()
};
static cfg_opt_t opts[] = static cfg_opt_t opts[] =
{ {
CFG_SEC((char *) "screen", screen_opts, CFGF_TITLE | CFGF_MULTI), CFG_SEC((char *) "screen", screen_opts, CFGF_TITLE | CFGF_MULTI),
CFG_SEC((char *) "rules", rules_opts, CFGF_NONE), CFG_SEC((char *) "rules", rules_opts, CFGF_NONE),
CFG_SEC((char *) "keys", keys_opts, CFGF_NONE), CFG_SEC((char *) "keys", keys_opts, CFGF_NONE),
CFG_SEC((char *) "mouse", mouse_opts, CFGF_NONE),
CFG_END() CFG_END()
}; };
cfg_t *cfg, *cfg_general, *cfg_colors, *cfg_screen, *cfg_statusbar, cfg_t *cfg, *cfg_general, *cfg_colors, *cfg_screen, *cfg_statusbar,
*cfg_tags, *cfg_layouts, *cfg_rules, *cfg_keys, *cfgsectmp; *cfg_tags, *cfg_layouts, *cfg_rules, *cfg_keys, *cfg_mouse, *cfgsectmp;
int i = 0, k = 0, ret; int i = 0, k = 0, ret;
unsigned int j = 0; unsigned int j = 0;
const char *tmp, *homedir; const char *tmp, *homedir;
@ -287,6 +292,7 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
/* get general sections */ /* get general sections */
cfg_rules = cfg_getsec(cfg, "rules"); cfg_rules = cfg_getsec(cfg, "rules");
cfg_keys = cfg_getsec(cfg, "keys"); cfg_keys = cfg_getsec(cfg, "keys");
cfg_mouse = cfg_getsec(cfg, "mouse");
/* General section */ /* General section */
@ -387,7 +393,7 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
awesomeconf->tags[0].was_selected = True; awesomeconf->tags[0].was_selected = True;
/* Keys */ /* Keys */
tmp_key = key_mask_lookup(cfg_getstr(cfg_keys, "modkey")); tmp_key = key_mask_lookup(cfg_getstr(cfg_mouse, "modkey"));
awesomeconf->modkey = tmp_key ? tmp_key : Mod4Mask; awesomeconf->modkey = tmp_key ? tmp_key : Mod4Mask;
awesomeconf->numlockmask = get_numlockmask(awesomeconf->display); awesomeconf->numlockmask = get_numlockmask(awesomeconf->display);