API for pressure-sensitive pens + XInput2/Wayland
This patch adds an API for querying pressure- sensitive pens, cf. SDL_pen.h: - Enumerate all pens - Get pen capabilities, names, GUIDs - Distinguishes pens and erasers - Distinguish attached and detached pens - Pressure and tilt support - Rotation, distance, throttle wheel support (throttle wheel untested) - Pen type and meta-information reporting (partially tested) Pen event reporting: - Three new event structures: PenTip, PenMotion, and PenButton - Report location with sub-pixel precision - Include axis and button status, is-eraser flag Internal pen tracker, intended to be independent of platform APIs, cf. SDL_pen_c.h: - Track known pens - Handle pen hotplugging Automatic test: - testautomation_pen.c Other features: - XInput2 implementation, incl. hotplugging - Wayland implementation, incl. hotplugging - Backward compatibility: pen events default to emulating pens with mouse ID SDL_PEN_MOUSEID - Can be toggled via SDL_HINT_PEN_NOT_MOUSE - Test/demo program (testpen) - Wacom pen feature identification by pen ID Acknowledgements: - Ping Cheng (Wacom) provided extensive feedback on Wacom pen features and detection so that hopefully untested Wacom devices have a realistic chance of working out of the box.
This commit is contained in:
committed by
Sam Lantinga
parent
d3e43668d0
commit
7c80ac6df7
@@ -940,6 +940,22 @@ SDL3_0.0.0 {
|
||||
SDL_GetVideoCaptureDevices;
|
||||
SDL_GetGamepadButtonLabelForType;
|
||||
SDL_GetGamepadButtonLabel;
|
||||
SDL_GetPens;
|
||||
SDL_GetPenStatus;
|
||||
SDL_GetPenFromGUID;
|
||||
SDL_GetPenGUID;
|
||||
SDL_PenConnected;
|
||||
SDL_GetPenName;
|
||||
SDL_GetPenCapabilities;
|
||||
SDL_GetPenType;
|
||||
SDL_GetPens;
|
||||
SDL_GetPenStatus;
|
||||
SDL_GetPenFromGUID;
|
||||
SDL_GetPenGUID;
|
||||
SDL_PenConnected;
|
||||
SDL_GetPenName;
|
||||
SDL_GetPenCapabilities;
|
||||
SDL_GetPenType;
|
||||
# extra symbols go here (don't modify this line)
|
||||
local: *;
|
||||
};
|
||||
|
||||
@@ -965,3 +965,19 @@
|
||||
#define SDL_GetVideoCaptureDevices SDL_GetVideoCaptureDevices_REAL
|
||||
#define SDL_GetGamepadButtonLabelForType SDL_GetGamepadButtonLabelForType_REAL
|
||||
#define SDL_GetGamepadButtonLabel SDL_GetGamepadButtonLabel_REAL
|
||||
#define SDL_GetPens SDL_GetPens_REAL
|
||||
#define SDL_GetPenStatus SDL_GetPenStatus_REAL
|
||||
#define SDL_GetPenFromGUID SDL_GetPenFromGUID_REAL
|
||||
#define SDL_GetPenGUID SDL_GetPenGUID_REAL
|
||||
#define SDL_PenConnected SDL_PenConnected_REAL
|
||||
#define SDL_GetPenName SDL_GetPenName_REAL
|
||||
#define SDL_GetPenCapabilities SDL_GetPenCapabilities_REAL
|
||||
#define SDL_GetPenType SDL_GetPenType_REAL
|
||||
#define SDL_GetPens SDL_GetPens_REAL
|
||||
#define SDL_GetPenStatus SDL_GetPenStatus_REAL
|
||||
#define SDL_GetPenFromGUID SDL_GetPenFromGUID_REAL
|
||||
#define SDL_GetPenGUID SDL_GetPenGUID_REAL
|
||||
#define SDL_PenConnected SDL_PenConnected_REAL
|
||||
#define SDL_GetPenName SDL_GetPenName_REAL
|
||||
#define SDL_GetPenCapabilities SDL_GetPenCapabilities_REAL
|
||||
#define SDL_GetPenType SDL_GetPenType_REAL
|
||||
|
||||
@@ -998,3 +998,11 @@ SDL_DYNAPI_PROC(void,SDL_CloseVideoCapture,(SDL_VideoCaptureDevice *a),(a),)
|
||||
SDL_DYNAPI_PROC(SDL_VideoCaptureDeviceID*,SDL_GetVideoCaptureDevices,(int *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabelForType,(SDL_GamepadType a, SDL_GamepadButton b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabel,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_PenID*,SDL_GetPens,(int *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint32,SDL_GetPenStatus,(SDL_PenID a, float *b, float *c, float *d, size_t e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(SDL_PenID,SDL_GetPenFromGUID,(SDL_GUID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_GUID,SDL_GetPenGUID,(SDL_PenID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_PenConnected,(SDL_PenID a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetPenName,(SDL_PenID a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint32,SDL_GetPenCapabilities,(SDL_PenID a, SDL_PenCapabilityInfo *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_PenSubtype,SDL_GetPenType,(SDL_PenID a),(a),return)
|
||||
|
||||
@@ -379,7 +379,7 @@ def check_comment():
|
||||
if header != 'SDL_stdinc.h':
|
||||
parameter_name = i['parameter_name']
|
||||
for n in parameter_name:
|
||||
if n != "" and "\\param " + n not in comment:
|
||||
if n != "" and "\\param " + n not in comment and "\\param[out] " + n not in comment:
|
||||
check_comment_header()
|
||||
print(" In file %s: function %s() missing '\\param %s'" % (header, name, n));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user