PDA

View Full Version : Combining events in QT



kinglui987
2nd November 2012, 14:48
Hey there,

i am pretty new to QT and C++ development, and this is my first post here.
Since im forced to use QT in my development, i would like to know, if it is possible to combine events with eachother.

Yet, i do not know much about QTs event system and how events are propagated, but lets imagine, i would like to combine touch/mouse gestures with pen input?

Is that possible in QT and are there any starting points?

i appreciate for any hint

wysota
2nd November 2012, 18:29
Combine them in what way?

kinglui987
7th November 2012, 10:12
Hey,

thanks for your reply. Sorry for my late answer, but id did not get a mail from the forum.

I would like to combine touch input and pen input. Lets say the user touches a screen and is simultanous able to use the pen with his other hand?

What i want to know is, is it possible to listen for this events in a parallel way? So when listening for touch events, it should always be possible to listen for pen input also?

Would that be possible?

wysota
7th November 2012, 10:16
It all depends on your input device, I guess. They are not coming at the same moment so they are going to be separate events. It is your responsibility to provide logic that considers them both at once. The pen will probably be a regular mouse event and the touch event is either going to be a mouse event too or a touch event (probably depending on the driver).

kinglui987
7th November 2012, 10:42
Hey my device supports this officially. It is a Wacom Cintiq HD touch, officially supporting parallel touch/pen input.
But iam not able to get both events in qt at teh same time, it seems that teh pen input is higher in priority, disabling the touch.

Is there anything one can do, to influence on this? I am pretty new to QT, sorrz if i am missing something.

Thanks a lot

alitoh
7th November 2012, 14:18
Isn't the logic behind data-input not far from a state machine?
Also, are pen and touch both touch events? or is one click and the other touch?
It's hard to predict what you are trying to do, can you give us a coded example?

As Wysota said, you do need to provide the logic for handling the input events which, on their own, are meaningless. If one is overriding the other, could it be they are the same type of input? Maybe checking for "isAlreadyPressed" or something along those lines when a new touch/click comes in?

These are just shots in the dark, to be honest. What you are asking is not out of this world, though.