src/events/SDL_touch.c
changeset 12404 eb60e952b13f
parent 11811 5d94cb6b24d3
child 12462 b57435750c5b
     1.1 --- a/src/events/SDL_touch.c	Wed Nov 07 07:52:39 2018 -0800
     1.2 +++ b/src/events/SDL_touch.c	Sat Nov 10 16:15:48 2018 -0400
     1.3 @@ -86,6 +86,16 @@
     1.4      return SDL_touchDevices[index];
     1.5  }
     1.6  
     1.7 +SDL_TouchDeviceType
     1.8 +SDL_GetTouchDeviceType(SDL_TouchID id)
     1.9 +{
    1.10 +    SDL_Touch *touch = SDL_GetTouch(id);
    1.11 +    if (touch) {
    1.12 +        return touch->type;
    1.13 +    }
    1.14 +    return SDL_TOUCH_DEVICE_INVALID;
    1.15 +}
    1.16 +
    1.17  static int
    1.18  SDL_GetFingerIndex(const SDL_Touch * touch, SDL_FingerID fingerid)
    1.19  {
    1.20 @@ -133,7 +143,7 @@
    1.21  }
    1.22  
    1.23  int
    1.24 -SDL_AddTouch(SDL_TouchID touchID, const char *name)
    1.25 +SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name)
    1.26  {
    1.27      SDL_Touch **touchDevices;
    1.28      int index;
    1.29 @@ -163,6 +173,7 @@
    1.30  
    1.31      /* we're setting the touch properties */
    1.32      SDL_touchDevices[index]->id = touchID;
    1.33 +    SDL_touchDevices[index]->type = type;
    1.34      SDL_touchDevices[index]->num_fingers = 0;
    1.35      SDL_touchDevices[index]->max_fingers = 0;
    1.36      SDL_touchDevices[index]->fingers = NULL;