Double-click event

I am porting several applications from + to
SDL only. All the applications use “double-click” events.

Is there any “ready” solution to implement double-click detection under SDL.
Or, I will have to measure time and distance between clicks… ?

Thanks,

Armando

Hi,

I have a small fix I’d like to get committed with respect to Mac OS X
and joysticks:------------------------------------------------------------------------

src/joystick/darwin/SDL_sysjoystick.c: SDL_SYS_JoystickInit()


      /* Filter device list to non-keyboard/mouse stuff */
      if ( (device->usagePage != kHIDPage_GenericDesktop) ||
  •         ((device->usage != kHIDUsage_GD_Joystick &&
    
  •           device->usage != kHIDUsage_GD_GamePad)) ) {
    
  •         (device->usage != kHIDUsage_GD_Joystick &&
    
  •          device->usage != kHIDUsage_GD_GamePad  &&
    
  •          device->usage != kHIDUsage_GD_MultiAxisController) ) {
    


This allows SDL to interface with controllers like 3Dconnexion’s
SpaceNavigator (http://www.3dconnexion.com/products/3a1d.php). I’ve
tested it and it works so my question basically consists of two parts:

  1. Can I commit this or does someone closer to the project need to do
    it on my behalf?

  2. If I can commit it, which branch should I commit it to: branches/
    SDL-1.2 or trunk? (Are there regular merges from branches/SDL-1.2 to
    trunk or would I have to do that too?)

Many thanks.

Laurence Passmore.

Homeworld SDL @ www.homeworldsdl.org

This allows SDL to interface with controllers like 3Dconnexion’s
SpaceNavigator (http://www.3dconnexion.com/products/3a1d.php).

Cool!

  1. Can I commit this or does someone closer to the project need to do
    it on my behalf?

Someone with write access to Subversion would commit it…namely me in
this case.

  1. If I can commit it, which branch should I commit it to: branches/
    SDL-1.2 or trunk? (Are there regular merges from branches/SDL-1.2 to
    trunk or would I have to do that too?)

Something like this goes to both trunk (1.3) and branches/SDL-1.2 (1.2),
since it’s a simple bugfix-type patch. Major changes and features go
into 1.3 only, 1.2 is just getting bugfixes and simple tweaks at this point.

This patch is now committed in svn revision #2993 for the 1.2 branch,
and #2994 for the 1.3 branch. Thanks!

–ryan.

Hi,

I just compiled my SDL application on Mac OS X with -Wundef and it
threw a number of errors. Of note was:

 SDL_config_macosx.h: 34
 warning: "MAC_OS_X_VERSION_MIN_REQUIRED" is not defined

Line 34 is:

 #if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined 

(POWERPC)) )

Now according to this mailing on the Apple developer lists:

 http://lists.apple.com/archives/Xcode-users/2005/May/msg00602.html

that particular #define was removed from the gcc compiler defaults
and AvailabilityMacros.h (/usr/include/AvailabilityMacros.h) should
be pulled in directly instead.

Would someone closer to the Mac OS X version of SDL be willing to
make that change please? Thanks.

Laurence Passmore
Homeworld SDL @ www.homeworldsdl.org

Would someone closer to the Mac OS X version of SDL be willing to
make that change please? Thanks.

Fixed in svn revision #2996 for the 1.2 branch and #2997 for the 1.3
branch, thanks!

–ryan.

Thanks Ryan!

I’m also getting a “TARGET_API_MAC_CARBON is not defined” error too.
That’s defined in CarbonCore/ConditionalMacros.h (which incidentally
pulls in AvailabilityMacros.h). I’m not entirely sure where that
should be put in the Mac OS X SDL include tree though. Sorry to be a
pain but is there any chance you could investigate this one too
please? Many thanks.On 27 Mar 2007, at 01:40, Ryan C. Gordon wrote:

Would someone closer to the Mac OS X version of SDL be willing to
make that change please? Thanks.

Fixed in svn revision #2996 for the 1.2 branch and #2997 for the 1.3
branch, thanks!

–ryan.


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

I’m also getting a “TARGET_API_MAC_CARBON is not defined” error too.
That’s defined in CarbonCore/ConditionalMacros.h (which incidentally
pulls in AvailabilityMacros.h). I’m not entirely sure where that
should be put in the Mac OS X SDL include tree though. Sorry to be a
pain but is there any chance you could investigate this one too
please? Many thanks.

You could turn off -Wundef, too…I would think that would cause
problems with a lot of headers that expect undefined things to be
equivalent to zero (including headers I’ve written for other projects,
yikes!).

I’ll look into ConditionalMacros.h, though.

–ryan.

I don’t think we can just #include ConditionalMacros.h. If we do that, I think it will define the value. I ran a bonehead test program and it looks like it got defined to 1.

#include <ConditionalMacros.h>
#include <stdio.h>

int main()
{
#ifdef TARGET_API_MAC_CARBON
printf(“is defined: %d\n”, TARGET_API_MAC_CARBON);
#else
printf(“not defined\n”);
#endif

return 0;

}

By default SDL assumes TARGET_API_MAC_CARBON is not defined (or 0). The Carbon backend is an optional backend for OS X, but is not the default. The build system needs the flexibility to define this value. I’m not sure defining this belongs in the source tree.

-EricOn 3/27/07, Laurence Passmore wrote:

Thanks Ryan!

I’m also getting a “TARGET_API_MAC_CARBON is not defined” error too.
That’s defined in CarbonCore/ConditionalMacros.h (which incidentally
pulls in AvailabilityMacros.h). I’m not entirely sure where that
should be put in the Mac OS X SDL include tree though. Sorry to be a
pain but is there any chance you could investigate this one too
please? Many thanks.

By default SDL assumes TARGET_API_MAC_CARBON is not defined (or 0). The
Carbon backend is an optional backend for OS X, but is not the default.
The build system needs the flexibility to define this value. I’m not
sure defining this belongs in the source tree.

I came to the same conclusion; since it’s just the one thing that
-Wundef is whining about, I changed it from:

#if TARGET_API_MAC_CARBON

…to…

#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))

…which should make everyone happy, I think.

This is fixed in svn revision #2998. The OS9 code is gone in 1.3, and so
is the conditional, so no svn revision there.

–ryan.