54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#ifndef _CTEXTINPUT_HPP_
|
|
#define _CTEXTINPUT_HPP_
|
|
|
|
/*** SDL Header Files ***/
|
|
#include <SDL.h>
|
|
|
|
/*** Custom Header Files ***/
|
|
#include "cKeyboard.hpp"
|
|
|
|
/*** DLL Header File ***/
|
|
#include "dllExport.h"
|
|
|
|
/*** Custom Header Files ***/
|
|
#include "../UtilityEngine/cString.hpp"
|
|
|
|
using UtilityEngine::cString;
|
|
|
|
namespace InputEngine {
|
|
/* Singleton */
|
|
class EXPORT_FROM_MYDLL cTextInput : public cKeyboard
|
|
{
|
|
public:
|
|
cTextInput();
|
|
cTextInput( const cTextInput& copy );
|
|
virtual ~cTextInput();
|
|
|
|
/// Functions
|
|
/* */
|
|
virtual void KeyboardCheck( const SDL_Event& event );
|
|
/* Clears out the Text */
|
|
void ClearText();
|
|
|
|
/// Sets
|
|
void setText( const cString& text );
|
|
|
|
/// Gets
|
|
const cString& getText() const;
|
|
|
|
private:
|
|
const char UnicodeValue( const SDL_Event& event );
|
|
|
|
private:
|
|
/// Variables
|
|
cString m_text;/// = ""
|
|
bool m_caps;/// = false
|
|
bool m_shift;/// = false
|
|
|
|
/// magic numbers courtesy of SDL docs
|
|
const unsigned long int INTERNATIONAL_MASK;/// = 0xFF80
|
|
const unsigned long int UNICODE_MASK;/// = 0x7F
|
|
};/// END CLASS DEFINITION cTextInput
|
|
}/// END NAMESPACE DEFINITION InputEngine
|
|
#endif/// END IFNDEF _CTEXTINPUT_HPP_
|