Ctrl Right Click on PtText widget

Hi,

I have a Phab generated app with a PtText widget.

For the PtText widget, enable the Pt_CALLBACKS_ACTIVATE and Pt_MENUABLE.

Then generate, make and run the app.

If you hold the Ctrl key and Right Click on the widget, I get ‘% --S’
displayed in the widget’s text. Why? I’m sure this is documented
somewhere, I haven’t seen it!

I would like to setup a PtText widget and be able to get a Right Click
callback where I can check for the ‘Shift’, ‘Alt’ and ‘Ctrl’ key modifiers.
How do I do this without getting the ‘% --S’ string?

TIA

Augie

Augie Henriques <augiehenriques@hotmail.com> wrote:

I have a Phab generated app with a PtText widget.

For the PtText widget, enable the Pt_CALLBACKS_ACTIVATE and Pt_MENUABLE.

Then generate, make and run the app.

If you hold the Ctrl key and Right Click on the widget, I get ‘% --S’
displayed in the widget’s text. Why? I’m sure this is documented
somewhere, I haven’t seen it!

I would like to setup a PtText widget and be able to get a Right Click
callback where I can check for the ‘Shift’, ‘Alt’ and ‘Ctrl’ key modifiers.
How do I do this without getting the ‘% --S’ string?

Ctrl-Right click is a shortcut for Paste. Apparently, you have ‘% --S’
in your clipboard.

You could use a FILTER callback to consume the event before the widget
sees it.


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

“Wojtek Lerch” <wojtek@qnx.com> wrote in message
news:9kbo92$6ci$1@nntp.qnx.com

Augie Henriques <> augiehenriques@hotmail.com> > wrote:
I have a Phab generated app with a PtText widget.

For the PtText widget, enable the Pt_CALLBACKS_ACTIVATE and Pt_MENUABLE.

Then generate, make and run the app.

If you hold the Ctrl key and Right Click on the widget, I get ‘% --S’
displayed in the widget’s text. Why? I’m sure this is documented
somewhere, I haven’t seen it!

I would like to setup a PtText widget and be able to get a Right Click
callback where I can check for the ‘Shift’, ‘Alt’ and ‘Ctrl’ key
modifiers.
How do I do this without getting the ‘% --S’ string?

Ctrl-Right click is a shortcut for Paste. Apparently, you have ‘% --S’
in your clipboard.

You could use a FILTER callback to consume the event before the widget
sees it.

I read the little documentation that I coud find on Pt_CB_FILTER.

I setup a Pt_CB_FILTER callback for my PtText widget, but the callback never
gets called. The documentation for Pt_CB_FILTER is under PtContainer
widget. Is this only valid for the PtContainer widget?

How do I setup the Pt_CB_FILTER to get called for a PtText widget?

TIA

Augie


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.

Augie Henriques <augiehenriques@hotmail.com> wrote:

“Wojtek Lerch” <> wojtek@qnx.com> > wrote in message
news:9kbo92$6ci$> 1@nntp.qnx.com> …
Augie Henriques <> augiehenriques@hotmail.com> > wrote:
I have a Phab generated app with a PtText widget.

For the PtText widget, enable the Pt_CALLBACKS_ACTIVATE and Pt_MENUABLE.

Then generate, make and run the app.

If you hold the Ctrl key and Right Click on the widget, I get ‘% --S’
displayed in the widget’s text. Why? I’m sure this is documented
somewhere, I haven’t seen it!

I would like to setup a PtText widget and be able to get a Right Click
callback where I can check for the ‘Shift’, ‘Alt’ and ‘Ctrl’ key
modifiers.
How do I do this without getting the ‘% --S’ string?

Ctrl-Right click is a shortcut for Paste. Apparently, you have ‘% --S’
in your clipboard.

You could use a FILTER callback to consume the event before the widget
sees it.

I read the little documentation that I coud find on Pt_CB_FILTER.

I setup a Pt_CB_FILTER callback for my PtText widget, but the callback never
gets called. The documentation for Pt_CB_FILTER is under PtContainer
widget. Is this only valid for the PtContainer widget?

How do I setup the Pt_CB_FILTER to get called for a PtText widget?

Sorry, I was thinking about Photon 2.

In Photon 1.14, Pt_CB_FILTER only exists in containers. You can put
your text field in a PtGroup or PtPane, and attach the callback to the
parent. Here’s a callback function that works for me:

int cbfilter( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo ) {
PhPointerEvent_t const *pev = PhGetData( cbinfo->event );
if ( pev->buttons == Ph_BUTTON_MENU
&& pev->key_mods & Pk_KM_Ctrl
) {
ApCreateModule( ABM_menu, widget, cbinfo );
return Pt_END;
}
return Pt_CONTINUE;
}


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

“Wojtek Lerch” <wojtek@qnx.com> wrote in message
news:9kekj0$11b$1@nntp.qnx.com

Augie Henriques <> augiehenriques@hotmail.com> > wrote:

“Wojtek Lerch” <> wojtek@qnx.com> > wrote in message
news:9kbo92$6ci$> 1@nntp.qnx.com> …
Augie Henriques <> augiehenriques@hotmail.com> > wrote:
I have a Phab generated app with a PtText widget.

For the PtText widget, enable the Pt_CALLBACKS_ACTIVATE and
Pt_MENUABLE.

Then generate, make and run the app.

If you hold the Ctrl key and Right Click on the widget, I get ‘% --S’
displayed in the widget’s text. Why? I’m sure this is documented
somewhere, I haven’t seen it!

I would like to setup a PtText widget and be able to get a Right
Click
callback where I can check for the ‘Shift’, ‘Alt’ and ‘Ctrl’ key
modifiers.
How do I do this without getting the ‘% --S’ string?

Ctrl-Right click is a shortcut for Paste. Apparently, you have ‘% --S’
in your clipboard.

You could use a FILTER callback to consume the event before the widget
sees it.

I read the little documentation that I coud find on Pt_CB_FILTER.

I setup a Pt_CB_FILTER callback for my PtText widget, but the callback
never
gets called. The documentation for Pt_CB_FILTER is under PtContainer
widget. Is this only valid for the PtContainer widget?

How do I setup the Pt_CB_FILTER to get called for a PtText widget?

Sorry, I was thinking about Photon 2.

In Photon 1.14, Pt_CB_FILTER only exists in containers. You can put
your text field in a PtGroup or PtPane, and attach the callback to the
parent. Here’s a callback function that works for me:

int cbfilter( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
*cbinfo ) {
PhPointerEvent_t const *pev = PhGetData( cbinfo->event );
if ( pev->buttons == Ph_BUTTON_MENU
&& pev->key_mods & Pk_KM_Ctrl
) {
ApCreateModule( ABM_menu, widget, cbinfo );
return Pt_END;
}
return Pt_CONTINUE;
}

This will probably work, but I have several PtText widgets all inside the
group widget. Each text widget has its own set of callbacks. So, I don’t
see how to do this?

TIA

Augie


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.