Comment 3 for bug 1080302

Revision history for this message
Don McComb (don-mccomb) wrote :

This bug is not completely fixed unfortunately. In my last commit, I set focus back to the canvas on the BrushWidth.ComboBox Changed event. However, if the user drops down the combo box and selects the same previous brush width, the Changed event is not triggered and the combobox maintains focus, so the cursor does not change to the anchor cursor when the Control key is pressed while the mouse is over the canvas.

I considered using the MouseMove event in the CloneStamp tool to set the cursor instead of the KeyPress event, but then I considered that the mouse may not not be moving when the Control key is pressed.

My last commit was a bit of a band-aid solution. I am considering a solution which has broader effect. I am considering the following:
Handle the KeyPress event in the MainWindow class. If the Mouse is over the canvas, then call PintaCanvas::DoKeyPress, which would then call BaseTool::DoKeyPress. If the key press event is handled by the canvas/tool, it will indicate so by setting e.RetVal. If MainWindow discovers that the Canvas did not handle the event, then the event can be passed onto the Widget which has focus (e.g., the toolbar).
Do you think this is the best way to solve it?