Filter Pt_CB_REPEAT

Hi, I’m modifying a photon App to run on a TouchScreen so I’m modifying all the pt_CB_MENU callbacks for pt_CB_REPEAT.

The problem is that if I keep my finger on an element the callback is called a lot of times.

I’m filtering this right now comparing widget and position but there has to be a better way to do it.

I’ve tried:
pevent = (PhPointerEvent_t) PhGetData(cbinfo->event)
pevent->click_count; But this always is set to 1.

Also, QNX Doc offers “pevent->z” which is said that “can be used with touchscreens to indicate touch pressure”.
But I don’t have any touch screen to test it and I don’t know if this could help.

Has anyone done anything similar?

there is example from my code:

if (cbinfo->event->type == Ph_EV_KEY)
{
PhKeyEvent_t *key_ev;
key_ev = (PhKeyEvent_t *)PhGetData( cbinfo->event );

// printf(“key_flag %x; key_cap %x\n”, key_ev->key_flags, key_ev->key_cap);

switch ( key_ev->key_cap )
	{	
	case Pk_F1:// F1 arm but not repeat
	if ( (key_ev->key_flags & Pk_KF_Key_Down) && !(key_ev->key_flags & Pk_KF_Key_Repeat) )
		{
		printf("key_flag %x\n", key_ev->key_flags);
		}
	else// F1 arm and repeat
	if ( (key_ev->key_flags & Pk_KF_Key_Down) && (key_ev->key_flags & Pk_KF_Key_Repeat) )
		{
		printf("key_flag %x\n", key_ev->key_flags);
		}
	else// disarm
	if ((key_ev->key_flags & 0x0F) == 0)
		{

// printf(“key_flag %x\n”, key_ev->key_flags);
}
break;
}
}