Hot Key Callback

I’m writing a new application. I have a menu bar with several menu buttons
on the menu bar. For each menu button I have defined an accelerator key
which correctly shows up as an underline. I have then attached hot key
callbacks using the same letter and the Alt key to call a code type
callback. I.E. Add button has defined Alt-A as a hot key callback to call
a code callback.

If I click on the button (there is also an activate callback that calls the
same callback) it works fine. But if I type Alt-A it does not call my
callback.

What might I be doing wrong?

This is a brand new app. The only widgets are the menu bar and a few menu
buttons. I don’t see how anything else can be intercepting the keystrokes.

“Bill Caroselli (Q-TPS)” <QTPS@earthlink.net> wrote:
: I’m writing a new application. I have a menu bar with several menu buttons
: on the menu bar. For each menu button I have defined an accelerator key
: which correctly shows up as an underline. I have then attached hot key
: callbacks using the same letter and the Alt key to call a code type
: callback. I.E. Add button has defined Alt-A as a hot key callback to call
: a code callback.

: If I click on the button (there is also an activate callback that calls the
: same callback) it works fine. But if I type Alt-A it does not call my
: callback.

: What might I be doing wrong?

: This is a brand new app. The only widgets are the menu bar and a few menu
: buttons. I don’t see how anything else can be intercepting the keystrokes.

Did you define the hotkey callbacks in the window or in the menu? You
should define them in the window (or in the container where you want to
invoke them).


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

“Steve Reid” <stever@qnx.com> wrote in message
news:apmn49$jlu$1@nntp.qnx.com

Did you define the hotkey callbacks in the window or in the menu? You
should define them in the window (or in the container where you want to
invoke them).

The hot key callbacks are defined for the Menu Buttons. I also tried

defining them for the window.

Just to clarify, there are no menu objects in my program. I am using the
menu bar and menu buttons because other older programs used the same
technique.

I figured it out.

Somehow I turned off Flags: Managed - Ph_WM_FOCUS on the window.
All is well now.

“Steve Reid” <stever@qnx.com> wrote in message
news:apmn49$jlu$1@nntp.qnx.com

“Bill Caroselli (Q-TPS)” <> QTPS@earthlink.net> > wrote:
: I’m writing a new application. I have a menu bar with several menu
buttons
: on the menu bar. For each menu button I have defined an accelerator key
: which correctly shows up as an underline. I have then attached hot key
: callbacks using the same letter and the Alt key to call a code type
: callback. I.E. Add button has defined Alt-A as a hot key callback to
call
: a code callback.

: If I click on the button (there is also an activate callback that calls
the
: same callback) it works fine. But if I type Alt-A it does not call my
: callback.

: What might I be doing wrong?

: This is a brand new app. The only widgets are the menu bar and a few
menu
: buttons. I don’t see how anything else can be intercepting the
keystrokes.

Did you define the hotkey callbacks in the window or in the menu? You
should define them in the window (or in the container where you want to
invoke them).


Steve Reid > stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems