Opened 3 weeks ago

Last modified 3 weeks ago

#155 new enhancement

Basic digitizer support (stylus 'eraser' support)

Reported by: wyattfward@… Owned by: pulkomandy
Priority: minor Milestone: 2.8
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 (1)

comment:1 Changed 3 weeks ago by wyattfward@…

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.

Note: See TracTickets for help on using tickets.