Controller Information
From KruelWiki
Contents |
General
We plan to support the following input devices:
- Keyboard
- Mouse
- Single or Dual Joystick
Should there be sufficent support (ie, donations and requests) for it we will support MS-Force Feedback and iForce.
| Axis | State | Click | |
|---|---|---|---|
| Keyboard | |||
| Mouse Axis | Y | NA | NA |
| Mouse Button | |||
| Joystick Axis | Y | NA | NA |
| Joystick Button | Y |
(blank) = None, P = Partial, Y = Complete, NA = Not Appropriate
Bindings file format
bind [[control]] [[effect]] deadzone [mouse|joy %joynum] %axis %amount
I really dont like deta's when dealing with controls. This may change, but i think using an absolute value is a far better option in this game, so all axis will report their ABSOLUTE value, relative to the centre of the screen, in the range [-1,1].
deadzone
This allows us to stop joystick/mouse jitters. Amount should be in the range [0.0,1.0]. Using a value of 1.0 will disable the axis. Output from axis where abs(value) > deadzone will be scaled as: (value - deadzone) / (1.0 - deadzone).
Each axis has to be named individually as 4 axis joysticks (3d + throttle) have 3 movement types each of which require different operational settings.
Sample deadzone entry to ignore first 10% of movement on x/y/z, and the first 3% on throttle:
deadzone joy 0 0 0.1 deadzone joy 0 1 0.1 deadzone joy 0 2 0.1 deadzone joy 0 3 0.03
Possible Additions
- Negative value pulls back the limits
[control] Sections
Any and all scalings are purely to make 'grey' controls more sensitive, in doing so the actual resolution is decreased. It will also allow for inversion of an axis by using a negative number.
The numerical value returned from controls will be clamped to the range [-1,1] for each axis.
Keystrokes
- key_down %stroke %mods
- Fired once on key down
- key_up %stroke %mods
- Fired once on key up (release)
- key_press %stroke mods
- Fires value on key_down and bitwise not on key_up
To perform a "set state teststate while key is held down" use:
bind key_down 55 0 state weapon_fire 1 bind key_down 55 0 state weapon_fire 0or
bind key_press 55 0 state weapon_fire 1
They both do (or should do) the same thing.
Mouse
- mouse_axis %axis
- Fired when axis changes. Can only be bound to an axis.
- mouse_button %button
- Fired on button press.
Its worth noting that OGRE scales the mouse X/Y to [0.0,1.0] ... it is then scaled to [-1.0,1.0] to be consistant with joystick axis.
Joystick
- joystick_axis %joynum %axis
- Value is based on the value of the appropriate axis. Can only be bound to a control axis.
- joystick_button %joynum %button
- Button is pressed
[effect]
There are three main effect types:
- Axis: These are values that can be represented by a floating point number between either [-1:1] or [0:1].
- State: These values are continuous, such as gunfire that can be activated for long periods of time.
- Click: Values that are 'click' that require multiple presses for multiple triggers
Axis
Valid axis can be found in the ControlManager.h file, under the Axis enum. Currently they are:
- THRUST - Throttle amount (move forward and back)
- STRAFE - Strafe amount (move left and right)
- ATTITUDE - Attitude amount (move up and down)
- TILT - Tilt amount (rotate around the direction you are facing)
- PITCH - Pitch amount (turn up & down)
- YAW - Yaw amount (turn left & right)
Examples
bind joystick_axis 0 0 axis pitch 1.0

