Re: activating mnemonic with NumLock on - Motif

This is a discussion on Re: activating mnemonic with NumLock on - Motif ; Grant Gayed wrote: > Running our app on RedHat 8, I've found that attempting to activate a > menu item via its mnemonic (eg.- Alt+f for the File dropdown) does > not work if NumLock is on, but works fine ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Re: activating mnemonic with NumLock on

  1. Re: activating mnemonic with NumLock on

    Grant Gayed wrote:
    > Running our app on RedHat 8, I've found that attempting to activate a
    > menu item via its mnemonic (eg.- Alt+f for the File dropdown) does
    > not work if NumLock is on, but works fine if NumLock is off. I don't
    > see this problem on Solaris 9.
    >
    > Does anyone have any suggestions for making this work on RedHat 8?
    > Currently we simply set the XmNmnemonic resource on the
    > XmPushButtonGadget/XmCascadeButtonGadget. I was able to get around a
    > similar problem that involved accelerators by setting the
    > XmNaccelerator resource to a comma-separated list, but it doesn't
    > look like a similar approach can be used for XmNmnemonic.
    >
    > Thanks in advance, Grant
    >

    The only way I found is to fix every X keyboard event to remove all
    modifiers except shift and ctrl (thus, mod1 to mod5, and lock).
    (Augmenting the translation tables, just like the accelerator tables,
    should work, in theory, but I was never able to make it work).

    The problem is that *which* modifier corresponds to NUMLOCK depends on
    the X server! Eg NUMLOCK is MOD2 on my RedHat7.1 but MOD3 on EXCEED.
    Thus one needs to adapt code from xmodmap.c to obtain the modifier masks
    to be... well, masked out.

    I will post the code if you wish.

    --
    Michel Bardiaux
    Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
    Tel : +32 2 790.29.41


  2. Re: activating mnemonic with NumLock on

    Michel Bardiaux wrote:

    > The only way I found is to fix every X keyboard event to remove all
    > modifiers except shift and ctrl (thus, mod1 to mod5, and lock).
    > (Augmenting the translation tables, just like the accelerator tables,
    > should work, in theory, but I was never able to make it work).


    This is interesting. I never got this to work. The mnemonics are server-side
    grabs, and are filtered there, so the event never shows up!

    I do already have code that registers multiple accelerators for each
    combination, carefully masking out NumLock by using the xmodmap code, and that
    works okay. But it doesn't work menu mnemonics.

  3. Re: activating mnemonic with NumLock on

    Scott J. Tringali wrote:
    > Michel Bardiaux wrote:
    >
    >
    >>The only way I found is to fix every X keyboard event to remove all
    >>modifiers except shift and ctrl (thus, mod1 to mod5, and lock).
    >>(Augmenting the translation tables, just like the accelerator tables,
    >>should work, in theory, but I was never able to make it work).

    >
    >
    > This is interesting. I never got this to work. The mnemonics are server-side
    > grabs, and are filtered there, so the event never shows up!
    >
    > I do already have code that registers multiple accelerators for each
    > combination, carefully masking out NumLock by using the xmodmap code, and that
    > works okay. But it doesn't work menu mnemonics.


    Aaarrhh... of course you're right; in my app, I have *mouse* button
    events working regardless of numlock&caplock (by patching the events);
    and accelerators too by patching the tables, but my accelerators are
    bound to ALT+CHARACTER for compatibility with Netscape. Thus I had to
    disable all mnemonic processing, which sucks but makes interference
    between NUMLOCK and mnemonics unobservable!

    And everything that *does* work was implemented following your kind
    advice to me on this list, circa 2001-11-12!

    --
    Michel Bardiaux
    Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
    Tel : +32 2 790.29.41


+ Reply to Thread