I’m writing an app for my embedded thingy that uses soft keys for menu
selection and navigation. the way I’m implementing it is to use
buttons with hotkey callbacks . i have a numeric keypad beside the
screen
that also has a,b,c,d so I’m using these for soft keys.
the problem i’m having is if i have a dialog with over top of the main
dialog the hotkey callbacks don’t work in the child dialog. if i
enable hotkeys first the button hotkey callbacks are activated by the
hotkeys even if it is covered up by the child.
i tried blocking the buttons on the main dialog in the hopes that the
child dialog would then start processing them but to no avail…
I’m probably missing some huge concept in photon programming as i am
very new to photon… can someone point out where I’m going wrong
here???
i get it… if the child window doesn’t have keyboard focus its hotkeys will be ignored… i would have though that when the child dialog was realized that i would have automaticly gotten screen and keyboard focus…
so if wanted to give the child dialog keyboard focus in its realize function how would i do this? would i use PtContainerGiveFocus() ?
vince…
Previously, Norbert Black wrote in qdn.public.qnxrtp.photon:
vince <> vgeisler@engineer.com> > wrote:
I’m writing an app for my embedded thingy that uses soft keys for menu
selection and navigation. the way I’m implementing it is to use
buttons with hotkey callbacks . i have a numeric keypad beside the
screen
that also has a,b,c,d so I’m using these for soft keys.
the problem i’m having is if i have a dialog with over top of the main
dialog the hotkey callbacks don’t work in the child dialog. if i
enable hotkeys first the button hotkey callbacks are activated by the
hotkeys even if it is covered up by the child.
i tried blocking the buttons on the main dialog in the hopes that the
child dialog would then start processing them but to no avail…
I’m probably missing some huge concept in photon programming as i am
very new to photon… can someone point out where I’m going wrong
here???
Yep – “keyboard focus” > > Each application has one (or
sometimes, no) widget that is marked be the first to get any
keyboard events that arrive at the application. There’s a
section on focus handling in the programmer’s guide, I believe.
Have a look at that, and see if the fog lifts, OK?
I’m writing an app for my embedded thingy that uses soft keys for menu
selection and navigation. the way I’m implementing it is to use
buttons with hotkey callbacks . i have a numeric keypad beside the
screen
that also has a,b,c,d so I’m using these for soft keys.
the problem i’m having is if i have a dialog with over top of the main
dialog the hotkey callbacks don’t work in the child dialog. if i
enable hotkeys first the button hotkey callbacks are activated by the
hotkeys even if it is covered up by the child.
i tried blocking the buttons on the main dialog in the hopes that the
child dialog would then start processing them but to no avail…
I’m probably missing some huge concept in photon programming as i am
very new to photon… can someone point out where I’m going wrong
here???
Yep – “keyboard focus” Each application has one (or
sometimes, no) widget that is marked be the first to get any
keyboard events that arrive at the application. There’s a
section on focus handling in the programmer’s guide, I believe.
Have a look at that, and see if the fog lifts, OK?
i get it… if the child window doesn’t have keyboard focus its
hotkeys will be ignored…
Yep, that’s it in a nutshell.
i would have though that when the child dialog was realized
that i would have automaticly gotten screen and keyboard focus…
That’s the default behaviour (at least with applications created
in PhAB) if any of the widgets in the dialog is marked as
focusable (Pt_GETS_FOCUS bit in Pt_ARG_FLAGS). Are you working
in PhAB, or creating completely from code?
Check to make sure the widgets you want to have keyboard input
are focusable. You might also want to look for Pt_SELECTABLE
while you’re looking, just to prevent another possible problem
(mouse input…) down the road.
so if wanted to give the child dialog keyboard focus in its
realize function how would i do this? would i use
PtContainerGiveFocus() ?
You can certainly swap focus around programmatically if you need
to. As I said, you may not need to.
On 8 Jan 2001 20:40:13 GMT, Norbert Black <nblack@qnx.com> wrote:
vince <> lab-101@usa.net> > wrote:
i get it… if the child window doesn’t have keyboard focus its
hotkeys will be ignored…
Yep, that’s it in a nutshell.
i would have though that when the child dialog was realized
that i would have automaticly gotten screen and keyboard focus…
That’s the default behaviour (at least with applications created
in PhAB) if any of the widgets in the dialog is marked as
focusable (Pt_GETS_FOCUS bit in Pt_ARG_FLAGS). Are you working
in PhAB, or creating completely from code?
Check to make sure the widgets you want to have keyboard input
are focusable. You might also want to look for Pt_SELECTABLE
while you’re looking, just to prevent another possible problem
(mouse input…) down the road.
so if wanted to give the child dialog keyboard focus in its
realize function how would i do this? would i use
PtContainerGiveFocus() ?
You can certainly swap focus around programmatically if you need
to. As I said, you may not need to.