Re: Creating ones own keyboard shortcuts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Iain Buchanan wrote:
> hmm xev looks good, but it doesn't register anything at all for 7 out of
> 8 of my 'extra' keys on the keyboard.  For the eighth it says
> (keysym 0x0, NoSymbol).  Its a 104 key keyboard with 8 extra keys along
> the top (so I guess its a 112 key keyboard!)  Is there any way I can
> detect these keys?
> 
> Thanks

The Xserver emits the keycodes & Keysyms.  You can update these using
xmodmap.  For instance, xev returns the following for my "window" key:

KeyPress event, serial 26, synthetic NO, window 0x1400002,
     root 0x4a, subw 0x0, time 472295996, (106,126), root:(229,871),
     state 0x0, keycode 115 (keysym 0x0, NoSymbol), same_screen YES,
     XLookupString gives 0 characters:  ""

Looking in /usr/X11R6/lib/X11/XKeysymDB  it looks like there keysym's
IA1 .. IA15 and IB1 .. IB16 might be available (I don't know what they're
really meant for).  Then I can map the keycode to a keysym with xmodmap

xmodmap -e 'keycode 115 = IA1 IB1'

And then for "window" and shift-"window":

KeyPress event, serial 26, synthetic NO, window 0x1400002,
     root 0x4a, subw 0x0, time 472672129, (77,42), root:(200,787),
     state 0x0, keycode 115 (keysym 0x10004101, IA1), same_screen YES,
     XLookupString gives 0 characters:  ""

KeyPress event, serial 26, synthetic NO, window 0x1400002,
     root 0x4a, subw 0x0, time 472673806, (77,42), root:(200,787),
     state 0x1, keycode 115 (keysym 0x10004201, IB1), same_screen YES,
     XLookupString gives 0 characters:  ""

Metacity might handle the modifier keys directly, so assiging
xmodmap -e 'keycode 115 = IA1'
might still allow <shift>IA1 and so on.
You'd have to put the xmodmap in a session startup file for that
workstation for it to have automatically have effect.

Looking in /etc/X11/xdm/Xsession, it looks like if you have a
/etc/X11/Xmodmap or $HOME/.Xmodmap file it will load that during
session startup.  Read the xmodmap man page for more.

Haven't been able to test this with metacity - gnome doesn't support
multiscreen until gnome 2.2.  But I hope this helps.

Cheers - Bob Arendt



-- 
Psyche-list mailing list
Psyche-list@redhat.com
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux