Browse Source

uikit: Apple Pencil is always a "direct" input device.

Fixes #13065.
Ryan C. Gordon 2 months ago
parent
commit
4ece6993fe
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/video/uikit/SDL_uikitpen.m

+ 1 - 0
src/video/uikit/SDL_uikitpen.m

@@ -72,6 +72,7 @@ static SDL_PenID UIKit_AddPenIfNecesary()
         info.max_tilt = 90.0f;
         info.max_tilt = 90.0f;
         info.num_buttons = 0;
         info.num_buttons = 0;
         info.subtype = SDL_PEN_TYPE_PENCIL;
         info.subtype = SDL_PEN_TYPE_PENCIL;
+        info.device_type = SDL_PEN_DEVICE_TYPE_DIRECT;  // Apple Pencil on iOS is always a direct device; it works on the tablet's screen.
 
 
         if (@available(iOS 17.5, *)) {  // need rollAngle method.
         if (@available(iOS 17.5, *)) {  // need rollAngle method.
             info.capabilities |= SDL_PEN_CAPABILITY_ROTATION;
             info.capabilities |= SDL_PEN_CAPABILITY_ROTATION;