Subject: FVWM: Re: strange keybindings - patch

From: Dominik Vogt <[email-masked]>
Date: Mon, 5 Aug 2002 02:09:08 +0200

On Fri, Aug 02, 2002 at 09:07:37PM +0200, Martin Renold wrote:
> Hi there,
> 
> I just tried fvwm, and decided have a closer look.
> 
> So I wrote a config file to get the same keybindings as I use in wmaker,
> but suddenly found the "s"-key was now bound to one of my actions too.
> 
> The problem was that the "section" keysym I used is bound on the german
> keyboard also to the "s"-key in combination with some unknown modifier
> (I've never used this). It is the same with some other keys.
> 
> A simple patch is attached. Please CC me any response, I am not
> subscribed to the list.

Ah yes, I unserstand the problem.  I've made a different patch
that does not prevent this bindings in general but only when there
are no "better" matches for the keysym (i.e. if there are no keys
that generate the keysym without any modifiers or with just shift
or caps-lock).   Try this code in place of the "default" clause
you modified in Bindings.c:

	default:
	  /* key generates the key sym with unknown modifiers depressed -
	   * can't map that to specific modifiers - treat as no modifiers */
	  if (modifiers != AnyModifier)
	  {
	    /* but don't bind it again if already bound with shift, caps-lock
	     * or no modifiers */
	    check_bound_mask = 0x7;
	  }
	  break;

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Martin Renold <[email-masked]>
Date: Mon, 5 Aug 2002 20:54:29 +0200

Hi,

> you modified in Bindings.c:

It doesn't work (I acutally tried it), and I know why. Perhaps my
description of the problem wasn't exact enough. Have a look at
# xmodmap -pke | grep section
keycode  39 = s S ssharp section
keycode  49 = section degree notsign

What I want to bind is keycode 49 with no modifier pressed. The loop
iterates through each keycode, and executes for keycode 39 the default
statement, and binds it. It doesn't care about the "better" match
(keycode 49), and binds both, with no modifiers, which makes the "s" key
unuseable. The result was, that without my patch, I was unable to bind
the section key properly.

What I would accept is that it binds to the "s" key only if no other
keycode is able to produce the section keysym. I thought about that, and
I think it would be more expensive to implement.

> 	    /* but don't bind it again if already bound with shift, caps-lock

Please CC me any response, I am still not subscribed to the list.

bye,
Martin

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 7 Aug 2002 00:57:25 +0200

> I think it would be more expensive to implement.

Please try the next snapshot or current CVS code.  That should
resolve the problem.

Bye

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 7 Aug 2002 23:02:54 +0200

On Wed, Aug 07, 2002 at 09:19:25PM +0200, Martin Renold wrote:
> On Wed, Aug 07, 2002 at 12:57:25AM +0200, Dominik Vogt wrote:
> Thank you, it works! Though I do not yet understand how :-)

For years, I thought these mappings were server dependent and that
there was no way to figure them out.  Finally, I understood that
the mappings have no fixed meaning.  When you look at the output
of "xmodmap -pke" you can see that several keysyms can be bound to
a single keycode.  The first column denotes the symbol without any
modifiers pressed.  The second column denotes the symbol in
conjunction with shift.  But that's nothing the X server enforces,
it is merely a convention among all X clients.  All further
columns can be interpreted individually by each application.

So, the fix was simply to associate some modifiers with these
columns instead of whining about "unknown" modifiers.

> I will use your version and have a closer look in case it should fail
> somewhere else.

I'm going to add that patch to the next stable release too
(2.4.9).  This version will be released within one or two
weeks.

Bye

Dominik ^_^  ^_^