HaikuArchives / ArtPaint

ArtPaint is a painting and image processing program.
https://haikuarchives.github.io/ArtPaint/
29 stars 18 forks source link

Add tablet support #516

Open dsizzle opened 1 year ago

dsizzle commented 1 year ago

ArtPaint would be fancier with support for graphics tablets.

humdingerb commented 1 year ago

Indeed. Do you have the hardware? If not, should we see if people would like to donate hardware or money? I only have a 20+ years old wacom tablet, but I can test pressure sensitivity. Do you already have a plan what and how to support tablets. I hear more expensive/newer tablets also have pen-angle detection. Or do you start with pressure-detection for starters?

And GUI-wise? maybe a little checkbox to the right of every slider option with a little pen icon beside it? If checked, use it as pressure-input.

Just commenting anything that tumbles into my head here... :)

dsizzle commented 1 year ago

I have a Wacom Intuos 5 Touch here (sitting in a desk drawer) but I have never attempted to connect it to Haiku. In fact right now I'm only running Haiku on a VM; I should pull out my old laptop and fire up real Haiku on it when I attempt this.

I have no plan, really. I figured I could look at WB to see how it gets tablet info as a start.

The little pen icon thing next to every single slider seems messy no?

humdingerb commented 1 year ago

The little pen icon thing next to every single slider seems messy no?

Maybe. Had a look at Wonderbrush, and it also doesn't have an icon, just a little checkbox with a tooltip. Maybe that's enough really...

dsizzle commented 1 year ago

Looks like this tablet has both pressure sensitivity and angle detection, as well as some user-definable keys and widgets.

humdingerb commented 1 year ago

Luxury!! :) Having two "special" inputs might be interesting GUI wise...

PeteCA commented 1 year ago

FTR, I have an old Wacom too, that I only use rarely (but it does work fine in Haiku). At one time, I was fired up to make an "ImageWeaver", using ny Weaver program as base. At first sight I thought it would be neat to have a paint program that was entirerely modular -- like the Musicweaver. The thing worked as designed, but "design" is probably not an appropriate term, as it was a total pain to use! Maybe it could have been designed properly, but I suspect the basic concept was just not appropriate.

Anyway, I find I still have the code (~2003!) -- BeOS of course, but it works in Haiku -- so if I get a chance I'll dig it out and see how it all worked.

BTW as I remember the tablet does handle 'tilt', too.

humdingerb commented 1 year ago

One idea for the GUI part: One button with B_TOGGLE_BEHAVIOR to the right of all sliders.

If there's no tablet, either disable or hide the button in the layout. Maybe the buttons could be smaller still...

PeteCA commented 1 year ago

On Sat, May 06, 2023 at 10:17:53PM -0700, humdinger wrote:

One idea for the GUI part: One button with B_TOGGLE_BEHAVIOR to the right of all sliders.

  • Use the character "🖍" as label when the slider isn't controlled by the tablet:

  • First click, use "↓" as label for pressure control:

  • Second click, use "∠" as label for tilt control:

  • Third click goes back to "diabled ("🖍").

If I'm understanding, this doesn't seem quite right to me.I think I'd probably want both pressure and tilt -- pressure for intensity or size, tilt for 'oblateness' (not sure if that's the right term). A user might suppress one or the other, d3epending on their preference.

PeteCA commented 1 year ago

Ahh, I think I was misunderstanding.... You're thinking of controlling which slider function should be controlled by a particular tablet value. Right? So you could set one slider to pressure, another to tilt. Sounds good.

humdingerb commented 1 year ago

Exactly. Just one button at each slider where you set what tablet feature it is controlled by. Instead of a button, a pop-up menu may work, too. Especially if there may be more modes than pressure & tilt. [Aside: Since I've been meddling with my MIDI controller lately, I have this crazy idea to use its 8 knobs to control sliders in ArtPaint, e.g. control CMYKA colours and brush settings. Even cooler if it were possible while painting... :) ]

Anyway, this pop-up menu would show the small symbols when closed (∠, ↓, etc.) and and a longer text when the menu is open:

The advantage of the BButton is that it can be made smaller and even SetFlat() to make it even more conspicuous.