Difference between revisions of "Common Organization of Controls Kit Modes"

(Created page with "Inversion and delta mode are used to alter input readings in easy fashion. == Basics == Inversion mode is pretty straightforward, it simply negates input. Delta mode is a little ...")
 
m (Details)
Line 4: Line 4:
 
== Details ==
 
== Details ==
 
Delta mode is particularry useful when used with joystick; this opens possibility to implement obscure and cunning ways of using analog sticks and XBox360 triggers, that aren't normally can be seen in the games. When used with mouse, this simply returns distance travelled from previous coordinate. Note that if you want FPS-like controls where you would constantly set mouse back to the center of the screen, you should instead use "bypass" mode, since in this state, delta mode would yield acceleration of the mouse rather than distance travelled. You can still use that nevertheless, if you may.
 
Delta mode is particularry useful when used with joystick; this opens possibility to implement obscure and cunning ways of using analog sticks and XBox360 triggers, that aren't normally can be seen in the games. When used with mouse, this simply returns distance travelled from previous coordinate. Note that if you want FPS-like controls where you would constantly set mouse back to the center of the screen, you should instead use "bypass" mode, since in this state, delta mode would yield acceleration of the mouse rather than distance travelled. You can still use that nevertheless, if you may.
 +
 +
You can also use delta mode to register key presses or key releases, which is useful for "jump" keys etc. Delta with "cutoff" mode could report you if joystick have moved further, but not when it moved the opposite direction, which results in "dragging"-like input.
  
 
You set these modes with [[cock.bind]] function. If you only want to change one or few them, you'd have to first obtain original values with [[cock.getBinded]], modify them, and bind them back. This is done that way for the sake of simplicity.
 
You set these modes with [[cock.bind]] function. If you only want to change one or few them, you'd have to first obtain original values with [[cock.getBinded]], modify them, and bind them back. This is done that way for the sake of simplicity.
 +
 
== Modes list ==
 
== Modes list ==
 
=== Inverse ===
 
=== Inverse ===

Revision as of 12:21, 1 September 2013

Inversion and delta mode are used to alter input readings in easy fashion.

Basics

Inversion mode is pretty straightforward, it simply negates input. Delta mode is a little bit trickier. In this mode, instead of reporting absolute value, the control object reports delta value, that is how much input have changed since last update. You can think of it as a velocity at which the reading changes, that is mouse velocity or joystick thumstick velocity. Both delta and inversion modes have "cutoff" mode to prevent it from returning negative values. Delta mode and inversion mode are both having "negative" modes that work together: any negatives negates the output, and double negative makes positive. This may seem to be excessive, but actually it's a lot simplier to do it that way. There's also one special inversion mode for joysticks - "whole" - that converts -1..1 range to 0..1 range, which is particularry useful for HOTAS controllers and XBox360 triggers.

Details

Delta mode is particularry useful when used with joystick; this opens possibility to implement obscure and cunning ways of using analog sticks and XBox360 triggers, that aren't normally can be seen in the games. When used with mouse, this simply returns distance travelled from previous coordinate. Note that if you want FPS-like controls where you would constantly set mouse back to the center of the screen, you should instead use "bypass" mode, since in this state, delta mode would yield acceleration of the mouse rather than distance travelled. You can still use that nevertheless, if you may.

You can also use delta mode to register key presses or key releases, which is useful for "jump" keys etc. Delta with "cutoff" mode could report you if joystick have moved further, but not when it moved the opposite direction, which results in "dragging"-like input.

You set these modes with cock.bind function. If you only want to change one or few them, you'd have to first obtain original values with cock.getBinded, modify them, and bind them back. This is done that way for the sake of simplicity.

Modes list

Inverse

  • "negative whole" (-=)
  • "negative cutoff" (--)
  • "negative" (-)
  • "positive" (+)
  • "positive cutoff" (++)
  • "positive whole" (+=)

Delta

  • "negative cutoff" (--)
  • "negative" (-)
  • "bypass" (=)
  • "positive" (+)
  • "positive cutoff" (++)

See also