Difference between revisions of "cock.remapJoystickHat"
(Created page with "Maps exactly 4 joystick button to work as a joystick hat. It results in virtual hat that would act exactly like regular hat. == Synopsis == === Function === <source lang="Lua">co...") |
m |
||
Line 23: | Line 23: | ||
*[[Common Organization of Controls Kit]] | *[[Common Organization of Controls Kit]] | ||
− | {{#set:Description= | + | {{#set:Description=Maps buttons to hats.}} |
Revision as of 18:58, 1 September 2013
Maps exactly 4 joystick button to work as a joystick hat. It results in virtual hat that would act exactly like regular hat.
Synopsis
Function
cock.remapJoystickHat ( self, joystick, hat, up, down, left, right )
Arguments
table self
- An object to use.
{{param|number|joystick|Optional. Internal joystick number. Will use 1 if not provided. {{param|string|joystick|Optional. Internal joystick name. {{param|number|hat|Optional. LÖVE hat number. Will use 1 if not provided. {{param|string|hat|Optional. Hat name.
number up
- Optional. Button to map to dpad Up direction. Will use last value if not provided.
{{param|number|down|Optional. Button to map to dpad Down direction. Will use last value if not provided.
number left
- Optional. Button to map to dpad Left direction. Will use last value if not provided.
{{param|number|right|Optional. Button to map to dpad Right direction. Will use last value if not provided.
Remarks
Omitting all directions un-remaps the hat. You can map buttons one by one, but incomplete mapping would result in partial functionality (some directions won't work).
See also
- cock.addJoystick
- cock.setJoystickHatMode
- Common Organization of Controls Kit Fields
- Common Organization of Controls Kit Manual
- Common Organization of Controls Kit