Is there a way to reassign a SDL2 source value in a program?

I’m wondering whether it is possible to reassign
SDL_double_click_radius another value. On our iOS app a bigger radius works a bit better but it can only be done by changing the SDL2 source.
Can this be done in the program’s source?

Not at the moment, but we could add a hint for this.

That being said: a double-click radius of 1 pixel seems deeply
unforgiving to me, so we should probably increase this in any case. What
value works well for your app?

–ryan.On 9/4/16 5:39 AM, Dominus wrote:

I’m wondering whether it is possible to reassign
SDL_double_click_radius another value. On our iOS app a bigger radius
works a bit better but it can only be done by changing the SDL2 source.
Can this be done in the program’s source?

Ryan C. Gordon wrote:

That being said: a double-click radius of 1 pixel seems deeply
unforgiving to me, so we should probably increase this in any case. What
value works well for your app?

Should it not, ideally, be a distance rather than a number of pixels? Setting the double-click radius to a fixed number of pixels will at best only work satisfactorily over a range of DPI values. I’m not sure of the current status of SDL_GetDisplayDPI (It doesn’t seem to work in Android) so if that’s not available I can see there might be a problem.

Richard.

It should probably use units affected by the OS pixel density scale factor (?dp units? in Android terminology), rather than pixels or direct DPI.

That said? I think it should actually just use what the OS considers to be a double-click (when the OS provides that information), similarly to how key repeat works right now. Double-click speed on desktops is typically a user-exposed system wide setting, so I feel like SDL?s APIs should expose that information rather than doing something that a developer using SDL can do on their own.> On Sep 6, 2016, at 5:11 PM, rtrussell wrote:

Ryan C. Gordon wrote:
That being said: a double-click radius of 1 pixel seems deeply
unforgiving to me, so we should probably increase this in any case. What
value works well for your app?

Should it not, ideally, be a distance rather than a number of pixels? Setting the double-click radius to a fixed number of pixels will at best only work satisfactorily over a range of DPI values. I’m not sure of the current status of SDL_GetDisplayDPI (It doesn’t seem to work in Android) so if that’s not available I can see there might be a problem.

Richard.


SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

iOS also provides a UITouch.tapCount property (?the number of times the user tapped their fingers on a certain point within a predefined period?), which is not used by SDL at all but would be exactly what I expect to be exposed by the SDL mouse event clicks field.> On Sep 6, 2016, at 5:27 PM, Alex Szpakowski <@Alex_Szpakowski> wrote:

It should probably use units affected by the OS pixel density scale factor (?dp units? in Android terminology), rather than pixels or direct DPI.

That said? I think it should actually just use what the OS considers to be a double-click (when the OS provides that information), similarly to how key repeat works right now. Double-click speed on desktops is typically a user-exposed system wide setting, so I feel like SDL?s APIs should expose that information rather than doing something that a developer using SDL can do on their own.

On Sep 6, 2016, at 5:11 PM, rtrussell <news at rtrussell.co.uk <mailto:news at rtrussell.co.uk>> wrote:

Ryan C. Gordon wrote:
That being said: a double-click radius of 1 pixel seems deeply
unforgiving to me, so we should probably increase this in any case. What
value works well for your app?

Should it not, ideally, be a distance rather than a number of pixels? Setting the double-click radius to a fixed number of pixels will at best only work satisfactorily over a range of DPI values. I’m not sure of the current status of SDL_GetDisplayDPI (It doesn’t seem to work in Android) so if that’s not available I can see there might be a problem.

Richard.


SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ryan C. Gordon wrote:

I’m wondering whether it is possible to reassign
SDL_double_click_radius another value. On our iOS app a bigger radius
works a bit better but it can only be done by changing the SDL2 source.
Can this be done in the program’s source?

Not at the moment, but we could add a hint for this.

That being said: a double-click radius of 1 pixel seems deeply
unforgiving to me, so we should probably increase this in any case. What
value works well for your app?

A hint would be nice. We currently use 5 but that is probably a bit excessive, 3 might be a good default.
Though Alex makes a good point:

Alex Szpakowski wrote:> On 9/4/16 5:39 AM, Dominus wrote:

iOS also provides a UITouch.tapCount property (???the number of times the user tapped their fingers on a certain point within a predefined period???), which is not used by SDL at all but would be exactly what I expect to be exposed by the SDL mouse event clicks field.

Is this problem related to why Android always returns 1 for the click count?On 9/6/16, Alex Szpakowski wrote:

iOS also provides a UITouch.tapCount property (?the number of times the user
tapped their fingers on a certain point within a predefined period?), which
is not used by SDL at all but would be exactly what I expect to be exposed
by the SDL mouse event clicks field.

That said? I think it should actually just use what the OS considers to be
a double-click (when the OS provides that information), similarly to how
key repeat works right now. Double-click speed on desktops is typically a
user-exposed system wide setting, so I feel like SDL?s APIs should expose
that information rather than doing something that a developer using SDL
can do on their own.

FWIW, for Mac, NSEvent provides clickCount.

Thanks,
Eric

Possibly; we’re literally just seeing how many pixels away you were from
the previous click, and I imagine fingers aren’t a very precise
instrument in this regard.

I haven’t explored this very much at all, though.

–ryan.On 9/6/16 6:45 PM, Eric Wing wrote:

Is this problem related to why Android always returns 1 for the click count?