Difference between revisions of "Common Organization of Controls Kit Hat modes"

m
m (See also)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
Default mode for joystick hat is "8-way" diagonal input, just like default LÖVE's joystick hats, the other general mode is "4-way".
 
Default mode for joystick hat is "8-way" diagonal input, just like default LÖVE's joystick hats, the other general mode is "4-way".
 
== Basics ==  
 
== Basics ==  
 +
Following hat modes are defined:
 +
* "8-way" (1)
 +
* "4-way vertical" (2)
 +
* "4-way horizontal" (3)
 +
* "4-way clockwise" (4)
 +
* "4-way counter-clockwise" (5)
 +
* "4-way diagonal" (6)
 +
== Details ==
 
Since 4-way mode would discard all diagonal input, the update handler have 5 modes that specifically tell how to resolve diagonal input:
 
Since 4-way mode would discard all diagonal input, the update handler have 5 modes that specifically tell how to resolve diagonal input:
 
* Prefer vertical input ("4-way vertical")
 
* Prefer vertical input ("4-way vertical")
Line 12: Line 20:
 
* Convert diagonal to adjacent lateral ("4-way diagonal")
 
* Convert diagonal to adjacent lateral ("4-way diagonal")
 
** convert diagonal up and left to both lateral up and lateral left
 
** convert diagonal up and left to both lateral up and lateral left
== Details ==
+
 
 
As the name suggests, first two modes are axially biased and will more likely result in getting corresponding direction when actively working on D-pad, and this is more of a gameplay-related setting than actual adjustment, e.g. if you use left and right to move the block in a tetris game, having it accidntally dropped because player would hit the D-pad diagonally down is not desired, and this is when you enable horizontal bias.  
 
As the name suggests, first two modes are axially biased and will more likely result in getting corresponding direction when actively working on D-pad, and this is more of a gameplay-related setting than actual adjustment, e.g. if you use left and right to move the block in a tetris game, having it accidntally dropped because player would hit the D-pad diagonally down is not desired, and this is when you enable horizontal bias.  
  
Line 21: Line 29:
 
== See also ==
 
== See also ==
 
*[[cock.setJoystickHatMode]]
 
*[[cock.setJoystickHatMode]]
*[[cock.getConvertedJoystickHatMode]]
+
*[[cock.convertJoystickHatMode]]
 
*[[cock.remapJoystickHat]]
 
*[[cock.remapJoystickHat]]
 
*[[Common Organization of Controls Kit Manual]]
 
*[[Common Organization of Controls Kit Manual]]
 
*[[Common Organization of Controls Kit]]
 
*[[Common Organization of Controls Kit]]

Latest revision as of 19:16, 1 September 2013

Default mode for joystick hat is "8-way" diagonal input, just like default LÖVE's joystick hats, the other general mode is "4-way".

Basics

Following hat modes are defined:

  • "8-way" (1)
  • "4-way vertical" (2)
  • "4-way horizontal" (3)
  • "4-way clockwise" (4)
  • "4-way counter-clockwise" (5)
  • "4-way diagonal" (6)

Details

Since 4-way mode would discard all diagonal input, the update handler have 5 modes that specifically tell how to resolve diagonal input:

  • Prefer vertical input ("4-way vertical")
    • convert diagonal up to up and diagonal down to down
  • Prefer horizontal input ("4-way horizontal")
    • convert diagonal left to left and diagonal right to right
  • Prefer clockwise input ("4-way clockwise")
    • "turn" diagonal input 45 degrees clockwise, e.g. down-left becomes left, etc.
  • Prefer counter-clockwise input ("4-way counter-clockwise")
    • "turn" diagonal input 45 degrees counter-clockwise, e.g. down-left becomes down, etc.
  • Convert diagonal to adjacent lateral ("4-way diagonal")
    • convert diagonal up and left to both lateral up and lateral left

As the name suggests, first two modes are axially biased and will more likely result in getting corresponding direction when actively working on D-pad, and this is more of a gameplay-related setting than actual adjustment, e.g. if you use left and right to move the block in a tetris game, having it accidntally dropped because player would hit the D-pad diagonally down is not desired, and this is when you enable horizontal bias.

The other two are radially biased (in some way they are unbiased) and although they don't make any direction pressed any more likely, they make changing D-pad direction more fluent in one way and more stiff in the other way. This modes give better feel of purely 4-directional D-pad on immediate hat presses, while maintaining only allowing one direction at a time. You may, in fact, just randomly use either of them, but you may also provide choosing between them as an option, since not all joysticks' hats are made so great, and specific mode enabled may actually improve players' accuracy.

The last mode doesn't actually adjusts anything and just passes by the input, "splitting" it in two.

See also