No description
Find a file
Ryan C. Gordon 53c1e9d007 To: sdl@libsdl.org
From: Christian Walther <cwalther@gmx.ch>
Date: Thu, 15 Dec 2005 21:19:53 +0100
Subject: [SDL] More mouse enhancements for Mac OS X

The attached patch brings two more enhancements to mouse handling on Mac
OS X (Quartz):

1. Currently, after launching an SDL application, SDL's notion of the
mouse position is stuck in the top left corner (0,0) until the first
time the mouse is moved. That's because the UpdateMouse() function isn't
implemented in the Quartz driver. This patch adds it.

2. When grabbing input while the mouse cursor is hidden, the function
CGAssociateMouseAndMouseCursorPosition(0) is called, which prevents the
system's notion of the mouse location from moving (and therefore leaving
the SDL window) even when the mouse is moved. However, apparently the
Wacom tablet driver (and maybe other special pointing device drivers)
doesn't care about that setting and still allows the mouse location to
go outside of the window. Interestingly, the system cursor, which is
made visible by the existing code in SDL in that case, does not follow
the mouse location, but appears in the middle of the SDL window. The
mouse location being outside of the window however means that mouse
button events go to background applications (or the dock or whatever is
there), which is very confusing to the user who sees no cursor outside
of the SDL window.

I have not found any way of intercepting these events (and that's
probably by design, as "normal" applications shouldn't prevent the user
from bringing other applications' windows to the front by clicking on
them). An idea would be placing a fully transparent, screen-filling
window in front of everything, but I fear that this might affect
rendering performance (by doing unnecessary compositing, using up
memory, or whatever).

