Commit graph

98 commits

Author SHA1 Message Date
Edward Rudd
cd7a350e3d add in support for passing down the "natural" (or flipped) scrolling direction in the MouseWheelEvent event 2014-12-03 11:00:56 -05:00
Philipp Wiesemann
1a726f39d2 Updated README name in header. 2014-08-11 22:53:03 +02:00
Sam Lantinga
9dcc87296e Clarified the documentation for SDL_FlushEvents() so people know it only affects currently queued events. 2014-07-09 01:34:40 -07:00
Sam Lantinga
c0e9a9afaf Added an event SDL_RENDER_DEVICE_RESET, which is triggered on Direct3D 11 when the device has been lost and all textures need to be recreated. 2014-03-23 23:09:22 -07:00
Sam Lantinga
6c4e7ebabe Fixed bug 2346 - Mac: mousewheel events have flipped horizontal scroll values
Alex Szpakowski

On my Mac OS X system (10.9.1), the SDL_MOUSEWHEEL event reports negative X values when my trackpad scrolls to the right, and positive X values when my trackpad scrolls to the left. This is backwards from what I'd expect, and I don't think it matches the Windows wheel events.

The vertical scroll values are what I'd expect though, and are consistent what gets reported on Windows (positive Y for scrolling up, negative Y for scrolling down.)

This is with "scroll direction: natural" disabled in the OS X trackpad settings (i.e. my scroll direction in non-SDL OS X programs matches what happens in Windows and Linux.)

I also tested with the horizontal scroll on a real mouse (Logitech G500 without custom drivers), and the horizontal scroll values in SDL are still flipped.

I "solved" the issue for myself by changing this line in the Cocoa_HandleMouseWheel function:

    float x = [event deltaX];

to this:

    float x = -[event deltaX];

I believe it should work fine with that change - I found something similar in another codebase while looking online for my issue - but I haven't tested on anything below Mac OS 10.8.
2014-02-22 14:57:12 -08:00
Sam Lantinga
f656316b9f Recreate render target textures when the D3D device is being reset, and notify the application using the SDL_RENDER_TARGETS_RESET event when this happens. 2014-02-10 10:02:51 -08:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Sam Lantinga
11fc41fde2 Added support for double-clicks, through a new "clicks" field in the mouse button event. 2013-12-23 12:17:52 -08:00
Gabriel Jacobo
298ce1c1a7 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
271e0d67c4 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Philipp Wiesemann
05c75b191f Changed comment to be used by doxygen. 2013-06-16 12:00:54 +02:00
Philipp Wiesemann
ad82c94c55 Updated names of README files in source comments. 2013-06-09 11:58:31 +02:00
Philipp Wiesemann
c2d84dbad6 Fixed doxygen warnings and corrected documentation in header files. 2013-06-05 23:33:15 +02:00
Sam Lantinga
c2805292c8 Fixed bug 1856 - (Patch) More bits for SDL_MouseMotionEvent.state
Gerry JJ

The state bitmask in SDL_MouseMotionEvent is stored in an Uint8. Unfortunately this doesn't actually have room for 8 buttons because SDL skips 4 button indices after the third mouse button (at least here on Linux x86-64, probably related to wheel handling?), so it's really just enough to track 4 buttons. For example, on a Logitech MX310 mouse I've got, even though the mouse has 6 buttons total, the left and right side buttons and extra middle button have indexes 8, 9 and 10, and the last two won't fit in the 8 bit button state.

