Successfully sends and receives simple KeyStrokes over UDP

This commit is contained in:
Keith Winstein
2011-08-03 17:29:47 -04:00
parent 6ea66b7aab
commit ef3e4ce5fe
7 changed files with 299 additions and 39 deletions
+30
View File
@@ -0,0 +1,30 @@
#ifndef KEYSTROKE_HPP
#define KEYSTROKE_HPP
#include <string>
#include <assert.h>
class KeyStroke
{
public:
char letter;
string tostring( void )
{
return string( &letter, 1 );
};
KeyStroke( const string x )
: letter()
{
assert( x.size() == 1 );
letter = x[ 0 ];
}
KeyStroke()
: letter( 0 )
{}
};
#endif