Programmatic Cursor Control in qnx 6.5

Hi QNX Masters,

I am wondering if there is a way to programmatically control the cursor in photon/qnx6.5.

I am aware of the funtions gf_cursor_enable, gf_cursor_set, and gf_cursor_set_pos which
allow me to create and move a cursor, but not click one.

I have also tried emitting pointer events at specific coordinates.
This works well for simple mouse clicks, but not so much for scrolling or click and drag operations.
I am aware of the PhInitDrag function but it seems to be for setting up custom dragging in a photon application, not cursor programming at a system level.

In linux based operation systems, there is typically a dev/input/mouse or dev/input/event file that can be read or written too to watch or generate input events as seen here:

Is there anything like this in qnx?

Is there any third party solution or general guidance on how to approach programmatic pointer control?

I think (been forever since I used Photon) you want PhEventEmit()

Here’s an old sample of is being used for a keyboard press

Tim

I know this won’t be all that helpful, but you should be able to simulate all mouse events with the PhEventEmit() function. The reason I say this is that the mouse driver itself is doing this in response to hardware input from the mouse. The problem might be that you have to be precise as to where the events eminate from on the screen.

Hey thanks for this, I’ve been attempting the PhEmit Route for a bit but I’m unable to get drag events working. I’ve tried using the Ph_EV_BUT_MOTION events to trip drag events but No luck.

I did some testing and I attached event callbacks a scrollbar widget to capture all the event data it receives. And I get back a fairly typical sequence of Ph_EV_DRAG events.

The only problem is that these drag events require boundry and rect information. It would be simple to get this info in my own photon application, but this is for system wide cursor control.

Is there any way to go from cursor position to widget information for every application? I can get the reigon under my cursor with PhCursorQuery but I don’t see a way to move forward from there.

The only other way I can think of setting this up is to hijack the resource manager data flow from device->io-hid->devi-hid->photon

sending hid reports to devi-hid looks promising but I’m still working out how to do that or if it’s possible.

Hey thanks for this, I’ve been attempting the PhEmit Route for a bit but I’m unable to get drag events working. I’ve tried using the Ph_EV_BUT_MOTION events to trip drag events but No luck.

I did some testing and I attached event callbacks a scrollbar widget to capture all the event data it receives. And I get back a fairly typical sequence of Ph_EV_DRAG events.

The only problem is that these drag events require boundry and rect information. It would be simple to get this info in my own photon application, but this is for system wide cursor control.

Is there any way to go from cursor position to widget information for every application? I can get the reigon under my cursor with PhCursorQuery but I don’t see a way to move forward from there.

The only other way I can think of setting this up is to hijack the resource manager data flow from device->io-hid->devi-hid->photon

sending hid reports to devi-hid looks promising but I’m still working out how to do that or if it’s possible.

There’s a lot here and it all seems a little confusing but I’ll address one aspect of this. “widget information for every application”. This is an idea that doesn’t make sense in Photon. Widgets are a construct that only exist in a program, not system wide. System wide you have events moving through Photon space regions. That’s it. That’s what widgets deal with at a fundamental level.

It is possible to have an application with a region that covers all of Photon space. Such a region might be sensitive to events that are not absorbed by another region. In the Photon desktop there is such a program so that when you right click you get a menu. This is mediated by a program that is optional. Kill that program and no menus.