mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user