catching keystoke

I’m trying to write photon application similar to kbsel ( switching keyboard
mappings ). I want to catch certain keystrokes and do specific actions. So I
created keyboard region ( Ph_KBD_REGION ), sensitive on Ph_EV_KEY event. I’m
able now to catch all keyboard event ( Shift, Alt, Ctrl, F1, … ) with
Pt_CB_FILTER or Pt_CB_RAW callback.

And here is my problem: is it possible to consume certrain keystoke that
application behind keyboard region ( any runnig app ) will not receive as
keyboard event? For example is it posible to filter ( or consume ) every
‘F1’ keystroke ( or pwm’s Ctrl-Esc, Ctrl-Alt-[1-9] )? All other unspecified
keyboard events remain untouched and will be received by application behind
region. How to do this? I tryied return Pt_END or Pt_HALT from callback - no
luck :frowning:

Please help.

// Creating PtRegion:
PtSetArg( &args[n++], Pt_ARG_AREA, &area, 0 );
PtSetArg( &args[n++], Pt_ARG_
PtSetArg( &args[n++], Pt_ARG_
PtSetArg( &args[n++], Pt_ARG_

Sorry, overstriking Alt-S. Here is complete message:

I’m trying to write photon application similar to kbsel ( switching keyboard
mappings ). I want to catch certain keystrokes and do specific actions. So I
created keyboard region ( Ph_KBD_REGION ), sensitive on Ph_EV_KEY event. I’m
able now to catch all keyboard event ( Shift, Alt, Ctrl, F1, … ) with
Pt_CB_FILTER or Pt_CB_RAW callback.

And here is my problem: is it possible to consume certain keystroke that
application behind keyboard region ( any running app ) will not receive as
keyboard event? For example is it possible to filter ( or consume ) every
‘F1’ keystroke ( or pwm’s Ctrl-Esc, Ctrl-Alt-[1-9] )? All other unspecified
keyboard events remain untouched and will be received by application behind
region. How to do this? I tried return Pt_END or Pt_HALT from callback - no
luck :frowning:

Please help.



// Creating PtRegion:
PtSetArg( &args[n++], Pt_ARG_AREA, &area, 0 );
PtSetArg( &args[n++], Pt_ARG_REGION_FIELDS, Pt_TRUE, Ph_REGION_PARENT |

Ph_REGION_FLAGS |

Ph_REGION_IN_FRONT |

Ph_REGION_IN_SENSE );
PtSetArg( &args[n++], Pt_ARG_REGION_FLAGS, Pt_TRUE, Ph_KBD_REGION |

Ph_FORCE_FRONT );
PtSetArg( &args[n++], Pt_ARG_REGION_SENSE, Pt_TRUE, Ph_EV_KEY );
PtSetArg( &args[n++], Pt_ARG_REGION_INFRONT, Ph_DEV_RID, 0 );
PtSetArg( &args[n++], Pt_ARG_COLOR, Pg_TRANSPARENT, 0 );
PtSetArg( &args[n++], Pt_CB_FILTER, &keyboardCB, NULL );
region = PtCreateWidget( PtRegion, NULL, n, args );

PtRealizeWidget( region )