ClanSoft logo
ClanSoft logo
Entire Class Index Main Class Index Cross Index Global Index

Class CL_InputBuffer

Input buffer interface.
Contained in: global
Derived from: none
Derived by: none
Group: Display (Input)

#include <ClanLib/display.h>


public function member index:

Construction:

CL_InputBuffer();
CL_InputBuffer(CL_InputDevice* device);
CL_InputBuffer(CL_Signal_v4<CL_Component* , CL_InputDevice* , CL_Key, bool& >& sig_key_down, CL_Signal_v3<CL_Component* , CL_InputDevice* , CL_Key>& sig_key_up);
virtual ~CL_InputBuffer();

Operations:

CL_Key peek_key() const;
CL_Key get_key();
int keys_left();
void clear();
 

private function member index:

Implementation:

void on_button_press(CL_InputDevice* device, const CL_Key& key);
void on_button_release(CL_InputDevice* device, const CL_Key& key);
void on_key_down(CL_Component* , CL_InputDevice* device, CL_Key key, bool& retval);
void on_key_up(CL_Component* , CL_InputDevice* device, CL_Key key);
 

Description:

Use this class to read buffered keys from the keyboard (or any other device).


Function Member Descriptions:

CL_InputBuffer::CL_InputBuffer - Constructs an input buffer that attaches itself to the first keyboard.
CL_InputBuffer();


CL_InputBuffer::CL_InputBuffer - Constructs an input buffer that attaches itself to the specified device.
CL_InputBuffer(CL_InputDevice* device);


CL_InputBuffer::CL_InputBuffer - Constructs an input buffer that attaches itself to the specified signals.
Use it to buffer input from a GUI component.
CL_InputBuffer(CL_Signal_v4<CL_Component* , CL_InputDevice* , CL_Key, bool& >& sig_key_down, CL_Signal_v3<CL_Component* , CL_InputDevice* , CL_Key>& sig_key_up);


CL_InputBuffer::clear - Clears the buffer. After this, the buffer will not contain any keys.
void clear();


CL_InputBuffer::get_key - Pops the next key in the buffer and returns it.
CL_Key get_key();


CL_InputBuffer::keys_left - Returns number of keys still available in the buffer.
int keys_left();
Returns - Number of key values lefts in buffer.



CL_InputBuffer::peek_key - Returns the next key in the buffer, but unlike get_key() it does not
pop it from the input buffer.
CL_Key peek_key() const;


CL_InputBuffer::~CL_InputBuffer - Input Buffer Destructor
virtual ~CL_InputBuffer();



Variable Member Descriptions: