On .fr keyboards you have to press shift to get digits, so
XKeycodeToKeysym(display, keycode, 0) doesn't return a
digit, so by default switching between workspaces doesn't
work.

Similarly, ``M-.'' doesn't work, because shift modifier must
be used to get ``.''

More generally, M-<sym> and M-S-<sym> cannot be reliably
distinguished accross different keyboard models, except for
digits, letters, tab, arrows, enter, esc and so on. For
instance if a keyboard has ``,'' and ``.'' on the same key
M-. and M-, won't work.

The diff below fixes digits. On .fr keyboards ``,'' and
``.'' are on separate keys, so it fixes M-. too. IMHO, if
scrotwm defaults are supposed to work on any model, default
keybindings should use letters, digits, space, enter and so
on only.

-- Alexandre

Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/scrotwm/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile    7 Jan 2010 01:57:28 -0000       1.15
+++ Makefile    9 Jan 2010 12:16:13 -0000
@@ -7,6 +7,7 @@ SHARED_LIBS=            swmhack 0.0
 DISTNAME=              scrotwm-0.9.21
 EXTRACT_SUFX=          .tgz
 CATEGORIES=            x11
+PKGNAME=               ${DISTNAME}p0
 
 HOMEPAGE=              http://www.scrotwm.org/
 MAINTAINER=            Marco Peereboom <ma...@peereboom.us>
Index: patches/patch-scrotwm_c
===================================================================
RCS file: /cvs/ports/x11/scrotwm/patches/patch-scrotwm_c,v
retrieving revision 1.9
diff -u -p -r1.9 patch-scrotwm_c
--- patches/patch-scrotwm_c     7 Jan 2010 01:57:28 -0000       1.9
+++ patches/patch-scrotwm_c     9 Jan 2010 12:16:13 -0000
@@ -10,3 +10,21 @@ $OpenBSD: patch-scrotwm_c,v 1.9 2010/01/
  #endif
  
  char                  **start_argv;
+@@ -3852,14 +3852,15 @@ void
+ keypress(XEvent *e)
+ {
+       unsigned int            i;
+-      KeySym                  keysym;
++      KeySym                  keysym, skeysym;
+       XKeyEvent               *ev = &e->xkey;
+ 
+       DNPRINTF(SWM_D_EVENT, "keypress: window: %lu\n", ev->window);
+ 
+       keysym = XKeycodeToKeysym(display, (KeyCode)ev->keycode, 0);
++      skeysym = XKeycodeToKeysym(display, (KeyCode)ev->keycode, 1);
+       for (i = 0; i < keys_length; i++)
+-              if (keysym == keys[i].keysym
++              if ((keysym == keys[i].keysym || skeysym == keys[i].keysym)
+                  && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state)
+                  && keyfuncs[keys[i].funcid].func) {
+                       if (keys[i].funcid == kf_spawn_custom)

Reply via email to