QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Sending character to other program |
Ref. No. |
QNX.000009822 |
Category(ies) |
Development |
Issue |
We are developing a hand writing program. We need to send a character from hand writing program to PED. How can we inject character to PED, text widget, or browser? x09
|
Solution |
If you want to inject a key to the widget that currently has focus, you can create a key event and emit from any region.
e.g. x09PhEvent_t event; x09PhKeyEvent_t key; x09 x09PhRect_t rect = {SHRT_MIN, SHRT_MIN, SHRT_MAX, SHRT_MAX); x09memset(&event, 0, sizeof(event)); x09memset(&key, 0, sizeof(key)); x09event.type = Ph_EV_KEY; x09event.emitter.rid = fep_ff->rid; x09event.num_rects = 1; x09event.data_len = sizeof(key); x09event.input_group = ig; x09key.key_flags = Pk_KF_Key_Down | Pk_KF_Cap_Valid; x09key.key_cap = key.key_sym = c; x09PhEventEmit(&event, &rect, &key); The rid is the region id of where you want to emit from. |
|