KOffice 2.0 will, like Krita 1.x be able to work with graphics tablets. It will be possible to have different tools active for different pointers. For instance, it will be possible to assign the Pan tool to the mouse, the Airbrush tool to the airbrush stylus, the Eraser to the eraser and the freehand vector tool to the stylus.
The different pointers that the user can use as input device get separated into two categories; the mouse and the tablet.
A tablet event can come from a variety of pointer devices, divided into two categories:
To add to this complexity, users of fancy graphics tablets often have more than one stylus device, each with a unique id. See QTabletEvent::uniqueId() The users often use these as a painter or draughtsmen uses his bush of brushes or bristle of crayons: for different types of brush, sizes, colors etc.
If we get a tablet event we can determine what kind of pointer thingy was used, and we get the unique id for that thing. The unique id does not distinguish between eraser tip and pen tip, so it's not unique enough. Plus, not all tablets support a unique id.
In KOffice all this complexity is mapped to unique KoInputDevice objects.
When a user has the physical choice of multiple input devices his choosing one should be enough to tell the application the goal of his actions. If a user picks up an eraser and uses that on his tablet, the result is that the application switches to the eraser and forward the user actions to that eraserTool.
For the sake of configurability we simple remember the last used tool for each unique input device and switch back to that tool when the user picks up the associated input device.
On top of that, we map those tools to the active canvas with the result that two views of the same document can mean the stylus will activate different tools. This makes a lot of sense if you try to use the opposite solution; sharing the tool between all views which gets confusing quickly due to the selected object being per view.
Query: should we have individual pressure characteristics per type per device? Or is one basic curve enough? (we tend towards the latter). Whichever way, this/these curve(s) needs to be stored in the config file.