[Tuxpaint-devel] Shortcut ([Del] key) for quick access to a small eraser
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Bill K. <nb...@so...> - 2022-09-28 09:13:07
|
Tonight I thought that, since Tux Paint is now focused on SDL2, I could finally look into adding drawing tablet (e.g., Wacom) support to Tux Paint. Right now, it works, but acts as a mouse: no pressure, no recognition of which stylus tip (pen vs. eraser) is being usded, etc. Unfortunately, even after so many years, SDL isn't quite ready! :-D (See https://github.com/libsdl-org/SDL/issues/2217) However, I realized the process would end up being very similar to what I did for the color picker "pipette" shortcut ([Ctrl] key) in 0.9.28, and decided I could add a similar feature that would give users quick access to an eraser via a shortcut key. Once SDL could actually tell us when a stylus' eraser tip is being used, we could simply do the same thing as when the shortcut key is being held! So, I've added code in what will become Tux Paint 0.9.29 that lets you hold the [Del] ("delete"; not to be confused with "backspace") key, at _almost_ any time, to get quick access to a small, round eraser. Without checking for the state of things, I discovered that this feature would interfer with the rotation steps of both the Shapes and Stamps tools. So I specifically avoid invoking this new code in those two situations. Other parts of Tux Paint -- like the Fill tool's linear gradient and brush modes, interactive Magic tools, etc. -- appear to inherently avoid interference from this feature, since you're in the process of click+dragging. It's impossible to get another click in there; pressing [Del] on its own doesn't invoke this code, it's the combination of an otherwise-uncaught click, plus the [Del] key already being held. However, as usual, it's late at night, I should have gone to bed 2 hours ago, and mistakes happen. So, if you notice any glitches, please let me know ASAP so I can try to address them. So far, I think I need to tackle: * interferrence with onscreen keyboard (Text & Label tools) * "--mouse-accessibility" mode (other features, like the [Ctrl] quick access color picker, probably need to better support this option!) * "--keyboard" mode (ditto) -- -bill! Sent from my computer |