Sear Michael,
please always include mitk-users at sourceforge to your CC list to also give 
the list the opportunity to listen and hopefully answer as well.

Yes, currently there are two files statemachine.xml in the repository. 
See bug #3701 (http://bugs.mitk.org/show_bug.cgi?id=3701) for further 
information. 
This will be changed in the future. 
The one in MITK/CoreUI/Bundles/org.mitk.gui.qt.common/resources is the one that 
is used when you start the ExtApp.
The file will be read during startup so that changes prior to startup will have 
an effect.
Please test again and be sure to change the right pattern.
(The Statemachine.zip file contains the statemachine editor ( 
http://mbits/doxygen/StatemachineEditor.html ).)

Merry X-Mas,
Ingmar

-----Ursprüngliche Nachricht-----
Von: Michael Emmersberger [mailto:[email protected]] 
Gesendet: Freitag, 17. Dezember 2010 18:04
An: Wegner Ingmar
Betreff: Re: [mitk-users] Receiving KeyEvents in an external tool

Dear Ingmar,

thanks for your answer. Things are a little clearer now, although one 
thing is still confusing me:
There are two statemachine.xml:
MITK/Core/Code and in MITK/CoreUI/Bundles/org.mitk.gui.qt.common/resources
But changes in either of them seem to be ignored. It does not matter if 
I add my own transitions, like the one you suggested or if I remove 
existing ones... the behavior stays the same.
Is it possible that global interaction gets its states and transitions 
from some different place?
We are using the Blueberry framework. I see that there is also a 
StateMachines.zip file, but I'm not quite sure what it is used for.

Best,
Michael


Am 15.12.2010 16:39, schrieb Wegner Ingmar:
> Dear Michael,
> the constants are listed in the file mitkInteractionConst.h located in 
> mitk/Core/Code/Interactions.
> There you will find a list of actions; one of them is AcNEWPOINT = 80.
> So you can rather use the constants to specify which method shall be called 
> when an action is sent to the object.
>
> See http://www.mitk.org/wiki/Interaction_concept for an introduction on the 
> interaction mechanism and also see tutorial step 10 as an example on how to 
> implement a new interactor (documentation currently down, will be up in a 
> little while).
>
> For the event listening you will have to adapt the state machine pattern of 
> your interactor (/ listener).
> The pattern is connected to the listener via a parameter (name of the pattern 
> in statemachine.xml) on instanciation of a statemachine object.
> You will have to take a different pattern or adapt the pattern to also wait 
> for an Esc-Key event (EIDESCAPE = 14; see statemachine.xml and 
> mitkInteractionConst.h).
> Inserting the followint lines into the state the state machine is currently 
> in will be enough:
>
> <transition NAME="OnEscape" EVENT_ID="14" NEXT_STATE_ID="0">
>       <action ID="48008" />  <!-- AcCancel -->
> </transition>
>
> Adapt NEXT_STATE_ID to e.g. stay in the same.
> Then you can connect a method in the way you previously described (use 
> AcCancel then) and the method will be called on ESC key press.
>
> Best regards,
> Ingmar
>
>
> -----Ursprüngliche Nachricht-----
> Von: Michael Emmersberger [mailto:[email protected]]
> Gesendet: Mittwoch, 15. Dezember 2010 15:51
> An: [email protected]
> Betreff: [mitk-users] Receiving KeyEvents in an external tool
>
>    Dear all,
>
> I have extended a plugin with an external tool. Now I would like to
> process key events within the tool. E.g. to interrupt an long running
> algorithm with Esc.
>
> I realized that I can add a listener with:
>
> mitk::GlobalInteraction::GetInstance()->AddListener(this);
>
> and catch a mouse press event with
>
> CONNECT_ACTION(80, MyEventProcessing);    where 80 corresponds to the
> action AcNEWPOINT
>
> But so far I could not find any action to receive a keyboard event.
> I'm not quite sure how to proceed or if there is another way implemented
> that I was not able to figure out.
>
> Best regards,
> Michael
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to