

The problem is that Motif uses XGrabKey to implement menu accelerators,
and these grabs are specific about which modifiers apply.  Unfortunately,
the specification for XGrabKey doesn't allow AnyModifier to be combined
with other modifiers, which is exactly what would be desired in this case:
"Ctrl Any<Key>q".


This is true for accelerators and mnemonics, which are implemented using
event handlers instead of grabs; it's not true for menu accelerators.  If
you're a Motif implementor, I'd suggest lobbying to get the Xlib semantics
changed to support the feature I described above.  Otherwise, change the
documentation for menu accelerators to properly set the user's
expectations, because menu accelerators are NOT the same thing as
translations.


If you mean "menu accelerator", no it's not possible.  That's according to
the definition of the XmNaccelerator resource in the XmLabel manual page.


I can't think of a reason why not.


There is a workaround for Motif users.  In addition to the normal menu
accelerator you install on the XmPushButton[Gadget], set an XtNaccelerators
resource on the shell (TopLevel or Application).  Install the shell's
accelerators on itself and all of its descendants with
XtInstallAllAccelerators (shell, shell).

For example,

  applicationShell - mainWindow - menuBar - fileCascade
					  -- filePulldown - openPushbutton
							  - exitPushbutton

  *openPushbutton.accelerator = Ctrl<Key>O
  *openPushbutton.acceleratorText = Ctrl+O
  *exitPushbutton.accelerator = Ctrl<Key>Q
  *exitPushbutton.acceleratorText = Ctrl+Q

  *applicationShell.accelerators = #override\n\
    Ctrl<Key>O: PerformAction(*openPushbutton, ArmAndActivate)\n\
    Ctrl<Key>Q: PerformAction(*exitPushbutton, ArmAndActivate)

You have to write and add the application action PerformAction, which you
can implement by using XtNameToWidget on the first argument and then
XtCallActionProc with the rest of the arguments.

I tested out something similar to this.  To shorten development time, I
used TeleUSE's TuNinstallAccelerators resource to install the accelerators
on the shell, and I directly invoked the Open and Quit D actions instead
of asking the pushbuttons to do it for me, but the more general approach I
described above should work.