Yukino::Input Class Reference

Class that manages the input system. More...

#include <Input.h>

List of all members.

Public Member Functions

UINT Init (void)
 Function to initialize the object Input.
void Release (void)
 Function to finalize the object Input.
void Update (void)
 Function to update the state of the input.
bool GetKey (int key) const
 Function to ask if a key is pressed.
bool KbHit (void) const
 Function to ask if the keyboard is pressed.
bool EnableKeyRepeat (int delay, int interval)
 Function to activate the repetition of pulsations.
bool DisableKeyRepeat (void)
 Function to deactivate the repetition of pulsations.
int GetMouseX (void) const
 Function to obtain the coordinate X of the mouse.
int GetMouseY (void) const
 Function to obtain the coordinate Y of the mouse.
int GetMouseRelX (void) const
 Function to obtain the relative coordinate X of the mouse.
int GetMouseRelY (void) const
 Function to obtain the relative coordinate Y of the mouse.
bool MouseButton (int button) const
 Function to ask if a button of the mouse is pressed.
bool LeftButton (void) const
 Function to ask if the left button of the mouse is pressed.
bool MiddleButton (void) const
 Function to ask if the middle button of the mouse is pressed.
bool RightButton (void) const
 Function to ask if the right button of the mouse is pressed.
bool WheelUp (void) const
 Function to ask if the WheelUp of the mouse is pressed.
bool WheelDown (void) const
 Function to ask if the WheelDown of the mouse is pressed.
bool MouseInRect (Rect *rect)
 Function to ask if the mouse is inside a region.

Static Public Member Functions

static InputGetInstance (void)
 Function to obtain the instance of Input.


Detailed Description

Class that manages the input system.

The Input class manages the subjects related to the entrance system. These basically are, to handle and to control the keyboard and the mouse.


Member Function Documentation

bool Yukino::Input::DisableKeyRepeat ( void   )  [inline]

Function to deactivate the repetition of pulsations.

This function serves to deactivate the repetition of pulsations.

See also:
EnableKeyRepeat().
Returns:
If everything goes well returns true, on errors returns false.

bool Yukino::Input::EnableKeyRepeat ( int  delay,
int  interval 
) [inline]

Function to activate the repetition of pulsations.

This function serves to activate the repetition of pulsations.

Parameters:
delay Time in ms of delay to begin the repetitions.
interval Time in ms between repetition and repetition.
See also:
DisableKeyRepeat().
Returns:
If everything goes well returns true, on errors returns false.

Input * Yukino::Input::GetInstance ( void   )  [static]

Function to obtain the instance of Input.

This function creates an instance of Input, in case of not being created, and gives back a pointer of this if memory is successful requesting.

Returns:
It gives back to a pointer to the object Input if everything has gone well, if there is no memory for the object, gives back NULL.

bool Yukino::Input::GetKey ( int  key  )  const [inline]

Function to ask if a key is pressed.

This function serves to ask if a key is pressed.

Parameters:
key The key to ask.
See also:
KbHit().
Returns:
If it gives back true, the key is pressed.

int Yukino::Input::GetMouseRelX ( void   )  const [inline]

Function to obtain the relative coordinate X of the mouse.

This function serves to obtain the relative coordinate X of the mouse.

See also:
GetMouseX(), GetMouseY(), GetMouseRelY().
Returns:
The relative coordinate X of the mouse.

int Yukino::Input::GetMouseRelY ( void   )  const [inline]

Function to obtain the relative coordinate Y of the mouse.

This function serves to obtain the relative coordinate Y of the mouse.

See also:
GetMouseX(), GetMouseY(), GetMouseRelX().
Returns:
The relative coordinate Y of the mouse.

int Yukino::Input::GetMouseX ( void   )  const [inline]

Function to obtain the coordinate X of the mouse.

This function serves to obtain the coordinate X of the mouse.

See also:
GetMouseY(), GetMouseRelX(), GetMouseRelY().
Returns:
The coordinate X of the mouse.

int Yukino::Input::GetMouseY ( void   )  const [inline]

Function to obtain the coordinate Y of the mouse.

This function serves to obtain the coordinate Y of the mouse.

See also:
GetMouseX(), GetMouseRelX(), GetMouseRelY().
Returns:
The coordinate Y of the mouse.

UINT Yukino::Input::Init ( void   ) 

Function to initialize the object Input.

This function serves to initialize the object Input.

See also:
Release().
Returns:
If everything goes well returns 0, on errors returns: INPUT_ERROR_GETKEYSTATE.

bool Yukino::Input::KbHit ( void   )  const

Function to ask if the keyboard is pressed.

This function serves to ask if the keyboard is pressed.

See also:
GetKey().
Returns:
If it gives back true, the keyboard is pressed.

bool Yukino::Input::LeftButton ( void   )  const [inline]

Function to ask if the left button of the mouse is pressed.

This function serves to ask if the left button of the mouse is pressed.

See also:
MouseButton(), MiddleButton(), RightButton(), WheelUp(), WheelDown().
Returns:
If it gives back true, the button is pressed.

bool Yukino::Input::MiddleButton ( void   )  const [inline]

Function to ask if the middle button of the mouse is pressed.

This function serves to ask if the middle button of the mouse is pressed.

See also:
MouseButton(), LeftButton(), RightButton(), WheelUp(), WheelDown().
Returns:
If it gives back true, the button is pressed.

bool Yukino::Input::MouseButton ( int  button  )  const [inline]

Function to ask if a button of the mouse is pressed.

This function serves to ask if a button of the mouse is pressed.

Parameters:
button The button to ask.
See also:
LeftButton(), MiddleButton(), RightButton(), WheelUp(), WheelDown().
Returns:
If it gives back true, the button is pressed.

bool Yukino::Input::MouseInRect ( Rect rect  )  [inline]

Function to ask if the mouse is inside a region.

This function serves to ask if the mouse is inside a region.

Parameters:
rect The region to ask.
Returns:
If it gives back true, the mouse is inside that region.

void Yukino::Input::Release ( void   ) 

Function to finalize the object Input.

This function serves to finalize the object Input.

See also:
Init().

bool Yukino::Input::RightButton ( void   )  const [inline]

Function to ask if the right button of the mouse is pressed.

This function serves to ask if the right button of the mouse is pressed.

See also:
MouseButton(), LeftButton(), MiddleButton(), WheelUp(), WheelDown().
Returns:
If it gives back true, the button is pressed.

void Yukino::Input::Update ( void   ) 

Function to update the state of the input.

This function serves to update the state of the input.

bool Yukino::Input::WheelDown ( void   )  const [inline]

Function to ask if the WheelDown of the mouse is pressed.

This function serves to ask if the WheelDown of the mouse is pressed.

See also:
MouseButton(), LeftButton(), MiddleButton(), RightButton(), WheelUp().
Returns:
If it gives back true, the button is pressed.

bool Yukino::Input::WheelUp ( void   )  const [inline]

Function to ask if the WheelUp of the mouse is pressed.

This function serves to ask if the WheelUp of the mouse is pressed.

See also:
MouseButton(), LeftButton(), MiddleButton(), RightButton(), WheelDown().
Returns:
If it gives back true, the button is pressed.


The documentation for this class was generated from the following files:
Generated on Sun Jun 25 03:43:36 2006 for Yukino by  doxygen 1.4.7