CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csutil/inpnames.h File Reference

Crystal Space input library. More...

#include "iutil/evdefs.h"
#include "iutil/event.h"
#include "csstring.h"

Go to the source code of this file.

str Strings are in the form "Ctrl+a", "alt-shift+enter" etc.

Convert a free-format string into a set of values that can be compared against the data of a keyboard event.
Parameters:
rawCode  Pointer to where the raw code is written to.
cookedCode  Pointer to where the cooked code is written to.
modifiers  Pointer where the key modifiers are written to.
Returns:
Whether the string could be successfully parsed. Error can be unrecognized keys etc.
Remarks:
For any piece of information in which you are not interested, pass 0 for the address.
The cooked code returned *may* be 0. This is the case if the non-modifier part is a single letter.


bool csParseKeyDef (const char *str, utf32_char *rawCode, utf32_char *cookedCode, csKeyModifiers *modifiers)
csString csGetKeyDesc (utf32_char code, const csKeyModifiers *modifiers, bool distinguishModifiers=true)
 Convert a keycode and an optional set of modifiers into a free-form key string.

bool csParseMouseDef (const char *str, int *x, int *y, int *button, csKeyModifiers *modifiers)
 Convert a free-format string into a set of values that can be compared against the data of a mouse event.

bool csParseJoystickDef (const char *str, int *x, int *y, int *button, csKeyModifiers *modifiers)
 Convert a free-format string into a set of values that can be compared against the data of a joystick event.


Defines

#define CSAXIS_X   -1
 Use in `int button' for csevXXXMove events with the backward compatible funcs.

#define CSAXIS_Y   -2
 Use in `int button' for csevXXXMove events with the backward compatible funcs.


Functions

int csTypeOfInputDef (const char *str)
 Returns the event type described by a free-format string.


Detailed Description

Crystal Space input library.

Definition in file inpnames.h.


Define Documentation

#define CSAXIS_X   -1
 

Use in `int button' for csevXXXMove events with the backward compatible funcs.

Definition at line 75 of file inpnames.h.

#define CSAXIS_Y   -2
 

Use in `int button' for csevXXXMove events with the backward compatible funcs.

Definition at line 80 of file inpnames.h.


Function Documentation

csString csGetKeyDesc utf32_char    code,
const csKeyModifiers   modifiers,
bool    distinguishModifiers = true
 

Convert a keycode and an optional set of modifiers into a free-form key string.

Parameters:
code  The key code. Is treated as a raw code, however raw vs cooked doesn't matter here, only when evaluating the data returned by e.g. csParseKeyString().
modifiers  The modifiers to include in the string. Can be 0.
distinguishModifiers  Whether to out put distinguished modifiers. (e.g. "LAlt" vs just "Alt".)
Returns:
The key string.

bool csParseJoystickDef const char *    str,
int *    x,
int *    y,
int *    button,
csKeyModifiers   modifiers
 

Convert a free-format string into a set of values that can be compared against the data of a joystick event.

Parameters:
str  Strings are in the form "joystickX", "joystick2" etc.
x  pointer to where the X value is written this will be 1 for mouseX events, 0 otherwise
y  pointer to where the Y value is written this will be 1 for mouseY events, 0 otherwise
button  pointer to where the button number is written to. for example, the string "joystick1" results in *button = 1; this will be -1 if not a joystick button event.
Returns:
Whether the string could be successfully parsed.
Remarks:
For any piece of information in which you are not interested, pass 0 for the address.

bool csParseMouseDef const char *    str,
int *    x,
int *    y,
int *    button,
csKeyModifiers   modifiers
 

Convert a free-format string into a set of values that can be compared against the data of a mouse event.

Parameters:
str  Strings are in the form "mouseX", "mouse2" etc.
x  pointer to where the X value is written; this will be 1 for mouseX events, 0 otherwise.
y  pointer to where the Y value is written; this will be 1 for mouseY events, 0 otherwise.
button  pointer to where the button number is written to. for example, the string "mouse1" results in *button = 1; this will be -1 if not a mouse button event.
modifiers  pointer to where the modifiers are written to.
Returns:
Whether the string could be successfully parsed.
Remarks:
For any piece of information in which you are not interested, pass 0 for the address.

int csTypeOfInputDef const char *    str
 

Returns the event type described by a free-format string.

Parameters:
str  Strings are in the form "Ctrl+a", "mouse1", "joystickX" etc.
Returns:
CSEVTYPE_Keyboard, CSEVTYPE_Mouse, CSEVTYPE_Joystick or 0 if the string could not be successfully parsed.


Generated for Crystal Space by doxygen 1.2.18