Annwvyn::AnnTextInputer Class Reference

This class permit to get text input from the keyboard. More...

#include <AnnTextInputer.hpp>

Inheritance diagram for Annwvyn::AnnTextInputer:
Collaboration diagram for Annwvyn::AnnTextInputer:

Public Member Functions

 AnnTextInputer ()
 Object for text input. More...
 
bool keyPressed (const OIS::KeyEvent &arg) override
 Callback key press method. More...
 
bool keyReleased (const OIS::KeyEvent &arg) override
 Callback key released method. More...
 
std::string getInput () const
 Return the "input" string object. More...
 
void setInput (const std::string &content)
 Permit you to change the content of the input method. More...
 
void clearInput ()
 Clear the input string : remove all characters hanging there. More...
 
void startListening ()
 Clear input THEN record typed text. More...
 
void stopListening ()
 Stop recording typed text. More...
 
void setCursorOffset (int newPos)
 Set the cursor offset by hand. More...
 
int getCursorOffset () const
 Get the current position of the internal cursor. More...
 

Private Attributes

std::string input
 String that holds typed text. Characters are push/popped at the back of this string. More...
 
bool listen
 If set false, this class does nothing. More...
 
bool asciiOnly
 true if this text should be ascii only More...
 
int cursorOffset
 Offset from the end of the string where the operations has to be done. More...
 

Detailed Description

This class permit to get text input from the keyboard.

Definition at line 9 of file AnnTextInputer.hpp.

Constructor & Destructor Documentation

◆ AnnTextInputer()

AnnTextInputer::AnnTextInputer ( )

Object for text input.

Definition at line 10 of file AnnTextInputer.cpp.

Member Function Documentation

◆ clearInput()

void AnnTextInputer::clearInput ( )

Clear the input string : remove all characters hanging there.

Definition at line 59 of file AnnTextInputer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCursorOffset()

int AnnTextInputer::getCursorOffset ( ) const

Get the current position of the internal cursor.

Definition at line 88 of file AnnTextInputer.cpp.

◆ getInput()

std::string AnnTextInputer::getInput ( ) const

Return the "input" string object.

Definition at line 54 of file AnnTextInputer.cpp.

◆ keyPressed()

bool AnnTextInputer::keyPressed ( const OIS::KeyEvent &  arg)
override

Callback key press method.

Definition at line 17 of file AnnTextInputer.cpp.

Here is the call graph for this function:

◆ keyReleased()

bool AnnTextInputer::keyReleased ( const OIS::KeyEvent &  arg)
override

Callback key released method.

Definition at line 49 of file AnnTextInputer.cpp.

◆ setCursorOffset()

void AnnTextInputer::setCursorOffset ( int  newPos)

Set the cursor offset by hand.

Definition at line 82 of file AnnTextInputer.cpp.

◆ setInput()

void AnnTextInputer::setInput ( const std::string content)

Permit you to change the content of the input method.

Definition at line 76 of file AnnTextInputer.cpp.

◆ startListening()

void AnnTextInputer::startListening ( )

Clear input THEN record typed text.

Definition at line 65 of file AnnTextInputer.cpp.

Here is the call graph for this function:

◆ stopListening()

void AnnTextInputer::stopListening ( )

Stop recording typed text.

Definition at line 71 of file AnnTextInputer.cpp.

Member Data Documentation

◆ asciiOnly

bool Annwvyn::AnnTextInputer::asciiOnly
private

true if this text should be ascii only

Definition at line 39 of file AnnTextInputer.hpp.

◆ cursorOffset

int Annwvyn::AnnTextInputer::cursorOffset
private

Offset from the end of the string where the operations has to be done.

Definition at line 41 of file AnnTextInputer.hpp.

◆ input

std::string Annwvyn::AnnTextInputer::input
private

String that holds typed text. Characters are push/popped at the back of this string.

Definition at line 35 of file AnnTextInputer.hpp.

◆ listen

bool Annwvyn::AnnTextInputer::listen
private

If set false, this class does nothing.

Definition at line 37 of file AnnTextInputer.hpp.


The documentation for this class was generated from the following files: