Re: [pygtk] alt vs MOD1, MOD2, etc
- From: James Henstridge <james daa com au>
- To: Skip Montanaro <skip pobox com>
- Cc: <pygtk daa com au>, <gtk-list gnome org>
- Subject: Re: [pygtk] alt vs MOD1, MOD2, etc
- Date: Tue, 10 Jul 2001 09:42:49 +0800 (WST)
On Mon, 9 Jul 2001, Skip Montanaro wrote:
>
> I'm still fiddling around with interpreting keyboard input. I have this
> little key reader script:
[snip]
>
> which prints out the event's state and keyval, then a printable version of
> them. Output looks like
>
> state (0, 65513) : < > Alt_L
> state (64, 102) : < MOD4_MASK > f
> state (0, 65514) : < > Alt_R
> state (64, 102) : < MOD4_MASK > f
> state (0, 65407) : < > Num_Lock
> state (16, 102) : < MOD2_MASK > f
> state (16, 65407) : < MOD2_MASK > Num_Lock
> state (0, 102) : < > f
>
> What's confusing me is that the Gtk 2.0 docs say that <alt> is an alias for
> <mod1>. On my laptop at least (Dell 7500 running Mandrake 8.0 and XFree86
> 4.0.3, patch level 7mdk), I see the following correspondence between keys
> and modmask bits:
>
> Alt_L MOD4
> Alt_R MOD4
> Num_Lock MOD2
> Scroll_Lock MOD5
Modifiers are configurable in X. You can get the list of modifiers by
typing "xmodmap". Maybe your windows keys are mapped to mod1 or
something? For my system (no windows keys), I have the following mapping:
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x6d)
mod1 Alt_L (0x40), Alt_R (0x71)
mod2 Num_Lock (0x4d)
mod3
mod4
mod5 Scroll_Lock (0x4e)
If X is configured for a windows keyboard, you will also have Meta_[LR]
keys bound to one of the modifiers, and maybe also the menu key.
James.
--
Email: james daa com au
WWW: http://www.daa.com.au/~james/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]