Commit Graph

31 Commits

Author SHA1 Message Date
Alex Szpakowski 33bc8aabfc Add Joystick:getGamepadMappingString and love.joystick.getGamepadMappingString(guid). Resolves issue #1371. 2019-09-15 14:02:19 -03:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
enra64 3ed404388b fixed not being able to remap gamepads by resolving problem with re-initializing joysticks as gamepads 2017-09-16 09:30:46 +02:00
Alex Szpakowski 8e83834722 Use the joystick's name in new gamepad mappings, when possible. Resolves issue #1370. 2018-02-16 18:20:35 -04:00
Alex Szpakowski 53872d813a Don't error when love.joystick.loadGamepadMappings is given an empty string/file, since saveGamepadMappings can produce that. Resolves issue #1375. 2018-02-07 22:32:06 -04:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Bart van Strien 7fa8fe7572 Fix replacement when using love.joystick.setGamepadMapping (issue #1298)
The broken find code would previously cause the (duplicate) key to be appended
to the end, now it successfully replaces the previous value

--HG--
branch : minor
2017-07-28 14:49:35 +02:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Alex Szpakowski b620f32200 Work around SDL issues in Joystick:getGamepadMapping with XInput controllers (issue #1239).
This doesn’t fix the underlying issues in SDL so there may be other aspects of love.joystick which are still affected.

--HG--
branch : minor
2016-12-10 16:14:14 -04:00
Alex Szpakowski 46a2e7b85c Happy new year! 🎉 2016-01-01 00:05:06 -04:00
Alex Szpakowski cffa899e03 Explicitly mention SDL in the error message caused by SDL subsystem initialization failure. 2015-03-26 14:51:47 -03:00
Bart van Strien 715cab4f6f Fix love.joystick.setGamepadMapping suffix overwriting bug
Previously, if "leftx" was mapped before "x", the latter mapping would overwrite
the former, or in general if any mapping was a suffix of another, it needed to
be mapped first.
2015-03-15 15:53:48 +01:00
Alex Szpakowski ebc68023a7 Fix many warnings about implicit integer conversions when compiling for 64 bits.
--HG--
branch : minor
2015-02-20 01:20:08 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski 195d41d1d9 Ignore lines starting with "#" when parsing the mappings string given to love.joystick.loadGamepadMappings. 2014-11-03 16:34:18 -04:00
Alex Szpakowski b9271ed25a Don't throw an error if the mappings passed to love.joystick.loadGamepadMappings contain mappings for other platforms but no mappings for the currently running platform. 2014-11-03 16:19:47 -04:00
Alex Szpakowski e26abb417e Fixed indentation. 2014-08-27 01:04:58 -03:00
Alex Szpakowski 1e8c9e18c3 Fixed love.joystick.setGamepadMapping: the generated SDL controller mapping string is no longer invalid, and joystick hats are now properly converted to the SDL representation. 2014-08-27 00:58:42 -03:00
Alex Szpakowski ddb9997ead Replaced Joystick:saveGamepadMapping with love.joystick.saveGamepadMappings, which saves all gamepad mappings from both recently-used joysticks and recently-modified mappings. saveGamepadMappings returns a string of newline-separated mappings and takes an optional filename argument which writes it to a file. 2014-06-05 00:25:34 -03:00
Alex Szpakowski 4cd4d35739 Fixed some logic 2014-06-04 16:06:36 -03:00
Alex Szpakowski 42a565a0eb Fixed love.joystick.loadGamepadMappings to properly enable currently connected Joysticks as Gamepads when necessary. 2014-06-04 16:03:02 -03:00
Alex Szpakowski 79b453653a Added love.joystick.loadGamepadMappings (resolves issue #842), and Joystick:saveGamepadMapping.
The latter returns a mapping string, and the former loads a newline-separated list of mapping strings.
2014-06-04 15:50:06 -03:00
Alex Szpakowski 036f6eb8cb Added an optional duration argument to Joystick:setVibration. 2014-05-10 16:52:40 -03:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04:00
Alex Szpakowski 8b7f151a4d Added joystick vibration support for most common controllers (resolves issue #159).
Added Joystick:setVibration(left, right), Joystick:getVibration, and Joystick:isVibrationSupported.
left and right are numbers between 0 and 1 which correspond to the strength of the gamepad's left and right rumble motors, if it has them.
2013-10-05 01:54:41 -03:00
Alex Szpakowski 95eedcd1be Using auto for some iterators for less dense-looking code 2013-09-30 02:35:10 -03:00
Alex Szpakowski d9cd10e29c love.joystick now scans for connected joysticks when the module is initialized instead of only relying on joystick add events 2013-09-16 02:42:50 -03:00
Alex Szpakowski 3ac0710544 Renamed Joystick:getProductGUID back to Joystick:getGUID 2013-08-30 23:50:29 -03:00
Alex Szpakowski 4fcf47a427 Renamed Joystick:getGUID to Joystick:getProductGUID for greater clarity 2013-08-28 04:21:08 -03:00
Alex Szpakowski 390a47099e Removed some dead/useless joystick code 2013-08-26 18:18:07 -03:00
Alex Szpakowski 113ed1cfe7 Merged SDL2 changes from bartbes/love-experiments/SDL2 into default.
- Added love.system module, including clipboard functions.

- Added custom hardware cursors (love.mouse.newCursor, love.mouse.setCursor.)

- Revamped love.joystick:
-- added Joystick objects and moved love.joystick functions which operated on individual joysticks to methods on the Joystick objects.
-- Added love.joystick.getJoystick and love.joystick.getJoystickCount.
-- Added events for when joysticks are connected and disconnected.
-- Added 'Gamepad' methods to Joystick objects: Joystick:isGamepad, Joystick:getGamepadAxis, and Joystick:isGamepadDown. They're a common abstraction for xbox controller-like joystick across operating systems.

- Added monitor choosing support and "fullscreen desktop" mode to love.window.

- Moved unicode text input events to their own callback function (love.textinput), removed the key repeat functions from love.keyboard and made the second argument of love.keypressed a boolean saying whether the keypress was a repeat.

- liblove now works with love.window and love.graphics in OS X
2013-08-25 16:51:42 -03:00