Mouse vs. Touch vs. Pen Input

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
mlepage
Prole
Posts: 10
Joined: Sat Jun 30, 2012 9:26 pm

Mouse vs. Touch vs. Pen Input

Post by mlepage »

Hi, I would like to know if it is possible to distinguish between pen and touch input.

By pen, I mean either Surface pen, or Wacom tablet pen, with pressure levels.

What I'd like to do is play around with making simple drawing apps for prototyping some ideas. I'd like to be able to use the pen with pressure levels for drawing, and touch for pinch/zoom/scroll etc. I don't want touch to draw, if I'm holding the Surface tablet and touch it, or if my palm rests against it while I'm holding the pen.

I assume Windows has all the proper events for mouse vs. touch vs. pen. So my question is whether Love exposes those distinctions so I can use them.

If not, would such support be coming soon? Seems like touch and pen are becoming much more prevalent, and that's because they're useful. They can be more useful with better software.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Mouse vs. Touch vs. Pen Input

Post by raidho36 »

LÖVE doesn't support pen input so that's that. Try your luck with third party libraries, also obviously you'd then have no problem telling if it's pen or mouse input, because you get pen input from a third party lib. As for touch input, there are special touch-related callbacks and functions so you can't miss them. Touch can also emulate left mouse clicks.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Mouse vs. Touch vs. Pen Input

Post by Nixola »

I do need this as well, so I might do some research on a cross-platform way to do it (or multiple non cross-platform ways). I'll share my results here if I ever find something out.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
alloyed
Citizen
Posts: 80
Joined: Thu May 28, 2015 8:45 pm
Contact:

Re: Mouse vs. Touch vs. Pen Input

Post by alloyed »

I'm also interested, but I don't have the hardware to directly test it.
Worth noting, the existing love.touch API supports pressure levels.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Mouse vs. Touch vs. Pen Input

Post by zorg »

The pen manufacturers will probably have separate APIs, or use existing OS specific ones in device-specific manners... probably.
On that note, looks like Wacom is thankfully into sharing information about this, at a first glance anyways:

http://www.wacomeng.com/windows/
http://www.wacomeng.com/mac/index.html
http://www.wacomeng.com/linux/index.html
http://www.wacomeng.com/android/index.html
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Mouse vs. Touch vs. Pen Input

Post by slime »

User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Mouse vs. Touch vs. Pen Input

Post by raidho36 »

Yea the core problem with pen input is that unlike mouse or even touch, there is basically no hardware nor software standard for it, so vendors implement their own drivers. You'll have pretty good chances that a Wacom tablet will have drivers for any OS, not so much for anything else. Until that situation changes, you'll not see much support for them. Same reason why force feedback racing wheels are not widely supported in racing games.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Mouse vs. Touch vs. Pen Input

Post by zorg »

raidho36 wrote: Sun Feb 12, 2017 5:02 amYea the core problem with pen input is that unlike mouse or even touch, there is basically no hardware nor software standard for it.
Isn't HID a standard?
(Page 134 of http://www.usb.org/developers/hidpage/Hut1_12v2.pdf describes an example for Desktop Tablet input device.)
raidho36 wrote:so vendors implement their own drivers.
This can still be true regardless of HID existing.
raidho36 wrote:You'll have pretty good chances that a Wacom tablet will have drivers for any OS, not so much for anything else. Until that situation changes, you'll not see much support for them.
As slime linked above, for windows, two apis exist for tablets on windows, wacom's wintab and windows' RealTimeStylus. For other OS-es, wacom's sites i linked above may hold more (even non-vendor-specific) answers, honestly i haven't read them thoroughly.
Also, no one needs to care about other vendors; that's how it is with pre-XBOX compatible controllers (see the gamepad api for example).

But all-in-all, i do agree that until SDL implements anything, this could only either be solved with an external library, or maybe FFI, in case it can access the needed APIs.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests