all repos — openbox @ ae0d84721d58731feee4888b67e7a1e55cd318b2

openbox fork - make it a bit more like ryudo

add a leftHanded option for mouse bindings, reverses the left/right keywords
Dana Jansens danakj@orodu.net
commit

ae0d84721d58731feee4888b67e7a1e55cd318b2

parent

795d90c3bc57eaf2c98c447f3af5c1c9e7a52fa3

4 files changed, 10 insertions(+), 3 deletions(-)

jump to
M data/rc3data/rc3

@@ -111,6 +111,7 @@

<mouse> <dragThreshold>3</dragThreshold> <doubleClickTime>200</doubleClickTime> + <leftHanded>no</leftHanded> <context name="frame"> <mousebind button="A-Left" action="drag">
M plugins/mouse/mouse.cplugins/mouse/mouse.c

@@ -13,7 +13,7 @@ #include <glib.h>

static int threshold; static int dclicktime; - +gboolean mouse_lefthand; /* <context name="Titlebar">

@@ -36,6 +36,8 @@ if ((n = parse_find_node("dragThreshold", node)))

threshold = parse_int(doc, n); if ((n = parse_find_node("doubleClickTime", node))) dclicktime = parse_int(doc, n); + if ((n = parse_find_node("leftHanded", node))) + mouse_lefthand = parse_bool(doc, n); n = parse_find_node("context", node); while (n) {

@@ -99,6 +101,7 @@ void plugin_setup_config()

{ threshold = 3; dclicktime = 200; + mouse_lefthand = FALSE; parse_register("mouse", parse_xml, NULL); }
M plugins/mouse/mouse.hplugins/mouse/mouse.h

@@ -18,6 +18,8 @@ guint button;

GSList *actions[NUM_MOUSEACTION]; /* lists of Action pointers */ } MouseBinding; +extern gboolean mouse_lefthand; + gboolean mbind(char *buttonstr, char *contextstr, MouseAction mact, Action *action);
M plugins/mouse/translate.cplugins/mouse/translate.c

@@ -1,4 +1,5 @@

#include "../../kernel/openbox.h" +#include "mouse.h" #include <glib.h> #include <string.h> #include <stdlib.h>

@@ -45,9 +46,9 @@ *state |= m;

} /* figure out the button */ - if (!g_ascii_strcasecmp("Left", l)) *button = 1; + if (!g_ascii_strcasecmp("Left", l)) *button = mouse_lefthand ? 3 : 1; else if (!g_ascii_strcasecmp("Middle", l)) *button = 2; - else if (!g_ascii_strcasecmp("Right", l)) *button = 3; + else if (!g_ascii_strcasecmp("Right", l)) *button = mouse_lefthand ? 1 : 3; else if (!g_ascii_strcasecmp("Up", l)) *button = 4; else if (!g_ascii_strcasecmp("Down", l)) *button = 5; else if (!g_ascii_strncasecmp("Button", l, 6)) *button = atoi(l+6);