PhAB and a Raw callback

I was tring to capture mouse events under my application and as always
I was tring to “prebuild” my test application using PhAB.

I’ve setup a plain project with an empty window. Under this window
I’ve setup a raw callback with only Ph_EV_PTR_NOBUTTON
Ph_EV_PTR_BUTTON set in the mask. A sample callback function
(moveIt™) was set for capturing this event.

As documented I should receive a Ph_EV_PTR_BUTTON or Ph_EV_PTR_BUTTON
events only under my callback function. The PtCallbackInfo_t
structure should handle a PhEvent_t* under event and a
PhPointerEvent_t* under cbdata.

Sadly, here’s what I receive:

Breakpoint 1, moveIt (widget=0x804f460,
apinfo=0x804794c, cbinfo=0x8047a74)
at …/moveIt.cc:20
20 PhEvent_t* event = cbinfo->event;
(gdb) print cbinfo
$1 = (Pt_callback_info *) 0x8047a74
(gdb) print *cbinfo
$2 = {reason = 1011, reason_subtype = 8, event = 0x804e704, cbdata = 0x0}
(gdb) print cbinfo->event
$3 = (Ph_event *) 0x804e704
(gdb) print *cbinfo->event
$4 = {type = 8, subtype = 0, processing_flags = 0, emitter = {rid = 1,
handle = 0}, collector = {rid = 131, handle = 134542432}, input_group = 1,
flags = 64, timestamp = 6200608, translation = {x = -25, y = -809},
num_rects = 1, data_len = 40}

cbdata is NULL. Probably I’m missing something :slight_smile:, It’s about 3
months that I do no longer code under photon.


Wave++

Hi,

I was tring to capture mouse events under my application and as always
I was tring to “prebuild” my test application using PhAB.

I’ve setup a plain project with an empty window. Under this window
I’ve setup a raw callback with only Ph_EV_PTR_NOBUTTON
Ph_EV_PTR_BUTTON set in the mask. A sample callback function
(moveIt™) was set for capturing this event.

As documented I should receive a Ph_EV_PTR_BUTTON or Ph_EV_PTR_BUTTON
events only under my callback function. The PtCallbackInfo_t
structure should handle a PhEvent_t* under event and a
PhPointerEvent_t* under cbdata.

Sadly, here’s what I receive:

Breakpoint 1, moveIt (widget=0x804f460,
apinfo=0x804794c, cbinfo=0x8047a74)
at …/moveIt.cc:20
20 PhEvent_t* event = cbinfo->event;
(gdb) print cbinfo
$1 = (Pt_callback_info *) 0x8047a74
(gdb) print *cbinfo
$2 = {reason = 1011, reason_subtype = 8, event = 0x804e704, cbdata = 0x0}
(gdb) print cbinfo->event
$3 = (Ph_event *) 0x804e704
(gdb) print *cbinfo->event
$4 = {type = 8, subtype = 0, processing_flags = 0, emitter = {rid = 1,
handle = 0}, collector = {rid = 131, handle = 134542432}, input_group = 1,
flags = 64, timestamp = 6200608, translation = {x = -25, y = -809},
num_rects = 1, data_len = 40}

cbdata is NULL. Probably I’m missing something > :slight_smile:> , It’s about 3
months that I do no longer code under photon.

You get the pointer event data like this,
PhPointerEvent_t *ptr = PhGetData( cbinfo->event );

Julian Kinraid