View topic - Right Button Press event?

Right Button Press event?

Discussion about the general applications that run on QNX6

Right Button Press event?

Postby storm_k » Sun Dec 28, 2008 10:24 am

Hi all,

I want to respond right button press of the mouse,how can the program

know the action of the mouse? the left ,the right or the middle button?

Could somebody give me a example about the Right Click event?

thank you very much!
storm_k
Active Member
 
Posts: 18
Joined: Thu Sep 18, 2008 3:06 pm

RE: Right Button Press event?

Postby mario » Mon Dec 29, 2008 6:13 am

There is section in the documentation about this.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Right Button Press event?

Postby maschoen » Mon Dec 29, 2008 7:06 am

There are three approaches. Using Photon if you have a widget such as a button, you can connect a callback that will fire a routine when the button is pushed. Structures passed to the callback will tell you which button was pushed if you need it. A second approach is using a raw widget and making it sensitive to the events (mouse) that you want to find out about. This is more useful when you are doing something like a draw program and you want to catch drag events etc. Finally, although I have no idea of the details, there must be a way to tie into the mouse driver directly. I would only go this way if you want to use a mouse without Photon. As far as the details, as Mario corrected mentioned, check out the docs.
maschoen
QNX Master
 
Posts: 2720
Joined: Wed Jun 25, 2003 5:18 pm

RE: Right Button Press event?

Postby storm_k » Mon Dec 29, 2008 9:54 am

Thanks very much for you guys replying.

could you tell me where i can find the documentation?

I've read the HELP documention.But i am so stupid that can not write a programme to respond the mouse action under Photon.

Could you show me a simple example? Thanks very much!
storm_k
Active Member
 
Posts: 18
Joined: Thu Sep 18, 2008 3:06 pm

RE: Right Button Press event?

Postby maschoen » Mon Dec 29, 2008 6:04 pm

You won't get very far with QNX if you can't find the documentation. There is a program called the Help Viewer which is in the menus. Once it is running, on the left side you have various choices for topics. These can be opened up to get more detail. So you want to first find the Photon documentation. Within that there are details on 1) Widgets 2) Routines. These will help later but first you want to look at the user manual which will describe widgets and callbacks as well as using the App builder.
maschoen
QNX Master
 
Posts: 2720
Joined: Wed Jun 25, 2003 5:18 pm


Return to QNX6 - Applications

Who is online

Users browsing this forum: No registered users and 1 guest

cron