Events

Clarence Dang dang at kde.org
Fri Apr 2 04:23:37 CEST 2004


On Fri, 2 Apr 2004 01:52 am, Adrian Page wrote:
> At the moment we have separate event handlers for mice and tablets which
> leads to some duplication of code and a need to write two lots of code for
> each tool. How about we replace them by a single handler that takes events
> with pressure and tilts, and have the mouse just set these to
> PRESSURE_DEFAULT and 0, 0? We could replace
>
> mousePress(QMouseEvent *)
> mouseMove(QMouseEvent *)
> mouseRelease(QMouseEvent *)
> tabletEvent(QTabletEvent *)
>
> with
>
> buttonPress(KisButtonPressEvent *)
> move(KisMoveEvent *)
> buttonRelease(KisButtonReleaseEvent *)
>
I think this is a good idea.  You might want to borrow some ideas from 
kdegraphics/kolourpaint/tools/kptool.h for further tool abstraction (it even 
handles status bar messages that reflect the tool state).

> These new event classes could also use floating point for coordinates,
> which is needed in order to use the full resolution of the tablets.
How would that work with KisPainter which only accepts integer coordinates?  
I'm currently working on a few more KisPainter methods (polyline, polygon, 
fill) ... been rather busy lately though; haven't had much time to do 
anything Krita related.

Thanks,
Clarence



More information about the kimageshop mailing list