PtAddHotkeyHandler

I’m trying to get a hotkey handler added from code. I want to process the
Alt-L keychord. I have tried
PtAddHotkeyHandler( ABW_file_select_dlg, Pk_L, Pk_KM_Alt, 0, NULL, load_CB );
and
PtAddHotkeyHandler( ABW_file_select_dlg, Pk_L, Pk_KM_Alt, Pt_HOTKEY_SYM, NULL, load_CB );

But neither of these traps the Alt-L keycord. What am I doing wrong?
BTW, I have successfully process other hotkeys.

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:
WL > “Bill Caroselli” <qtps@earthlink.net> wrote in message
WL > news:cedj17$n9m$1@inn.qnx.com

I’m trying to get a hotkey handler added from code. I want to process the
Alt-L keychord. I have tried
PtAddHotkeyHandler( ABW_file_select_dlg, Pk_L, Pk_KM_Alt, 0, NULL,
WL > load_CB );
and
PtAddHotkeyHandler( ABW_file_select_dlg, Pk_L, Pk_KM_Alt, Pt_HOTKEY_SYM,
WL > NULL, load_CB );

But neither of these traps the Alt-L keycord. What am I doing wrong?

WL > Since combinations of Alt (or Ctrl, in case you care) with anything other
WL > than function and cursor keys don’t generate a key sym, you have to use the
WL > key cap. And the caps of letter keys are always lower case. In other
WL > words, you should use Pk_l rather than Pk_L, and not set the Pt_HOTKEY_SYM
WL > flag.

Thank you. Works great, less filling too!

I didn’t think I wanted Pt_HOTKEY_SYM but you get desprate to try anything
that might work. I just didn’t think I needed to use lower case letters.

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:cedj17$n9m$1@inn.qnx.com

I’m trying to get a hotkey handler added from code. I want to process the
Alt-L keychord. I have tried
PtAddHotkeyHandler( ABW_file_select_dlg, Pk_L, Pk_KM_Alt, 0, NULL,
load_CB );
and
PtAddHotkeyHandler( ABW_file_select_dlg, Pk_L, Pk_KM_Alt, Pt_HOTKEY_SYM,
NULL, load_CB );

But neither of these traps the Alt-L keycord. What am I doing wrong?

Since combinations of Alt (or Ctrl, in case you care) with anything other
than function and cursor keys don’t generate a key sym, you have to use the
key cap. And the caps of letter keys are always lower case. In other
words, you should use Pk_l rather than Pk_L, and not set the Pt_HOTKEY_SYM
flag.

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:cedldf$p6a$2@inn.qnx.com

Thank you. Works great, less filling too!

:slight_smile:

I didn’t think I wanted Pt_HOTKEY_SYM but you get desprate to try anything
that might work. I just didn’t think I needed to use lower case letters.

I know: why do they always print upper case on keyboards?..

(BTW Check your computer’s clock. You replied to my message twenty minutes
before I sent it. If you were psychic, you wouldn’t need to post in the
newsgroup at all, would you? :wink:

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:

“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:cedldf$p6a$> 2@inn.qnx.com> …
Thank you. Works great, less filling too!

:slight_smile:

I didn’t think I wanted Pt_HOTKEY_SYM but you get desprate to try anything
that might work. I just didn’t think I needed to use lower case letters.

I know: why do they always print upper case on keyboards?..

Because a lower-case L looks too much like a 1? Because, in general,
the upper-case letters are easier to read/recognise individually?

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com

David Gibbs <dagibbs@qnx.com> wrote:

Because a lower-case L looks too much like a 1? Because, in general,
the upper-case letters are easier to read/recognise individually?

Because e. e. cummings wouldn’t seem so inspired?


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