BufferedKeyboardInput Class Reference

Class that buffers text input from a keyboard. More...

#include <Input/BufferedKeyboardInput.h>

Inherited by KeyFilteredBufferedKeyboardInput.

List of all members.

Public Member Functions

 BufferedKeyboardInput ()
 Constructor.
void Update (const IKeyboard &kb)
 Updates the buffer with new input from the keyboard.
void BufferKeyInput (const KeyData &data)
 Buffers a single input.
void ClearInput ()
 Clears the buffered text input.
void SetInput (const char *str)
 Sets the buffered text input sting.
void SetInput (const std::string &str)
 Sets the buffered text input sting.
const std::string & GetInput () const
 Gets the buffered text input string.
uint GetInputLength () const
 Returns the length of the input text.
int GetCursorPos () const
 Gets the buffered text input cursor position.
void MoveCursorToEnd ()
 Moves the cursor to the end if the buffered input.
void SetCursorPos (uint p)
 Sets the buffered text input cursor position.

Protected Member Functions

virtual bool FilterKeyInput (const KeyData &data)
 Determines if the input should be ignored.
virtual bool ShouldInsertUnicodeChar (uint unicode) const
 Determines if the given unicode char should be inserted into the input.
virtual void HandleKeyInput (const KeyData &data)
 Inserts a single key input into the test input.
void ClampCursorPos ()
 Clamps the cursor into a valid range.

Detailed Description

Class that buffers text input from a keyboard.


Member Function Documentation

void BufferedKeyboardInput::BufferKeyInput ( const KeyData data  ) 

Buffers a single input.

Parameters:
[in] data the key input.
bool BufferedKeyboardInput::FilterKeyInput ( const KeyData data  )  [protected, virtual]

Determines if the input should be ignored.

Parameters:
[in] data the input to filter.
Returns:
true if the input should be ignored, false otherwise.

Reimplemented in KeyFilteredBufferedKeyboardInput.

int BufferedKeyboardInput::GetCursorPos (  )  const [inline]

Gets the buffered text input cursor position.

Returns:
the buffered text input cursor position.
const std::string & BufferedKeyboardInput::GetInput (  )  const

Gets the buffered text input string.

Returns:
the text input string.
void BufferedKeyboardInput::HandleKeyInput ( const KeyData data  )  [protected, virtual]

Inserts a single key input into the test input.

Parameters:
[in] data the input to insert into the bufferd text input.
void BufferedKeyboardInput::SetCursorPos ( uint  p  ) 

Sets the buffered text input cursor position.

Parameters:
[in] p the buffered text input cursor position.
void BufferedKeyboardInput::SetInput ( const std::string &  str  ) 

Sets the buffered text input sting.

Parameters:
[in] str the string to set the text input to.
void BufferedKeyboardInput::SetInput ( const char *  str  ) 

Sets the buffered text input sting.

Parameters:
[in] str the string to set the text input to.
void BufferedKeyboardInput::Update ( const IKeyboard kb  ) 

Updates the buffer with new input from the keyboard.

Parameters:
[in] kb the keyboard to get input data from.

The documentation for this class was generated from the following files:
Generated on Mon Apr 5 19:08:05 2010 for BrickOut |ReDuX| by  doxygen 1.6.3