Problem with Caps_Lock and Accelerator keys - Motif

This is a discussion on Problem with Caps_Lock and Accelerator keys - Motif ; Sorry, the app in question calls XtSetValues and XtInstallAllAccelerators to set up the menu accelerators so I figured I would post in comp.windows.x 8-( I did read since that Motif can override Xt accelerator key handling but I do not ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Problem with Caps_Lock and Accelerator keys

  1. Problem with Caps_Lock and Accelerator keys

    Sorry, the app in question calls XtSetValues and XtInstallAllAccelerators to
    set up the menu accelerators so I figured I would post in comp.windows.x 8-(

    I did read since that Motif can override Xt accelerator key handling but I
    do not know enough at this point to tell which level is at work here. Sorry
    for being sketchy but I am accessing the news groups from home and do not
    have access to source code right now and my photographic memory got
    overexposed somewhere (can't quite remember when). BTW, I have next to no
    experience with Motif, X or even C programming but I can put 2 and 2
    together, I just need some help finding them.

    Are the Xt... calls enough to determine which toolkit or is there something
    else (like Mwm...) that I should look for? I know Motif is installed but I
    don't think there are any Mwm... calls (uses Xt(app?)Initialize, etc). I
    will take a look at the build/make files.

    I believe the DECstations were running Digital Unix 4.0G and the Alphas are
    Tru64 Unix 5.1B; not sure what X11 or Motif levels but will find out in case
    it helps. I suppose a book or two wouldn't hurt either, eh?

    Thanks,
    "De..." Bill

    ps Can a resource file be setup after the fact or does the app have to be
    programmed to implement it? If so, can "Lock Mod1x" be added there?
    Would adding "Lock Mod1x" definitions to the source overcome the Caps
    Lock lockout?


    "Michel Bardiaux" wrote in message
    news:aeWdneycpYPq4HfdRVn2jw@scarlet.biz...
    > Bill wrote:
    >
    > > I have a program that uses accelerator keys and they used to work with

    the
    > > Caps_Lock key on a DECstation but not since upgrading to Tru64 Unix on

    an
    > > Alphastation. I have found some references to this problem but no
    > > solutions; apparently, newer versions of X11 (Motif perhaps?) have

    altered
    > > the meaning of the Caps Lock, Shift Lock, NumLock and perhaps the whole
    > > modifier keys concept but how do I get accelerator keys to ignore the
    > > Caps_Lock key?
    > >
    > > Many thanks to the geniuses who have muddled through this maze and can

    help
    > > me out!!
    > >
    > > De"cap"itated Bill
    > >
    > >

    > Impossible to answer without knowing which toolkit you're using. You
    > should repost in the appropriate group, e.g. c.w.x.motif. (Dont worry,
    > I'll be there!)
    >
    > --
    > Michel Bardiaux
    > Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
    > Tel : +32 2 790.29.41
    >




  2. Re: Problem with Caps_Lock and Accelerator keys

    I may have found a soultion! I noticed "nedit" had accelerator keys and
    lo-and-behold, they worked with the Caps-Lock key!!! I took a quick look at
    the source "util/misc.c" and found a potential fix - not as simple as I
    thought (hoped?) it would be! I hope I can implement it properly.

    Kudos to the Nirvana team, thank you.

    Bill

    "Bill" wrote in message
    news:6mxGc.35325$WB5.27449@pd7tw2no...
    > Sorry, the app in question calls XtSetValues and XtInstallAllAccelerators

    to
    > set up the menu accelerators so I figured I would post in comp.windows.x

    8-(
    >
    > I did read since that Motif can override Xt accelerator key handling but I
    > do not know enough at this point to tell which level is at work here.

    Sorry
    > for being sketchy but I am accessing the news groups from home and do not
    > have access to source code right now and my photographic memory got
    > overexposed somewhere (can't quite remember when). BTW, I have next to no
    > experience with Motif, X or even C programming but I can put 2 and 2
    > together, I just need some help finding them.
    >
    > Are the Xt... calls enough to determine which toolkit or is there

    something
    > else (like Mwm...) that I should look for? I know Motif is installed but

    I
    > don't think there are any Mwm... calls (uses Xt(app?)Initialize, etc). I
    > will take a look at the build/make files.
    >
    > I believe the DECstations were running Digital Unix 4.0G and the Alphas

    are
    > Tru64 Unix 5.1B; not sure what X11 or Motif levels but will find out in

    case
    > it helps. I suppose a book or two wouldn't hurt either, eh?
    >
    > Thanks,
    > "De..." Bill
    >
    > ps Can a resource file be setup after the fact or does the app have to

    be
    > programmed to implement it? If so, can "Lock Mod1x" be added there?
    > Would adding "Lock Mod1x" definitions to the source overcome the Caps
    > Lock lockout?
    >
    >
    > "Michel Bardiaux" wrote in message
    > news:aeWdneycpYPq4HfdRVn2jw@scarlet.biz...
    > > Bill wrote:
    > >
    > > > I have a program that uses accelerator keys and they used to work with

    > the
    > > > Caps_Lock key on a DECstation but not since upgrading to Tru64 Unix on

    > an
    > > > Alphastation. I have found some references to this problem but no
    > > > solutions; apparently, newer versions of X11 (Motif perhaps?) have

    > altered
    > > > the meaning of the Caps Lock, Shift Lock, NumLock and perhaps the

    whole
    > > > modifier keys concept but how do I get accelerator keys to ignore the
    > > > Caps_Lock key?
    > > >
    > > > Many thanks to the geniuses who have muddled through this maze and can

    > help
    > > > me out!!
    > > >
    > > > De"cap"itated Bill
    > > >
    > > >

    > > Impossible to answer without knowing which toolkit you're using. You
    > > should repost in the appropriate group, e.g. c.w.x.motif. (Dont worry,
    > > I'll be there!)
    > >
    > > --
    > > Michel Bardiaux
    > > Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
    > > Tel : +32 2 790.29.41
    > >

    >
    >




  3. Re: Problem with Caps_Lock and Accelerator keys

    Bill wrote:

    > I may have found a soultion! I noticed "nedit" had accelerator keys and
    > lo-and-behold, they worked with the Caps-Lock key!!! I took a quick look at
    > the source "util/misc.c" and found a potential fix - not as simple as I
    > thought (hoped?) it would be! I hope I can implement it properly.


    Good for you. If you have no Xm... calls in your source code, then Motif
    is not used, even if it is installed. You can check even if you dont
    have the source, by using "nm -B the executable" and grepping for Xm.

    I have no experience at all with Xt accelerators, only with Motif
    accelerators, but my solution (or rather, the one I use, I did not
    invent it) should work for you too: I use my own event loops, and patch
    all Button events to remove all modifiers except shift and control.

    >
    > Kudos to the Nirvana team, thank you.
    >
    > Bill
    >
    > "Bill" wrote in message
    > news:6mxGc.35325$WB5.27449@pd7tw2no...
    >
    >>Sorry, the app in question calls XtSetValues and XtInstallAllAccelerators

    >
    > to
    >
    >>set up the menu accelerators so I figured I would post in comp.windows.x

    >
    > 8-(
    >
    >>I did read since that Motif can override Xt accelerator key handling but I
    >>do not know enough at this point to tell which level is at work here.

    >
    > Sorry
    >
    >>for being sketchy but I am accessing the news groups from home and do not
    >>have access to source code right now and my photographic memory got
    >>overexposed somewhere (can't quite remember when). BTW, I have next to no
    >>experience with Motif, X or even C programming but I can put 2 and 2
    >>together, I just need some help finding them.
    >>
    >>Are the Xt... calls enough to determine which toolkit or is there

    >
    > something
    >
    >>else (like Mwm...) that I should look for? I know Motif is installed but

    >
    > I
    >
    >>don't think there are any Mwm... calls (uses Xt(app?)Initialize, etc). I
    >>will take a look at the build/make files.
    >>
    >>I believe the DECstations were running Digital Unix 4.0G and the Alphas

    >
    > are
    >
    >>Tru64 Unix 5.1B; not sure what X11 or Motif levels but will find out in

    >
    > case
    >
    >>it helps. I suppose a book or two wouldn't hurt either, eh?
    >>
    >>Thanks,
    >>"De..." Bill
    >>
    >>ps Can a resource file be setup after the fact or does the app have to

    >
    > be
    >
    >>programmed to implement it? If so, can "Lock Mod1x" be added there?
    >>Would adding "Lock Mod1x" definitions to the source overcome the Caps
    >>Lock lockout?
    >>
    >>
    >>"Michel Bardiaux" wrote in message
    >>news:aeWdneycpYPq4HfdRVn2jw@scarlet.biz...
    >>
    >>>Bill wrote:
    >>>
    >>>
    >>>>I have a program that uses accelerator keys and they used to work with

    >>
    >>the
    >>
    >>>>Caps_Lock key on a DECstation but not since upgrading to Tru64 Unix on

    >>
    >>an
    >>
    >>>>Alphastation. I have found some references to this problem but no
    >>>>solutions; apparently, newer versions of X11 (Motif perhaps?) have

    >>
    >>altered
    >>
    >>>>the meaning of the Caps Lock, Shift Lock, NumLock and perhaps the

    >
    > whole
    >
    >>>>modifier keys concept but how do I get accelerator keys to ignore the
    >>>>Caps_Lock key?
    >>>>
    >>>>Many thanks to the geniuses who have muddled through this maze and can

    >>
    >>help
    >>
    >>>>me out!!
    >>>>
    >>>>De"cap"itated Bill
    >>>>
    >>>>
    >>>
    >>>Impossible to answer without knowing which toolkit you're using. You
    >>>should repost in the appropriate group, e.g. c.w.x.motif. (Dont worry,
    >>>I'll be there!)
    >>>
    >>>--
    >>>Michel Bardiaux
    >>>Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
    >>>Tel : +32 2 790.29.41
    >>>

    >>
    >>

    >
    >



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


  4. Re: Problem with Caps_Lock and Accelerator keys



    Michel Bardiaux wrote:
    >
    > Bill wrote:
    >
    > > I may have found a soultion! I noticed "nedit" had accelerator keys and
    > > lo-and-behold, they worked with the Caps-Lock key!!! I took a quick look at
    > > the source "util/misc.c" and found a potential fix - not as simple as I
    > > thought (hoped?) it would be! I hope I can implement it properly.

    >
    > Good for you. If you have no Xm... calls in your source code, then Motif
    > is not used, even if it is installed. You can check even if you dont
    > have the source, by using "nm -B the executable" and grepping for Xm.
    >
    > I have no experience at all with Xt accelerators, only with Motif
    > accelerators, but my solution (or rather, the one I use, I did not
    > invent it) should work for you too: I use my own event loops, and patch
    > all Button events to remove all modifiers except shift and control.
    >

    The problem with this solution is that the user can't use CapLock to
    enter a long sequence of capital letters - she has to hold the Shift
    down when typing all keys.

    > >
    > > Kudos to the Nirvana team, thank you.
    > >
    > > Bill
    > >
    > > "Bill" wrote in message
    > > news:6mxGc.35325$WB5.27449@pd7tw2no...
    > >
    > >>Sorry, the app in question calls XtSetValues and XtInstallAllAccelerators

    > >
    > > to
    > >
    > >>set up the menu accelerators so I figured I would post in comp.windows.x

    > >
    > > 8-(
    > >
    > >>I did read since that Motif can override Xt accelerator key handling but I
    > >>do not know enough at this point to tell which level is at work here.

    > >
    > > Sorry
    > >
    > >>for being sketchy but I am accessing the news groups from home and do not
    > >>have access to source code right now and my photographic memory got
    > >>overexposed somewhere (can't quite remember when). BTW, I have next to no
    > >>experience with Motif, X or even C programming but I can put 2 and 2
    > >>together, I just need some help finding them.
    > >>
    > >>Are the Xt... calls enough to determine which toolkit or is there

    > >
    > > something
    > >
    > >>else (like Mwm...) that I should look for? I know Motif is installed but

    > >
    > > I
    > >
    > >>don't think there are any Mwm... calls (uses Xt(app?)Initialize, etc). I
    > >>will take a look at the build/make files.
    > >>
    > >>I believe the DECstations were running Digital Unix 4.0G and the Alphas

    > >
    > > are
    > >
    > >>Tru64 Unix 5.1B; not sure what X11 or Motif levels but will find out in

    > >
    > > case
    > >
    > >>it helps. I suppose a book or two wouldn't hurt either, eh?
    > >>
    > >>Thanks,
    > >>"De..." Bill
    > >>
    > >>ps Can a resource file be setup after the fact or does the app have to

    > >
    > > be
    > >
    > >>programmed to implement it? If so, can "Lock Mod1x" be added there?
    > >>Would adding "Lock Mod1x" definitions to the source overcome the Caps
    > >>Lock lockout?
    > >>
    > >>
    > >>"Michel Bardiaux" wrote in message
    > >>news:aeWdneycpYPq4HfdRVn2jw@scarlet.biz...
    > >>
    > >>>Bill wrote:
    > >>>
    > >>>
    > >>>>I have a program that uses accelerator keys and they used to work with
    > >>
    > >>the
    > >>
    > >>>>Caps_Lock key on a DECstation but not since upgrading to Tru64 Unix on
    > >>
    > >>an
    > >>
    > >>>>Alphastation. I have found some references to this problem but no
    > >>>>solutions; apparently, newer versions of X11 (Motif perhaps?) have
    > >>
    > >>altered
    > >>
    > >>>>the meaning of the Caps Lock, Shift Lock, NumLock and perhaps the

    > >
    > > whole
    > >
    > >>>>modifier keys concept but how do I get accelerator keys to ignore the
    > >>>>Caps_Lock key?
    > >>>>
    > >>>>Many thanks to the geniuses who have muddled through this maze and can
    > >>
    > >>help
    > >>
    > >>>>me out!!
    > >>>>
    > >>>>De"cap"itated Bill
    > >>>>
    > >>>>
    > >>>
    > >>>Impossible to answer without knowing which toolkit you're using. You
    > >>>should repost in the appropriate group, e.g. c.w.x.motif. (Dont worry,
    > >>>I'll be there!)
    > >>>
    > >>>--
    > >>>Michel Bardiaux
    > >>>Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
    > >>>Tel : +32 2 790.29.41
    > >>>
    > >>
    > >>

    > >
    > >

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


    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Common User Interface Services
    M/S 2R-94 (206)544-5225

  5. Re: Problem with Caps_Lock and Accelerator keys

    Bill wrote:

    > I may have found a soultion! I noticed "nedit" had accelerator keys and
    > lo-and-behold, they worked with the Caps-Lock key!!! I took a quick look
    > at the source "util/misc.c" and found a potential fix - not as simple as I
    > thought (hoped?) it would be! I hope I can implement it properly.
    >
    > Kudos to the Nirvana team, thank you.


    Now there's a coincidence! This thread appeared on my news server on the
    very same day I posted "Modifiers and Menu Accelerators" asking for help
    with what looks like exactly the same problem. I'm pleased to see that the
    authors of nedit think this problem is a bug too!

    The nedit solution is very clever and will cope with accelerators defined by
    the user in resource files. If you don't need to deal with that, then you
    can simplify it a bit: if you're going to hardcode the accelerator resource
    settings, you already know what you want, so you don't have to unparse the
    accelerator settings - you just need to do the XtGrabKey calls for the
    particular accelerator keys you want.

    On reflection, my work-around using XtAppAddAction has the advantage that
    the user can control whether or not caps lock (or other modifiers) matter
    and can even have several different "pseudo-accelerators" (actually
    implemented as actions) for one function. In my application, I realise now
    that it would make sense to have a general action function letting the user
    drive the menu system from the keyboard "programmatically" via translations
    resources.

    So now I'm debating whether or not to implement something like the nedit
    scheme or whether to have a general action interface for driving the menus
    in my application. (Just like waiting for a bus, you wait for years for a
    solution and then two turn up at once!).

    Regards,

    Rob.

+ Reply to Thread