Opened 4 years ago

Last modified 3 years ago

#155 new enhancement

Basic digitizer support (stylus 'eraser' support)

Reported by: wyattfward@… Owned by: pulkomandy
Priority: minor Milestone: 2.9
Component: GrafX2 Version: 2.6
Keywords: tablet stylus Cc:

Description

I have an older thinkpad tablet convertible (X201 Tablet) with a wacom digitizer built in, running Debian Linux. The stylus has a back side that acts as an eraser, which can be differentiated from the normal tip by software. It'd be great if grafx2 could treat the eraser end like a right-click and draw the secondary colour with it.

On my machine, at least, using a program called sdl-jstest, I can see that SDL2 can differentiate between the eraser and the normal tip. This is done by button 0 activating when the pen tip is detected in proximity of the screen, and button 1 activating when the eraser is close. The actual "touch-down" (seen as a tap or a "click" event) is indicated by mouse button 2.

More simply put, in pseudo-C:

if(button2)
{
  if(button0) /* pen tip */
  {
      // handle pen tip
  }
  else if(button1) /* pen eraser */
  {
      // handle eraser
  }
}

There may be a better way to do this that doesn't depend on joystick bindings, but I don't know. Probably this should really be in a switch-case.

Thanks for the software, by the way. I'm planning to upgrade my ECS-modded Amiga 500 with a kickstart 3.x ROM (currently I'm just on 2.04) so I can try using it there, too. The high degree of portability (especially for this day and age of Wintel dominance) is hugely appreciated (even if I wish it also supported WB2.1).

Change History (3)

comment:1 by wyattfward@…, 4 years ago

Doing [mouse button] && [joystick button] might be even better, if there's a way to select a joystick to use, since the stylus is already making a mouse click event occur.

comment:2 by Thomas Bernard, 3 years ago

you mean the pen tip/eraser selection is done with Joystick button ?

or is it also with mouse button ?
you could provide log of sdl-jstest

comment:3 by PulkoMandy, 3 years ago

Milestone: 2.82.9
Note: See TracTickets for help on using tickets.