Hi Miguel,
another point that you have to keep in mind is that Qt MousePressEvents never
have more than one "EventButton" attributes.
This makes sense as you will not be able to press two buttons at the same time.
To start an interaction with two mousebutton you always need two events:
- Mousebutton A with no other mousebutton pressed
- Mousebutton B while mousebutton A is already pressed (using the attribute
"ButtonState")
The same problem occurs when ending the interaction. You cannot release both
mousebuttons at the same time,
so you will need two events here as well.
Should look something like this:
<event_variant class="MousePressEvent" name="StartA">
<attribute name="EventButton" value="LeftMouseButton"/>
<attribute name="ButtonState" value="RightMouseButton"/>
</event_variant>
<event_variant class="MousePressEvent" name="StartB">
<attribute name="EventButton" value=" RightMouseButton "/>
<attribute name="ButtonState" value="LeftMouseButton"/>
</event_variant>
<event_variant class="MouseMoveEvent" name="BothButtonsPressedAndMove">
<attribute name="ButtonState" value="LeftMouseButton,RightMouseButton"/>
</event_variant>
<event_variant class="MouseReleaseEvent" name="StopA">
<attribute name="EventButton" value=" LeftMouseButton "/>
</event_variant>
<event_variant class="MouseReleaseEvent" name="StopB">
<attribute name="EventButton" value=" RightMouseButton "/>
</event_variant>
I have to admit that I'm not 100% sure about the two release events, but it
should look something like that.
Just to make this complete, if you are also using modifier-keys, you will have
to consider that you have another
button (the modifier) that can be released at any point. You will have to add
further release events in that case.
Greets,
Markus
-----Ursprüngliche Nachricht-----
Von: Weber, Christian(1) [mailto:[email protected]]
Gesendet: Montag, 20. Januar 2014 18:12
An: mitk-users
Betreff: Re: [mitk-users] Statemachine and interaction with multiple mouse
buttons
-----Ursprüngliche Nachricht-----
Von: Weber, Christian(1)
Gesendet: Montag, 20. Januar 2014 18:11
An: 'Miguel Nunes'
Betreff: AW: [mitk-users] Statemachine and interaction with multiple mouse
buttons
Hi Miguel,
the ButtonState attribute describes which buttons are pressed, which I think is
what you want. So you can define an event in the event config that has this for
a MouseMove event by simply listing both buttons (separated by comma) in the
ButtonState field like this:
<event_variant class="MouseMoveEvent" name="BothButtonsPressedAndMove">
<attribute name="ButtonState" value="LeftMouseButton,RightMouseButton"/>
</event_variant>
Hope this helps!
Best,
Christian
/ Config Documentation
http://docs.mitk.org/nightly-qt4/Step10Page.html#ConfigFileDescriptionSection
-----Ursprüngliche Nachricht-----
Von: Miguel Nunes [mailto:[email protected]]
Gesendet: Montag, 20. Januar 2014 17:29
An: [email protected]
Betreff: [mitk-users] Statemachine and interaction with multiple mouse buttons
Hello list,
I am wondering how I should set up the statemachine.xml and
statemachineConfig.xml files in order to have a function called when I have
both right and left button pressed + mouse moving around.
I looked around but found no satisfactory answers.
I manage to perform interactions with only one button + move. I think from one
state (ex: when right button clicked) it should be able to check if the other
is also clicked/pressed and change to the corresponding state.
Thanks in advance!
Best,
Miguel
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical
Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical
Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users