The deluxe solution to the problem would be talking to the tablet
driver using AppleEvents to tell it to constrain its mapped area to the
window (see Wacom's "TabletEventDemo" sample app,
http://www.wacomeng.com/devsupport/mac/downloads.html), but I think that
the bloat that solution would add to SDL would outweigh its usefulness.

What I did instead in my patch is reassociating mouse and cursor when
the mouse leaves the window while an invisible grab is in effect, and
restoring the grab when the window is entered. That way, the grab can
still be effectively broken by a tablet, but at least it's obvious to
the user that it is broken. That change is minimal - it doesn't affect
operation with a mouse (or a trackpad), and the code that it adds is not
executed on every PumpEvents() call, only when entering and leaving the
window.

Unless there are any concerns about the patch, please apply. Feel free
to shorten the lengthy comment in SDL_QuartzEvents.m if you think it's
too verbose.

Thanks

  -Christian

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401215
2006-01-02 00:31:00 +00:00
docs *** empty log message *** 2004-12-16 06:39:54 +00:00
include Updated to the latest glext.h 2005-12-14 05:55:17 +00:00
src To: sdl@libsdl.org 2006-01-02 00:31:00 +00:00
test OS/2 port! 2005-11-23 07:29:56 +00:00
.cvsignore *** empty log message *** 2004-12-16 05:29:55 +00:00
acinclude.m4 Don't fail if we don't have ALSA available 2004-08-24 06:32:50 +00:00
autogen.sh Date: Fri, 2 Sep 2005 21:56:50 -0400 2005-09-11 04:15:44 +00:00
Borland.html *** empty log message *** 2003-07-01 01:18:27 +00:00
Borland.zip *** empty log message *** 2003-07-01 01:18:27 +00:00
BUGS Real Unicode support for X11. Based on updated version of this patch: 2005-11-21 00:16:34 +00:00
config.guess Updated libtool support so Mingw32 builds work. 2003-10-06 07:13:16 +00:00
config.sub Date: Sat, 24 Apr 2004 15:13:32 +0300 2004-05-06 15:55:06 +00:00
configure.in Fixed configure script on latest Mac OS X developer tools (and hopefully 2005-12-12 11:14:29 +00:00
COPYING Initial revision 2001-04-26 16:45:43 +00:00
CREDITS Lots of people have contributed cash. :) 2004-02-15 22:04:46 +00:00
CWprojects.sea.bin Updated version number 2005-08-24 05:49:57 +00:00
docs.html *** empty log message *** 2005-08-21 08:02:23 +00:00
EpocBuildFiles.zip Added support for building SDL for EPOC/SymbianOS 6.0 (thanks Hannu!) 2001-12-14 12:37:34 +00:00
INSTALL Date: Tue, 2 Mar 2004 11:34:54 +0100 2004-03-02 13:01:02 +00:00
ltmain.sh Updated libtool support for libtool 1.5.8 2004-08-21 20:35:50 +00:00
Makefile.am Merged the Visual C++ 6 and 7 projects so all Visual C++ users unpack the same set of projects to get started. 2005-08-24 21:57:48 +00:00
Makefile.dc Added initial support for Dreamcast (thanks HERO!) 2002-10-05 16:50:56 +00:00
MPWmake.sea.bin Updated projects with cpuinfo API 2004-02-10 17:34:38 +00:00
PBProjects.tar.gz The tenth time is the charm... 2004-05-20 10:05:59 +00:00
README QNX is now officially supported! Thanks to Mike Gorchak! 2003-08-30 17:09:59 +00:00
README-SDL.txt Initial revision 2001-04-26 16:45:43 +00:00
README.AmigaOS Updated the Amiga OS port of SDL (thanks Gabriele) 2001-05-10 20:13:29 +00:00
README.CVS *** empty log message *** 2004-05-16 22:37:59 +00:00
README.DC Added initial support for Dreamcast (thanks HERO!) 2002-10-05 16:50:56 +00:00
README.Epoc Added support for building SDL for EPOC/SymbianOS 6.0 (thanks Hannu!) 2001-12-14 12:37:34 +00:00
README.MacOS Date: Sat, 8 Sep 2001 04:42:23 +0200 2001-09-11 19:00:18 +00:00
README.MacOSX Updated SDL for MacOS X Xcode support 2004-12-06 04:17:56 +00:00
README.MiNT Document recent audio updates 2005-08-10 14:30:53 +00:00
README.NanoX Date: Sat, 24 Aug 2002 22:20:01 -0600 2002-08-25 06:21:49 +00:00
README.OS2 OS/2 port! 2005-11-23 07:29:56 +00:00
README.PicoGUI Added initial support for PicoGUI (thanks Micah!) 2002-08-01 23:24:13 +00:00
README.QNX Date: Sat, 24 Apr 2004 15:13:32 +0300 2004-05-06 15:55:06 +00:00
README.Qtopia Added a README for Qtopia 2002-06-01 18:43:51 +00:00
README.RISCOS Date: Wed, 26 Jan 2005 13:37:09 GMT 2005-02-12 18:01:31 +00:00
README.WinCE Updated for embedded Visual C++ 4.0 2002-08-20 00:20:06 +00:00
README.wscons To: sdl@libsdl.org 2005-11-22 15:19:50 +00:00
sdl-config.in Fixed static linking on MacOS X (thanks Max!) 2004-02-11 07:09:11 +00:00
sdl.m4 Date: Wed, 17 Aug 2005 11:23:40 -0400 2005-08-18 06:06:02 +00:00
SDL.qpg.in Date: Tue, 2 Mar 2004 08:52:20 +0200 2004-03-02 12:38:27 +00:00
SDL.spec.in The MacOSX Carbon/Cocoa/X11 all in one library patch. Relevant emails: 2005-09-08 06:16:14 +00:00
setvars.cmd OS/2 port! 2005-11-23 07:29:56 +00:00
strip_fPIC.sh Fixed to work on Solaris x86 2001-05-10 20:19:50 +00:00
TODO *** empty log message *** 2001-08-18 10:33:55 +00:00
VisualC.html Merged the Visual C++ 6 and 7 projects so all Visual C++ users unpack the same set of projects to get started. 2005-08-24 21:57:48 +00:00
VisualC.zip Merged the Visual C++ 6 and 7 projects so all Visual C++ users unpack the same set of projects to get started. 2005-08-24 21:57:48 +00:00
VisualCE.zip Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at 2005-09-29 09:43:00 +00:00
Watcom.mif OS/2 port! 2005-11-23 07:29:56 +00:00
WhatsNew *** empty log message *** 2004-01-08 16:01:07 +00:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 1.2

---
http://www.libsdl.org/

This is the Simple DirectMedia Layer, a general API that provides low
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
and 2D framebuffer across multiple platforms.

SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Java, Lua, ML,
Objective C, Perl, PHP, Pike, Python, and Ruby.

The current version supports Linux, Windows, BeOS, MacOS, MacOS X,
FreeBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.  The code contains
support for Windows CE, AmigaOS, Dreamcast, Atari, NetBSD, AIX, OSF/Tru64,
RISC OS, and SymbianOS, but these are not officially supported.

This library is distributed under GNU LGPL version 2, which can be
found in the file  "COPYING".  This license allows you to use SDL
freely in commercial programs as long as you link with the dynamic
library.

The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation is available in HTML format in "./docs/index.html"

The test programs in the "test" subdirectory are in the public domain.

Frequently asked questions are answered online:
	http://www.libsdl.org/faq.php

If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
	http://www.libsdl.org/mailing-list.php

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)