Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_GetTouchName [Patch] #2032

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

SDL_GetTouchName [Patch] #2032

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2015-11-26 07:42:32 +0000, Martin Gerhardy wrote:

Created attachment 2313
the patch

Added a new function SDL_GetTouchName to SDL.

currently most of the drivers don't expose a name- but that might change
and imo it's still quite useful for those that do, to query the name.

On 2015-11-26 21:10:00 +0000, Philipp Wiesemann wrote:

SDL_GetNumTouchFingers() and SDL_GetTouchFinger() get an SDL_TouchID as input. Maybe it would be more consistent if SDL_GetTouchName() would, too (instead of an index). Then it also could use SDL_GetTouch() internally (which already sets the error).

On the other hand this could be to much indirection (and maybe overhead) if SDL_GetTouchName() is just used to list the names once.

On 2015-11-27 22:30:06 +0000, David Ludwig wrote:

Might it make sense to rename SDL_GetTouchName to SDL_GetTouchDeviceName, to help indicate that the function gets a property specific to a touch-device, rather than an SDL_TouchID?

To give some background on this proposed name-change:

When I first looked at this function, I wondered if it worked on a touch-ID, given that SDL's existing touch-API functions:

  1. when accepting-in an SDL_TouchID, do not have the text, 'Device', anywhere in its function name. I.e. SDL_GetNumTouchFingers, and SDL_GetTouchFinger

  2. when -not- accepting-in an SDL_TouchID, and instead getting some information that's only specific to a touch-device, or the host-system in general, they -do- include the text, 'Device', in its name. I.e. SDL_GetTouchDevice, and SDL_GetNumTouchDevices

On 2015-11-28 11:07:05 +0000, Martin Gerhardy wrote:

For joysticks it is e.g. SDL_JoystickNameForIndex - so maybe the ForIndex should be added here, too. Also it looks like I submitted the wrong patch. There is still a const in the name member of the struct that doesn't work because I later added the strdup and free calls. Anyway - if people find this useful, I will update the patch. Even though the patch is very easy to recreate if it's really something that would be useful.. up to you guys - let me know.

On 2015-12-28 09:08:34 +0000, Martin Gerhardy wrote:

*** Bug 3090 has been marked as a duplicate of this bug. ***

1bsyl added a commit that referenced this issue Feb 8, 2022
@1bsyl 1bsyl closed this as completed Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants