Added love.touch.getPressure(touchid). Not useful on most touch-capable devices, but I do expect Apple's Force Touch to make it into iPhones in the near future.

This commit is contained in:
Alex Szpakowski
2015-03-24 20:45:21 -03:00
parent b8cb16dc95
commit 78dd8bc547
8 changed files with 62 additions and 26 deletions
+2
View File
@@ -277,6 +277,7 @@ Message *Event::convert(const SDL_Event &e) const
touchinfo.y = e.tfinger.y;
touchinfo.dx = e.tfinger.dx;
touchinfo.dy = e.tfinger.dy;
touchinfo.pressure = e.tfinger.pressure;
#ifdef LOVE_LINUX
// FIXME: hacky workaround for SDL not normalizing touch coordinates in
@@ -310,6 +311,7 @@ Message *Event::convert(const SDL_Event &e) const
vargs.push_back(new Variant(touchinfo.y));
vargs.push_back(new Variant(touchinfo.dx));
vargs.push_back(new Variant(touchinfo.dy));
vargs.push_back(new Variant(touchinfo.pressure));
if (e.type == SDL_FINGERDOWN)
txt = "touchpressed";