question on how binding names are set.


Moderators: I don’t know if this question goes here, if not, please feel free to move it to another thread.

So, here’s my question:

When a key is bound for a some specific function foo:

Key F4 A A funcFoo

F4 is pressed, and that function is executed.

So, here is my problem and my question: I have a keyboard with some ‘special’ buttons on it. This keyboard is for a machine built here at work. I know that when that key is pressed, a ‘code’ or ‘value’ of 207 comes across the system (I put a print out in the old TWM that I am replacing with FVWM, and I see the value being printed to the log) - HOW can I map that code value to some symbolic value that fvwm can understand? I am sure that ‘F4’ doesn’t come across the system, but that some other value, some number comes across, and that that value is mapped to the string, or symbol F4 – anyone know where or how this happens in the fvwm? Perhaps in events.c? Or some header file in the fvwm src?

If anyone has any ideas, or, if this message is inappropriate for this forum, please let me know.


This is what you’re looking for:

No, it’s fine here.

That’s right – so as not to put this explanation further down, the key on your keyboard labelled “F4” has already been mapped by the Xserver stored in a common file of keybaord layout definitions for all known or likely keyboards. But it needn’t be that way. If no such file was present - you would be free (and still are) to remap all of your keys to how you see fit.

OK, then I assume ‘207’ refers to the keycode and not the keysym of the key being pressed (there’s a difference between the two.) Most of us mere motals though, use the ever-present program xev to look up these keycodes. Armed with that information, adding the key to do something useful is then possible.

I think what you have to do, is to stop trying to solve what you perceive as deficiencies by continually thinking it can be re-coded. Indeed, you can gleam only the very top-level insight into bindings of this nature by reading the following:

I suspect what you’re asking though, is more along the lines of: “how can I setup a key to be used as a modifier.” – or even if you’re not, reading the main FVWM FAQ:

Is still going to help you here.

– Thomas Adam

Thomas –

I do believe that you are correct. I need to stop thinking that I am the only one who has ever tried to solve the problems that I have, and I need to try stop and ask around and see how other people have solved similar problems – I guess I have just spent too many years working in an environment where I had to work with code that was very, very poor.

Thanks for all your help - I sincerely appreciate it.


tBD –

Thanks for pointing me to the correct thread - worked perfectly.

I just had to write a file to mod the xmodmap and everything is working perfectly.

Thanks again,

Could ceating my own mapping to that button have changed the type of XEvent associated with it? E.g., becuse the button I am using is not a default button, is it possible that the XEvents associated with that key are no longer KeyPress and KeyRelease (using XKeyPressedEvent and XKeyReleasedEvent as it’s structures)?

my XEvent listener is not receiving any key press events for the keycode I have mapped in my supplemental .xmodmap that I wrote,

keycode 205 = F20

unless I add an FakeKeypress in the body of the fvwm Func in my .fvwm2rc in the form of :

+ I FakeKeypress press F20
+ I FakeKeypress release F20
........ do stuff ......

If anyone else has seen this problem when they have been forced to supplement the xModMap, I would really like to hear how they solved that problem.

– Skender

Ok – I was wrong.
You can’t change the event type simply by dropping a new map value to a key code.
Sorry for bothering everyone with a dumb question.

Indeed – and that’s deliberate. Events are generated by specific things. But please be aware that the event sent with a FakeKeyPress is synthetic and not real; as with an actual key press.

– Thomas Adam