The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
is there a way to reassign a SDL2 source value in a program?
Dominus


Joined: 13 Oct 2009
Posts: 127
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?
is there a way to reassign a SDL2 source value in a program?
Ryan C. Gordon
Guest

On 9/4/16 5:39 AM, Dominus wrote:
Quote:
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.



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: is there a way to reassign a SDL2 source value in a prog
rtrussell


Joined: 10 Feb 2016
Posts: 88
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.
is there a way to reassign a SDL2 source value in a program?
Alex Szpakowski
Guest

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.
Quote:
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 mailinghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
is there a way to reassign a SDL2 source value in a program?
Alex Szpakowski
Guest

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.
Quote:
On Sep 6, 2016, at 5:27 PM, 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.
Quote:
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 mailinghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



Re: is there a way to reassign a SDL2 source value in a prog
Dominus


Joined: 13 Oct 2009
Posts: 127
Ryan C. Gordon wrote:
On 9/4/16 5:39 AM, Dominus wrote:
Quote:
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:
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 there a way to reassign a SDL2 source value in a program?
Eric Wing
Guest

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


On 9/6/16, Alex Szpakowski wrote:
Quote:
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.

Quote:

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
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
is there a way to reassign a SDL2 source value in a program?
Ryan C. Gordon
Guest

On 9/6/16 6:45 PM, Eric Wing wrote:
Quote:
Is this problem related to why Android always returns 1 for the click count?

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.



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org