Subject: FVWM: Binding 3 mystery keys

From: stu <[email-masked]>
Date: Tue, 17 Feb 2004 10:36:31 +0200

Hi everyone

I'm running fvwm 2.5.8, XFree86 4.3.0, Debian unstable.

I have a 106 key keyboard. There are 3 keys(top row, to right of
function keys) which I wish to bind. There appears to be no entry in
/usr/include/X11/keysymdef.h for any of these keys. The keys have
symbols on them - my interpretation of them is that they represent
a 'No lock' key, a 'sleep' key (symbol of a moon) and an 'alarm'
key. 

Does anyone have any advice as to how would I go about getting the
Keyname of these keys(or creating ones) so I could then bind them to my
desired functions?

The output of xev for these keys gives the following(besides the
headings in single quotes) :

'No lock key'

KeyPress event, serial 29, synthetic NO, window 0x1800001,
    root 0x8d, subw 0x0, time 2218910772, (576,439), root:(583,472),
    state 0x0, keycode 222 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:  ""

KeyRelease event, serial 29, synthetic NO, window 0x1800001,
    root 0x8d, subw 0x0, time 2218910861, (576,439), root:(583,472),
    state 0x0, keycode 222 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:  ""

'Sleep key'

KeyPress event, serial 29, synthetic NO, window 0x1800001,
    root 0x8d, subw 0x0, time 2218916146, (576,439), root:(583,472),
    state 0x0, keycode 223 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:  ""

KeyRelease event, serial 29, synthetic NO, window 0x1800001,
    root 0x8d, subw 0x0, time 2218916231, (576,439), root:(583,472),
    state 0x0, keycode 223 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:  ""

'Alarm key'

KeyPress event, serial 29, synthetic NO, window 0x1800001,
    root 0x8d, subw 0x0, time 2218917875, (576,439), root:(583,472),
    state 0x0, keycode 227 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:  ""

KeyRelease event, serial 29, synthetic NO, window 0x1800001,
    root 0x8d, subw 0x0, time 2218917931, (576,439), root:(583,472),
    state 0x0, keycode 227 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:  ""

Thanks!
-- 
Stuart Logie
Programmer

UNIVERSAL COMPUTER SERVICES (PTY) LTD
A member of South Africa's largest retail software vendor, the UCS Group

Tel : (011) 712 1371   Cell : 082 902 5632
Fax : (011) 339 3421
Internet : http://ucs.co.za

"I am the Unconquerable Spirit."
               -- Poet Unknown
   
Powered by Debian GNU/Linux - testing/unstable

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 17 Feb 2004 11:10:16 +0100

> Keyname of these keys(or creating ones) so I could then bind them to my

According to the xev output below, they have no names attached to
them yet.  To be able to bind anything to them, you need to assign
KeySyms to them first.  You can use xkeycaps to find a keyboard
layout that activates them and then let it generate an Xmodmap
file for it.  Or you can do that manually with the xmodmap
command.

>     XLookupString gives 0 bytes:  ""

Ciao

Dominik ^_^  ^_^
--
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: Erik Steffl <[email-masked]>
Date: Tue, 17 Feb 2004 13:43:38 -0800

> file for it.  Or you can do that manually with the xmodmap

   you can also look for the given keyboard model and if you can't find 
one create a new one, it's fairly simple (see xkb, config files in 
/etc/X11, probably, depends on distro)

	erik

---

From: stu <[email-masked]>
Date: Wed, 18 Feb 2004 12:54:24 +0200

On Tue, 17 Feb 2004 11:10:16 +0100
Dominik Vogt <[email-masked]> wrote:

> > Keyname of these keys(or creating ones) so I could then bind them to
> > my desired functions?
> 

Thanks for all the suggestions, everyone. For anyone who may be
interested, I created a .xmodmaprc file in my home directory containing:

keycode 222 = F33
keycode 223 = F34
keycode 227 = F35

I had to use F33, F34 and F35 (my keyboard doesn't have them) as xmodmap
complained if I used a keysym name that wasn't in keysymdef.h - I'm not
sure if it's safe to add my own entries to keysymdef.h. I've added

xmodmap .xmodmaprc

to my .xinitrc, and bound the above keys to some handy xmms functions.
It all works like a charm!
 
> Dominik ^_^  ^_^

Cheers
-- 
Stuart Logie
Programmer

---

From: Chris Rouch <[email-masked]>
Date: Wed, 18 Feb 2004 13:39:22 +0100

On Wed, 18 Feb 2004 12:54:24 +0200
stu <[email-masked]> wrote:

> I had to use F33, F34 and F35 (my keyboard doesn't have them) as
> xmodmap complained if I used a keysym name that wasn't in keysymdef.h
> - I'm not sure if it's safe to add my own entries to keysymdef.h. I've
> added
> 
> xmodmap .xmodmaprc
> 

If you look in /usr/X11R6/include/X11/XF86keysym.h there is a bunch of
additional keynames you can use. For example, in my .xmodmaprc I have

keycode 146 = XF86Mail
keycode 166 = XF86HomePage
keycode 158 = XF86Search

I find this easier to manage if the keynames have some resemblance to
the symbol printed on the keyboard.

Regards,

Chris
-----------------------------------------------------------------
Chris Rouch
[email-masked]

---

From: Ben Winslow <[email-masked]>
Date: Wed, 18 Feb 2004 07:48:05 -0500

> It all works like a charm!

FWIW, XFree86 has key symbols for these keys (defines in XF86keysym.h):
XF86PowerOff, XF86Sleep, and XF86WakeUp.  There are also some symbols
that may be more appropriate to what you're actually using the keys for,
such as XF86AudioNext.

-- 
Ben Winslow <[email-masked]>

---

From: stu <[email-masked]>
Date: Wed, 18 Feb 2004 15:59:46 +0200

On Wed, 18 Feb 2004 07:48:05 -0500
Ben Winslow <[email-masked]> wrote:

> > xmodmap complained if I used a keysym name that wasn't in
> > keysymdef.h - I'm not sure if it's safe to add my own entries to
> > keysymdef.h.
> 
> FWIW, XFree86 has key symbols for these keys (defines in
> XF86keysym.h): XF86PowerOff, XF86Sleep, and XF86WakeUp.  There are
> also some symbols that may be more appropriate to what you're actually
> using the keys for, such as XF86AudioNext.

Thanks! That's even better. I've changed my .xmodmaprc to bind to 
appropriate names, that I can easily trace back to my keyboard keys.

-- 
Stuart Logie
Programmer