Difference between revisions of "Common Organization of Controls Kit"
m (→Changelog) |
(Adding keyword.) |
||
(16 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | <div style="margin:3em auto; width: 70%; max-width: 60em; padding: 2em; border-radius: 1em; border-style: dashed; border-width: 0.2em; border-color: #8BC; background: #DEF; text-align: center"><div style="position: relative; top: -1.3em; left: -1.3em; float: left">Note:</div><span style="font-size: 1.4em; font-weight:300;">Current version: 1.3<br><br>The library does not currently have examples.</span></div> | ||
+ | |||
Common Organization of Controls Kit is a tool for handling control over your LÖVE games. | Common Organization of Controls Kit is a tool for handling control over your LÖVE games. | ||
− | It enables you to easily define a (several of) set of control bindings to be used in your game, and provides a very user-friendly methods for handling it, e.g. you can access all gathered data as a table member, and it has a function to grab a user input to store it into control map, and to unset it, which is really handy in controls setup screen etc. | + | '''This is an input handling library.''' It enables you to easily define a (several of) set of control bindings to be used in your game, and provides a very user-friendly methods for handling it, e.g. you can access all gathered data as a table member, and it has a function to grab a user input to store it into control map, and to unset it, which is really handy in controls setup screen etc. '''Check out the demo!''' http://love2d.org/forums/download/file.php?id=8398 |
− | This library have much detail to it, please consutlt the [[Common Organization of Controls Kit Manual|manual]]. | + | This library have much detail to it, please '''consutlt the [[Common Organization of Controls Kit Manual|manual]]'''. |
'''NOTE:''' the library only support latest released version of LÖVE, and the author only support latest released version of the library. There may be no backwards compatibility. | '''NOTE:''' the library only support latest released version of LÖVE, and the author only support latest released version of the library. There may be no backwards compatibility. | ||
== Features == | == Features == | ||
− | * | + | * Multiple separate control objects |
− | * | + | * Comprehensive controls setup |
− | * | + | * Support for "defaults" |
− | * Capture user input | + | * All available input devices supported |
− | * | + | * Capture and bind user input |
− | + | * Joystick deadzones and hat remapping, hat modes, pick up previously used joysticks | |
− | + | * Delta modes and inversion modes | |
− | + | * Literal or numerical arguments to functions; number of helper functions | |
− | + | ||
− | * | + | Scheduled: |
− | * Literal arguments | ||
− | |||
− | + | * XBox360 controller support for all OSes (for now only works with Windows, partially) | |
+ | * Functions to save/load configurations (for now simple serialization of the object will do) | ||
== Links == | == Links == | ||
Line 29: | Line 30: | ||
== Changelog == | == Changelog == | ||
+ | * 1.3: | ||
+ | ** fixed: | ||
+ | *** code refactoring; improved consistency | ||
+ | *** fixed broken event handler locks | ||
+ | *** generating random IDs now work properly | ||
+ | *** fixed issue with spacebar key and :explodeCapturedData/:bind ( unexplodedData ) functions | ||
+ | *** fixed all :*Joystick* functions. | ||
+ | *** :addJoystick will now create a dummy joystick if it's impossible to actually create the joystick | ||
+ | ** added: | ||
+ | *** .defaultOption and defaultConfig fields | ||
+ | *** :convetJoystickHat, :convertJoystickHatMode, :convertKey | ||
+ | *** :find returns control object with given ID | ||
+ | *** :updateAll updates all registered objects | ||
+ | *** :addJoystick and :removeJoystick (handled automatically) | ||
+ | *** .controlcaptured, .controlpeaked, .controlzeroed, .controlpressed, .controlreleased, .controlchanged callbacks | ||
+ | *** :setCallbacks for enabling/disabling above callbacks | ||
+ | *** addded 4-way diagonal hat mode (4-way input, diagonal input generates both conjuncted directions input) | ||
+ | ** changed: | ||
+ | *** control objects now have unique identifiers | ||
+ | *** control binds data will no longer accept one-default arranged data | ||
+ | *** event callbacks are now supplied with ID of the sender object | ||
+ | *** all joystick-related functions now have "device id" field which specifies the joystick used in terms of control object | ||
+ | *** :setDefaultXBox360 now accepts device ID to use | ||
+ | *** :capturedDataExplode renamed to :explodeCapturedData (lol) | ||
+ | *** conversion functions now have argument "literal" to force either literal or numerical output | ||
+ | *** :getBinded and pals are now return raw unconverted data | ||
+ | *** :setCapture function will now by default invoke the callback | ||
+ | *** renamed joystick hat modes | ||
+ | *** lookup tables will now grow further to avoid extra garbage/increase function performance | ||
+ | *** :setDefaultXBox360 now returns joystick ID (could change) | ||
+ | ** removed: | ||
+ | *** :setControlMode and pals | ||
+ | *** :setDefaultXBox360 for Linux and OS X | ||
+ | * 1.2: | ||
+ | ** fixed: | ||
+ | *** a bunch of potential pitfalls | ||
+ | *** joystick axes and hats are now correctly captured | ||
+ | **added: | ||
+ | *** no-cutoff for negative values for inversion | ||
+ | *** multiple binds per action via "options" tables | ||
+ | *** :setJoystickDeadzone and getJoystickDeadzone gets and sets joystick deadzone per axis | ||
+ | *** :getJoysticksList returns list of all found joysticks names and numbers | ||
+ | *** :remapJoystickHat maps four joystick buttons to act like joystick hat | ||
+ | *** :bind directly binds mappings | ||
+ | *** :getBinded returns list of binds for map | ||
+ | *** :getEmptyOption returns next (in arbitrary order) unused option for map | ||
+ | *** :getControlModesList returns list of all control modess | ||
+ | *** :getConvertedDevice, :getConvertedAxis, :getConvertedInverse, :getConvertedDelta | ||
+ | *** cutoff delta modes and inversion modes (only pass positive/negative part) | ||
+ | *** :setDefaultXBox360 function (currently used XBox360 controller API in Windows version sucks pretty hard) | ||
+ | *** :capturedDataExplode helper function (can't pass table to LÖVE's events) | ||
+ | ** changed: | ||
+ | *** :setCapture now accepts "callback" argument to be used instead of instant automatical binding | ||
+ | *** :grab now would either call callback function or instantly bind captured input | ||
+ | *** :unset renamed to :unbind | ||
+ | *** controls data table for assignment now have different format | ||
+ | *** :getJoystickHatMode and :getControlMode now only return literal value | ||
+ | *** joystick axis delta mode no longer requires stick to be on the corresponding side either (that was silly, too) | ||
+ | ** removed: | ||
+ | *** :getDeviceName (replaced with :getBinded) | ||
* 1.1: | * 1.1: | ||
** fixed: | ** fixed: | ||
Line 43: | Line 104: | ||
== See also == | == See also == | ||
* [[TLbind]] | * [[TLbind]] | ||
+ | * [[Common Organization of Controls Kit Manual]] | ||
{{#set:LOVE Version=0.8.0}} | {{#set:LOVE Version=0.8.0}} | ||
− | {{#set:Description=Comprehensive | + | {{#set:Description=Comprehensive input handling library}} |
+ | {{#set:Keyword=Input}} | ||
[[Category:Libraries]] | [[Category:Libraries]] |
Latest revision as of 11:08, 18 January 2017
The library does not currently have examples.
Common Organization of Controls Kit is a tool for handling control over your LÖVE games.
This is an input handling library. It enables you to easily define a (several of) set of control bindings to be used in your game, and provides a very user-friendly methods for handling it, e.g. you can access all gathered data as a table member, and it has a function to grab a user input to store it into control map, and to unset it, which is really handy in controls setup screen etc. Check out the demo! http://love2d.org/forums/download/file.php?id=8398
This library have much detail to it, please consutlt the manual.
NOTE: the library only support latest released version of LÖVE, and the author only support latest released version of the library. There may be no backwards compatibility.
Contents
Features
- Multiple separate control objects
- Comprehensive controls setup
- Support for "defaults"
- All available input devices supported
- Capture and bind user input
- Joystick deadzones and hat remapping, hat modes, pick up previously used joysticks
- Delta modes and inversion modes
- Literal or numerical arguments to functions; number of helper functions
Scheduled:
- XBox360 controller support for all OSes (for now only works with Windows, partially)
- Functions to save/load configurations (for now simple serialization of the object will do)
Links
- Project page: http://raidho36.net/stuff/cock
- Forum thread: http://love2d.org/forums/viewtopic.php?f=5&t=40089
Changelog
- 1.3:
- fixed:
- code refactoring; improved consistency
- fixed broken event handler locks
- generating random IDs now work properly
- fixed issue with spacebar key and :explodeCapturedData/:bind ( unexplodedData ) functions
- fixed all :*Joystick* functions.
- :addJoystick will now create a dummy joystick if it's impossible to actually create the joystick
- added:
- .defaultOption and defaultConfig fields
- :convetJoystickHat, :convertJoystickHatMode, :convertKey
- :find returns control object with given ID
- :updateAll updates all registered objects
- :addJoystick and :removeJoystick (handled automatically)
- .controlcaptured, .controlpeaked, .controlzeroed, .controlpressed, .controlreleased, .controlchanged callbacks
- :setCallbacks for enabling/disabling above callbacks
- addded 4-way diagonal hat mode (4-way input, diagonal input generates both conjuncted directions input)
- changed:
- control objects now have unique identifiers
- control binds data will no longer accept one-default arranged data
- event callbacks are now supplied with ID of the sender object
- all joystick-related functions now have "device id" field which specifies the joystick used in terms of control object
- :setDefaultXBox360 now accepts device ID to use
- :capturedDataExplode renamed to :explodeCapturedData (lol)
- conversion functions now have argument "literal" to force either literal or numerical output
- :getBinded and pals are now return raw unconverted data
- :setCapture function will now by default invoke the callback
- renamed joystick hat modes
- lookup tables will now grow further to avoid extra garbage/increase function performance
- :setDefaultXBox360 now returns joystick ID (could change)
- removed:
- :setControlMode and pals
- :setDefaultXBox360 for Linux and OS X
- fixed:
- 1.2:
- fixed:
- a bunch of potential pitfalls
- joystick axes and hats are now correctly captured
- added:
- no-cutoff for negative values for inversion
- multiple binds per action via "options" tables
- :setJoystickDeadzone and getJoystickDeadzone gets and sets joystick deadzone per axis
- :getJoysticksList returns list of all found joysticks names and numbers
- :remapJoystickHat maps four joystick buttons to act like joystick hat
- :bind directly binds mappings
- :getBinded returns list of binds for map
- :getEmptyOption returns next (in arbitrary order) unused option for map
- :getControlModesList returns list of all control modess
- :getConvertedDevice, :getConvertedAxis, :getConvertedInverse, :getConvertedDelta
- cutoff delta modes and inversion modes (only pass positive/negative part)
- :setDefaultXBox360 function (currently used XBox360 controller API in Windows version sucks pretty hard)
- :capturedDataExplode helper function (can't pass table to LÖVE's events)
- changed:
- :setCapture now accepts "callback" argument to be used instead of instant automatical binding
- :grab now would either call callback function or instantly bind captured input
- :unset renamed to :unbind
- controls data table for assignment now have different format
- :getJoystickHatMode and :getControlMode now only return literal value
- joystick axis delta mode no longer requires stick to be on the corresponding side either (that was silly, too)
- removed:
- :getDeviceName (replaced with :getBinded)
- fixed:
- 1.1:
- fixed:
- capturing an input now sets both "previous" and "current" tables to captured input value
- mouse axis delta mode no longer requires mouse pointer to be on the corresponding side of the offset
- added:
- getDeviceName function returns literal name of a device assiged to specified map
- changed:
- reloadJoystick now returns true on success
- fixed:
- 1.0:
- first release version