Menu

#173 Command not mapped to mod1

open
X server (105)
5
2002-04-03
2002-03-14
No

Command is not mapped to mod1 under XDarwin 1.1 /
XFree86 4.2.0 (the Jan 21 2002 release) and I can't
find any other key that will generate it. The output
of xmodmap is as follows:

xmodmap: up to 2 keys per modifier, (keycodes in
parentheses):

shift Shift_L (0x40), Shift_R (0x44)
lock Caps_Lock (0x41)
control Control_L (0x43), Control_R (0x46)
mod1 Mode_switch (0x42), Alt_R (0x45)
mod2 Meta_L (0x3f)
mod3
mod4
mod5

I'm running OS X 10.1.2, never installed a prior
version of XDarwin, and do not have any .x*
configuration files in my home directory. I realize I
can use xmodmap to remap keys, but expected it to work
by default.

Discussion

  • Torrey T. Lyons

    Torrey T. Lyons - 2002-04-03
    • assigned_to: nobody --> torrey
     
  • Torrey T. Lyons

    Torrey T. Lyons - 2002-04-03

    Logged In: YES
    user_id=133579

    Your Command (Apple) key generates Meta_L in the default
    keyboard map and has since the original XDarwin. As you can
    see from the xmodmap output, this is mod2 by default. As I
    recall this moved with XDarwin 1.1. It used to be mod3 and
    mod2 was left unused. In any case, the Option key generates
    Mode-switch and mod1. There is some debate as to which key
    should be mod1 and which mod2 by default, but we have tried
    to generally follow what XFree86 does on other platforms. If
    you have a reason why Command = mod2 and Option = mod1 is
    the wrong thing to do, we'd be curious to hear it.

     
  • Torrey T. Lyons

    Torrey T. Lyons - 2002-04-03

    Logged In: YES
    user_id=133579

    P.S. Perhaps what you are noticing is instead that there is
    no way with the default keymap to generate Alt_L, which is
    often mapped to mod1. This has changed since XDarwin 1.1. We
    may add an easy way to change this in the preferences. The
    problem is that some users expect Option to give Alt_L and
    some expect it to give access to foreign characters
    (Mode_switch). In XDarwin 1.1 we leave it up to the user to
    set with xmodmap.

     
  • John Ehresman

    John Ehresman - 2002-04-04

    Logged In: YES
    user_id=22785

    The problem is that in my setup, the option key generates
    Mode_switch and pressing other keys while it's down
    generates foreign characters that don't have the mod1 bit
    set in the state field. The following is the output of xev
    from pressing option and then a:

    KeyPress event, serial 22, synthetic NO, window 0xa00001,
    root 0x36, subw 0x0, time 27947915, (-241,215),
    root:(468,275),
    state 0x0, keycode 66 (keysym 0xff7e, Mode_switch),
    same_screen YES,
    XLookupString gives 0 characters: ""

    KeyPress event, serial 22, synthetic NO, window 0xa00001,
    root 0x36, subw 0x0, time 27950988, (-241,215),
    root:(468,275),
    state 0x2000, keycode 8 (keysym 0xe5, aring),
    same_screen YES,
    XLookupString gives 1 characters: "e"

    KeyRelease event, serial 22, synthetic NO, window 0xa00001,
    root 0x36, subw 0x0, time 27951243, (-241,215),
    root:(468,275),
    state 0x2000, keycode 8 (keysym 0xe5, aring),
    same_screen YES,
    XLookupString gives 1 characters: "e"

    KeyRelease event, serial 22, synthetic NO, window 0xa00001,
    root 0x36, subw 0x0, time 27961899, (-241,215),
    root:(468,275),
    state 0x2000, keycode 66 (keysym 0xff7e, Mode_switch),
    same_screen YES,
    XLookupString gives 0 characters: ""

    From your comment, it sounds like I can remap option to
    Alt_R with xmodmap. The problem is I want to distribute my
    program to end users who don't know anything about X and
    don't want to teach them about xmodmap. This might be an
    argument in favor of mapping Command to mod1 by default.

     
  • Torrey T. Lyons

    Torrey T. Lyons - 2002-04-06

    Logged In: YES
    user_id=133579

    Hmm... Good point. I will look into this more, but I should point out that you can specify a default xmodmap file for your users so that the mappings get done "behind the scenes". One way to do this would be if you were using the default xinitrc file (vanilla XFree86), when you put a file in /usr/X11R6/lib/X11/xinit/.Xmodmap it will automatically have xmodmap run on it when XDarwin starts. If you are installing a customized .xinitrc file or overwriting the system-wide default in /etc/X11/xinit/xinitrc then you can also make sure this happens. Of course, if you are not installing XFree86 as part of your application installation then all bets are off.

    BTW, the command you want to run to revert things to how you expect them is:

    xmodmap -e "keysym Mode_switch = Alt_L"

     
  • John Ehresman

    John Ehresman - 2002-04-08

    Logged In: YES
    user_id=22785

    What about the user that wants to use both foreign language
    characters and a key that generates mod1? Our current plan
    is not to distribute XDarwin with our application because of
    its size and the potential conflicts with another
    installation of XDarwin (or other X server).

     

Log in to post a comment.