Hi!<br><br>I was thinking about this problem last yeat as well. And there are a couple of ideas that might be interesting to you:<br><br>1) About all these "modes" of the tools like "Color Picking" and "Shift+Drag". You need to be quite careful with them, because there are various sequences of pressing a modifier and mouse button. For all the good applications it is common that the mode is exited only when *the last* component of the modifier+key is released. <br>
<br>For example (in e.g. Gimp):<br>i) Press Ctrl+Left Button and start moving the mouse<br>ii) Release Ctrl. You are still in the color picking mode. And the mouse cursor is still persist.<br>III) Now you and press *any* modifiers as many times as you wish but you will not leave color picking mode unless you release the mouse. <br>
<br>Such behavior can be described with a state machine easily. Probably, it can be implemented in a way like that.<br><br>2) A good way to describe modes of the tools is using of KoInteractionTool+KoInteractionStrategy. We have it but it is not commonly used yet. It is at least used in DefaultTool and KoZoomTool.<br>
<br>3) We still need to handle Ko-wide tools as well.<br><br>4) Last year I proposed a design of a system like that, but I never implemented it. It should have had a central class as well as you proposed (KoModifiersManager).<br>
<br>Here is a short description of it.<br><a href="http://community.kde.org/Calligra/Libs/Interactional_Tools">http://community.kde.org/Calligra/Libs/Interactional_Tools</a><br><br>You can use it as a base for your system ;)<br>
<br><br clear="all"><br>-- <br>Dmitry Kazakov<br>