CEL

Public API Reference

iPcCommandInput Struct Reference

Input propery class. More...

#include <propclass/input.h>

Inheritance diagram for iPcCommandInput:

List of all members.

Public Member Functions

virtual bool Bind (const char *triggername, const char *command)=0
 Binds a trigger to a command.
virtual float CenteredToScreen (float centeredcoord, float axis=0)=0
 Convert a coordinate from a value between -1 and 1 to screen-space.
virtual void DisableJoystickEvents ()=0
 Disable capturing of joystick events.
virtual void DisableKeyboardEvents ()=0
 Disable capturing of keyboard events.
virtual void DisableMouseEvents ()=0
 Disable capturing of mouse events.
virtual void EnableJoystickEvents ()=0
 Enable capturing of joystick events.
virtual void EnableKeyboardEvents ()=0
 Enable capturing of keyboard events.
virtual void EnableMouseEvents ()=0
 Enable capturing of mouse events.
virtual const char * GetBind (const char *triggername) const =0
 Returns the command bound to the given key.
virtual bool GetCookedMode () const =0
 Get whether or not this property class is in cooked mode.
virtual bool IsSendTriggerEnabled () const =0
 Is send trigger enabled or disabled?
virtual bool LoadConfig (const char *prefix)=0
 Loads from a config file binding triggers(for example keys) to commands.
virtual void RemoveAllBinds ()=0
 Deletes all binds.
virtual bool RemoveBind (const char *triggername, const char *command)=0
 Deletes a bind.
virtual void SaveConfig (const char *prefix)=0
 Saves to a config file binding triggers(for example keys) to commands.
virtual void ScreenCoordinates (bool screen=true)=0
 Send screen coordinates instead of coordinates between -1 and 1 for axis movement messages.
virtual float ScreenToCentered (float screencoord, float axis=0)=0
 Convert a coordinate from screen-space to a value between -1 and 1.
virtual void SetCookedMode (bool cooked)=0
 Enable/disable cooked mode.
virtual void SetSendTrigger (bool send)=0
 Enable/disable sending trigger name.

Detailed Description

Input propery class.

This property class supports the following actions (add prefix 'cel.commandinput.action.' if you want to access this action through a message):

This property class can send out the following messages to the behaviour:

This property class supports the following properties:

Config file format: <prefix>.Input.Bind.<command> = <trigger> [trigger2] [triggerN..]

Definition at line 77 of file input.h.


Member Function Documentation

virtual bool iPcCommandInput::Bind ( const char *  triggername,
const char *  command 
) [pure virtual]

Binds a trigger to a command.

The triggername can be equal to 'key' in which case all keys will be bound.

virtual float iPcCommandInput::CenteredToScreen ( float  centeredcoord,
float  axis = 0 
) [pure virtual]

Convert a coordinate from a value between -1 and 1 to screen-space.

Parameters:
centeredcoord a value between -1 and 1
axis the screen axis to use for the conversion (0 = x, 1 = y)
virtual void iPcCommandInput::DisableJoystickEvents (  )  [pure virtual]

Disable capturing of joystick events.

virtual void iPcCommandInput::DisableKeyboardEvents (  )  [pure virtual]

Disable capturing of keyboard events.

virtual void iPcCommandInput::DisableMouseEvents (  )  [pure virtual]

Disable capturing of mouse events.

virtual void iPcCommandInput::EnableJoystickEvents (  )  [pure virtual]

Enable capturing of joystick events.

virtual void iPcCommandInput::EnableKeyboardEvents (  )  [pure virtual]

Enable capturing of keyboard events.

virtual void iPcCommandInput::EnableMouseEvents (  )  [pure virtual]

Enable capturing of mouse events.

virtual const char* iPcCommandInput::GetBind ( const char *  triggername  )  const [pure virtual]

Returns the command bound to the given key.

virtual bool iPcCommandInput::GetCookedMode (  )  const [pure virtual]

Get whether or not this property class is in cooked mode.

See SetCookedMode for more information.

virtual bool iPcCommandInput::IsSendTriggerEnabled (  )  const [pure virtual]

Is send trigger enabled or disabled?

virtual bool iPcCommandInput::LoadConfig ( const char *  prefix  )  [pure virtual]

Loads from a config file binding triggers(for example keys) to commands.

Parameters:
prefix for the <prefix>.CommandInput.Bind.<trigger>
virtual void iPcCommandInput::RemoveAllBinds (  )  [pure virtual]

Deletes all binds.

virtual bool iPcCommandInput::RemoveBind ( const char *  triggername,
const char *  command 
) [pure virtual]

Deletes a bind.

If triggername is 0, all binds to the given command are deleted.

virtual void iPcCommandInput::SaveConfig ( const char *  prefix  )  [pure virtual]

Saves to a config file binding triggers(for example keys) to commands.

Parameters:
prefix for the <prefix>.CommandInput.Bind.<trigger>
virtual void iPcCommandInput::ScreenCoordinates ( bool  screen = true  )  [pure virtual]

Send screen coordinates instead of coordinates between -1 and 1 for axis movement messages.

virtual float iPcCommandInput::ScreenToCentered ( float  screencoord,
float  axis = 0 
) [pure virtual]

Convert a coordinate from screen-space to a value between -1 and 1.

Parameters:
screencoord the coordinate in screen-space
axis the screen axis to use for the conversion (0 = x, 1 = y)
virtual void iPcCommandInput::SetCookedMode ( bool  cooked  )  [pure virtual]

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'.
virtual void iPcCommandInput::SetSendTrigger ( bool  send  )  [pure virtual]

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 2.1 by doxygen 1.6.1