Commit c02cf281 authored by TheOnlyJoey's avatar TheOnlyJoey
Browse files

Introduced getAsKeyCode (Currently just for linux) to be able to map string to keycode

parent a3f509e2
...@@ -281,6 +281,18 @@ namespace OIS ...@@ -281,6 +281,18 @@ namespace OIS
Alt = 0x0000100 Alt = 0x0000100
}; };
/**
@remarks
Translates string to KeyCode representation.
For example, "Enter" will be KC_ENTER - Locale
specific of course.
@param str
string to convert
@returns
The matching KeyCode
*/
virtual OIS::KeyCode getAsKeyCode(std::string str) = 0;
/** /**
@remarks @remarks
Check modifier status Check modifier status
......
...@@ -42,6 +42,9 @@ namespace OIS ...@@ -42,6 +42,9 @@ namespace OIS
/** @copydoc Keyboard::getAsString */ /** @copydoc Keyboard::getAsString */
virtual const std::string& getAsString( KeyCode kc ); virtual const std::string& getAsString( KeyCode kc );
/** @copydoc Keyboard::getAsKeyCode */
virtual OIS::KeyCode getAsKeyCode( std::string str );
/** @copydoc Keyboard::copyKeyStates */ /** @copydoc Keyboard::copyKeyStates */
virtual void copyKeyStates( char keys[256] ) const; virtual void copyKeyStates( char keys[256] ) const;
......
...@@ -54,6 +54,7 @@ namespace OIS ...@@ -54,6 +54,7 @@ namespace OIS
// Returns a description of the given key // Returns a description of the given key
virtual std::string& getAsString( KeyCode key ); virtual std::string& getAsString( KeyCode key );
virtual KeyCode getAsKeyCode( std::string str ) {/*TODO: Implement OS version*/;}
virtual Interface* queryInterface( Interface::IType type ) { return 0; } virtual Interface* queryInterface( Interface::IType type ) { return 0; }
......
...@@ -50,6 +50,9 @@ namespace OIS ...@@ -50,6 +50,9 @@ namespace OIS
/** @copydoc Keyboard::getAsString */ /** @copydoc Keyboard::getAsString */
virtual const std::string& getAsString(KeyCode kc); virtual const std::string& getAsString(KeyCode kc);
/** @copydoc Keyboard::getAsKeyCode */
virtual KeyCode getAsKeyCode( std::string str ) {/*TODO: Implement OS version*/;}
/** @copydoc Keyboard::copyKeyStates */ /** @copydoc Keyboard::copyKeyStates */
virtual void copyKeyStates(char keys[256]) const; virtual void copyKeyStates(char keys[256]) const;
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment