|
@@ -89,10 +89,10 @@ static void Cocoa_HandlePenProximityEvent(SDL_CocoaWindowData *_data, NSEvent *e
|
|
|
return; // oh well.
|
|
|
}
|
|
|
|
|
|
- // Cocoa offers almost none of this information.
|
|
|
+ // Cocoa offers almost none of this information as specifics, but can without warning offer any of these specific things.
|
|
|
SDL_PenInfo peninfo;
|
|
|
SDL_zero(peninfo);
|
|
|
- peninfo.capabilities = SDL_PEN_CAPABILITY_PRESSURE | SDL_PEN_CAPABILITY_ROTATION | SDL_PEN_CAPABILITY_XTILT | SDL_PEN_CAPABILITY_YTILT | (is_eraser ? SDL_PEN_CAPABILITY_ERASER : 0);
|
|
|
+ peninfo.capabilities = SDL_PEN_CAPABILITY_PRESSURE | SDL_PEN_CAPABILITY_ROTATION | SDL_PEN_CAPABILITY_XTILT | SDL_PEN_CAPABILITY_YTILT | SDL_PEN_CAPABILITY_TANGENTIAL_PRESSURE | (is_eraser ? SDL_PEN_CAPABILITY_ERASER : 0);
|
|
|
peninfo.max_tilt = 90.0f;
|
|
|
peninfo.num_buttons = 2;
|
|
|
peninfo.subtype = is_eraser ? SDL_PEN_TYPE_ERASER : SDL_PEN_TYPE_PEN;
|
|
@@ -136,6 +136,7 @@ static void Cocoa_HandlePenPointEvent(SDL_CocoaWindowData *_data, NSEvent *event
|
|
|
SDL_SendPenAxis(timestamp, pen, window, SDL_PEN_AXIS_ROTATION, [event rotation]);
|
|
|
SDL_SendPenAxis(timestamp, pen, window, SDL_PEN_AXIS_XTILT, ((float) tilt.x) * 90.0f);
|
|
|
SDL_SendPenAxis(timestamp, pen, window, SDL_PEN_AXIS_YTILT, ((float) tilt.y) * 90.0f);
|
|
|
+ SDL_SendPenAxis(timestamp, pen, window, SDL_PEN_AXIS_TANGENTIAL_PRESSURE, event.tangentialPressure);
|
|
|
}
|
|
|
|
|
|
SDL_bool Cocoa_HandlePenEvent(SDL_CocoaWindowData *_data, NSEvent *event)
|