cock.remapJoystickHat

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