iPcCommandInput Struct Reference
Input propery class. More...
#include <propclass/input.h>
Detailed Description
Input propery class.
This property class supports the following actions (add prefix 'cel.action.' to get the ID of the action and add prefix 'cel.parameter.' to get the ID of the parameter):
- Activate: parameter 'activate' (bool default=true).
- Bind: parameters 'trigger' (string) and 'command' (string). The 'trigger' can be equal to 'key' in which cases all keys will be bound. Also .args can be appended to the command name, to receive key/button state in message arguments, instead of in message name.
- RemoveBind: paramaters 'trigger' (string) and 'command' (string).
- RemoveAllBinds.
- LoadConfig: parameters 'prefix' (string).
- SaveConfig: parameters 'prefix' (string).
This property class can send out the following messages to the behaviour:
- pccommandinput_<key>: key event. Message receives 'state' parameter filled with values from celKeyState enum. Also has optional 'trigger' parameter. This is received instead of the other key messages below depending on '.args' suffix on command specification (see above).
- pccommandinput_<key>0: key is unpressed. Message has optional 'trigger' parameter.
- pccommandinput_<key>1: key is pressed. Message has optional 'trigger' parameter.
- pccommandinput_<key>_: key is pressed and auto-repeating. Message has optional 'trigger' parameter.
- pccommandinput_<axis>: movement on the given axis.
This property class supports the following properties (add prefix 'cel.property.' to get the ID of the property:
- screenspace (bool, read/write): use screenspace instead of -1/1 normalized coordinates (default is -1/1).
- cooked (bool, read/write): use cooked mode instead of raw (default is raw).
- sendtrigger (bool, read/write): send out trigger name in the message to the behaviour. (default is false).
Config file format: <prefix>.Input.Bind.<command> = <trigger> [trigger2] [triggerN..]
Definition at line 80 of file input.h.
Member Function Documentation
Activates this input property class.
When activated, it will catch input events and send command messages.
Binds a trigger to a command.
The triggername can be equal to 'key' in which case all keys will be bound.
Convert a coordinate from a value between -1 and 1 to screen-space.
- Parameters:
-
Disable capturing of joystick events.
Disable capturing of keyboard events.
Disable capturing of mouse events.
Enable capturing of joystick events.
Enable capturing of keyboard events.
Enable capturing of mouse events.
Returns the command bound to the given key.
Get whether or not this property class is in cooked mode.
See SetCookedMode for more information.
Is send trigger enabled or disabled?
Loads from a config file binding triggers(for example keys) to commands.
- Parameters:
-
Deletes all binds.
Deletes a bind.
If triggername is 0, all binds to the given command are deleted.
Saves to a config file binding triggers(for example keys) to commands.
- Parameters:
-
Send screen coordinates instead of coordinates between -1 and 1 for axis movement messages.
Convert a coordinate from screen-space to a value between -1 and 1.
- Parameters:
-
Enable/disable cooked mode.
By default raw mode is used which means that keyboard events are parsed in raw mode. That implies the following:
- You can't bind on key combinations like Shift-F3
- Binding on 'a' is the same as 'A'. In cooked mode you can bind on key combinations and on keys like 'shift'.
Enable/disable sending trigger name.
When this is enabled this property class will add a 'trigger' parameter to all keyboard messages. That parameter will be the name of the keyboard event that triggered the message. By default this is disabled.
The documentation for this struct was generated from the following file:
Generated for CEL: Crystal Entity Layer 1.4.1 by doxygen 1.7.1