Introduction
Introduction Statistics Contact Development Disclaimer Help
Making more than one Modkey to work in keys. - surf - surf browser, a WebKit ba…
git clone git://git.suckless.org/surf
Log
Files
Refs
README
LICENSE
---
commit 0415175e10880585c765613af0bd43e02de87116
parent e784d925dfab0405cb4bf2ac7466045d8089a189
Author: Christoph Lohmann <[email protected]>
Date: Sat, 26 Jan 2013 16:00:52 +0100
Making more than one Modkey to work in keys.
Diffstat:
M config.def.h | 4 ++++
M surf.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/config.def.h b/config.def.h
@@ -45,6 +45,10 @@ static Bool hidebackground = FALSE;
#define MODKEY GDK_CONTROL_MASK
/* hotkeys */
+/*
+ * If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to
+ * edit the CLEANMASK() macro.
+ */
static Key keys[] = {
/* modifier keyval function arg Foc…
{ MODKEY|GDK_SHIFT_MASK,GDK_r, reload, { .b = TRUE } },
diff --git a/surf.c b/surf.c
@@ -28,6 +28,7 @@
char *argv0;
#define LENGTH(x) (sizeof x / sizeof x[0])
+#define CLEANMASK(mask) (mask & (MODKEY|GDK_SHIFT_MASK))
#define COOKIEJAR_TYPE (cookiejar_get_type ())
#define COOKIEJAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COOKIEJAR_…
@@ -543,7 +544,7 @@ keypress(GtkWidget* w, GdkEventKey *ev, Client *c) {
updatewinid(c);
for(i = 0; i < LENGTH(keys); i++) {
if(gdk_keyval_to_lower(ev->keyval) == keys[i].keyval
- && (ev->state & keys[i].mod) == keys[i].mod
+ && CLEANMASK(ev->state) == keys[i].mod
&& keys[i].func) {
keys[i].func(c, &(keys[i].arg));
processed = TRUE;
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.