The source of the button state (in SDL_Mouse) is already 32-bit, and the state field in SDL_MouseMotionEvent is 32-bit aligned and followed by three 8-bit padding fields. So simply changing the SDL_MouseMotionEvent state to an Uint32 and removing the padding fields fixes this, and I think it should be binary compatible, at least for little endian.
2013-05-20 23:57:10 -07:00
Sam Lantinga
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
2ac8624930 Added mobile application events, with implementations for iOS and Android 2013-05-18 12:48:50 -07:00
Philipp Wiesemann
f86b25c56e Fixed Doxygen warnings. 2013-05-18 14:48:19 +02:00
Philipp Wiesemann
c0f29fb59a Corrected spelling in header files. 2013-04-27 17:52:58 +02:00
David Ludwig
cf8a84626b future-proofing for Microsoft's C++/CX extensions, whereby "generic" is a reserved keyword 2013-04-20 23:05:08 -04:00
Sam Lantinga
69b8182419 The joystick events contain a joystick instance ID, which is a signed value, with -1 being invalid. 2013-03-06 11:59:21 -08:00
Sam Lantinga
85d6d00788 Removed multi-input events, since we removed the unimplemented API recently. 2013-03-06 11:59:15 -08:00
Edward Rudd
5fd98b3297 add new gamecontroller APIs
- add mappings after init (or even before w/o using the hint)
- get string for axis
- get string for button
- get mapping string for controller or for GUID
- new event to notify when a controller is remapped. (e.g. mapping was changed via the AddMapping method)
2013-03-05 17:59:36 -05:00
Sam Lantinga
bb0752e573 Updated touch API
* Normalized touch coordinates as floats in the 0...1 range
* Removed unused touchpad concepts from the API
* Added API functions to get active touch devices and current finger state
2013-03-03 01:01:33 -08:00
Sam Lantinga
71ea3033fa Added a mouse ID to the mouse events, which set to the special value SDL_TOUCH_MOUSEID for mouse events simulated by touch input. 2013-03-02 20:44:16 -08:00
Sam Lantinga
c02018f852 Fixed the joystick id usage in the joystick and game controller events. 2013-03-02 17:51:32 -08:00
Ryan C. Gordon
a5862a96a3 Changed the game controller enum types to match SDL naming conventions. 2013-02-25 00:56:21 -05:00
Sam Lantinga
95dcfa4c28 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
34b88dfaae Added hotplug joystick support and simplified game controller API, courtesy of Alfred Reynolds 2012-11-26 16:37:54 -08:00
Sam Lantinga
995e8dc838 Switch C++ comment to C comment 2012-10-21 22:18:36 -07:00
Sam Lantinga
df0e5d1844 Fixed another gcc <-> Visual C++ ABI issue 2012-10-20 00:49:08 -07:00
Sam Lantinga
5ef4144446 Removed the SDL 1.2 compatibility API... we'll see how painful this is. 2012-01-22 18:11:41 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
3a7d58ddf8 Fixed bug 1336 - Added a timestamp on all SDL events
Gueniffey 2011-11-23 04:11:31 PST

The attached simple patch adds a timestamp to all SDL events. It is useful to
dismiss old events and add UI responsiveness (my application does some
extensive tasks that creates a delay in the event queue handling. With this
patch, I can deal only with the most recent events.
2011-12-29 05:13:55 -05:00
Sam Lantinga
f52f040b3d First pass at a simple drag and drop API, allowing you to accept files dropped into your application. 2011-11-20 19:38:18 -05:00
Sam Lantinga
2c5a3ddb62 Fixed a typo in the header. 2011-11-07 02:25:01 -05:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
e5803d148c Happy 2011! :) 2011-02-11 22:37:15 -08:00
Sam Lantinga
76a24d278d Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased. 2011-02-07 09:37:11 -08:00
Sam Lantinga
52cf8a6451 Added functions to watch events as they go through the event queue. 2011-02-01 19:15:42 -08:00
krogoway
a2f2302255 Renamed SDL_keysym to SDL_KeySym
Renamed SDL_scancode to SDL_ScanCode
Added #defines to SDL_compat.h
2011-01-24 13:47:35 -06:00
Sam Lantinga
6654cd07b3 Fixed compiler error 2011-01-17 14:05:14 -08:00
Sam Lantinga
24cfae7d89 Minor documentation consistency cleanup 2011-01-17 09:09:15 -08:00
Sam Lantinga
5152fac7f8 Fixed spacing in comments 2011-01-12 11:55:02 -08:00
Sam Lantinga
a8c8dc3e09 Updated headers to match wiki documentation 2011-01-12 09:47:33 -08:00
Sam Lantinga
238acbd53d Merged Jim's Google Summer of Code work from SDL-gsoc2010_gesture 2010-08-22 12:07:55 -07:00
Jim Grandpre
794c5cb3ee Added README.touch and README.gesture. Moved touchtest/gestureSDLTest to test/testgesture 2010-08-15 00:36:28 -04:00
Sam Lantinga
f0de16c63e Fixed documentation error 2010-08-14 12:28:43 -07:00
Jim Grandpre
bcd4b4df6f Fixed gestureMulti. Disabled dollar gesture temporarily. 2010-08-04 23:17:30 -04:00
jimtla
39ee818f98 Added SDL_TouchID, SDL_FingerID, SDL_GestureID types. Converted to integer cioordinates (<- not working). 2010-07-31 20:02:54 +04:00
jimtla
c9b9312be3 Upgraded touchId/fingerId to long. Changed position variables to floats. 2010-07-30 23:18:35 +04:00