all repos — openbox @ fa4e09dd7e8b65234e833444f418e890a9185898

openbox fork - make it a bit more like ryudo

Allow escaping _ in menu labels by putting __

Currently you can't mark anything that comes after the __ with _ to make
that a shortcut.
Mikael Magnusson mikachu@gmail.com
commit

fa4e09dd7e8b65234e833444f418e890a9185898

parent

7351d86443539fd60267baed129601d923e88269

1 files changed, 7 insertions(+), 4 deletions(-)

jump to
M openbox/menu.copenbox/menu.c

@@ -232,10 +232,13 @@

/* you have to use a printable ascii character for shortcuts don't allow space either, so you can have like "a _ b" */ - if (VALID_SHORTCUT(*(i+1))) { - shortcut = g_unichar_tolower(g_utf8_get_char(i+1)); - *position = i - *strippedlabel; - *always_show = TRUE; + if (VALID_SHORTCUT(*(i+1)) || *(i+1) == '_') { + /* Allow you to escape the first _ by putting __ */ + if (*(i+1) != '_') { + shortcut = g_unichar_tolower(g_utf8_get_char(i+1)); + *position = i - *strippedlabel; + *always_show = TRUE; + } /* remove the '_' from the string */ for (; *i != '\0'; ++i)