Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Key event with PhEventEmit()
Ref. No. QNX.000009757
Category(ies) Development
Issue I am working on a touchscreen application and I want to simulate a key press after touching a button. I try to emit a Ph_EV_Key Event.
In my callbacks function PhEventEmit() always exits with -1.
What could be wrong?





Solution You need to check errno. Here are the latest docs for this function:

Returns
0 Success
-1 an error occured, or no further events are pending. Check the value of errno:
x09-If errno is ENOMSG, Photon had no messages enqueued to your application at the time you emitted the event.
x09-If errno isn't ENOMSG, an error occured.
These ruturn codes are useful for applications that spend most of their time emitting events and want to retrieve an event only if there is one pending for them.

You have to check where in the event space you want to emit to and from.
There are some examples in the free software section of the website http://www.qnx.com/cgi-bin/dir_find.cgi?/usr/free. Follow qnx-photon-utils. Or from ftp: /usr/free/qnx4/photon/utils.
See keypad.tgz and numpad.tgz.