Commit 364bf0ce authored by chili's avatar chili
Browse files

test kbd evt optional

parent cf87f10a
...@@ -21,6 +21,23 @@ int App::Go() ...@@ -21,6 +21,23 @@ int App::Go()
void App::DoFrame() void App::DoFrame()
{ {
static std::string title;
while( const auto e = wnd.kbd.ReadKey() )
{
if( e->IsPress() && e->GetCode() == VK_BACK )
{
title.clear();
wnd.SetTitle( title );
}
}
while( const auto c = wnd.kbd.ReadChar() )
{
if( *c != 0x8 ) // don't print backspace
{
title += *c;
wnd.SetTitle( title );
}
}
const float c = sin( timer.Peek() ) / 2.0f + 0.5f; const float c = sin( timer.Peek() ) / 2.0f + 0.5f;
wnd.Gfx().ClearBuffer( c,c,1.0f ); wnd.Gfx().ClearBuffer( c,c,1.0f );
wnd.Gfx().DrawTestTriangle(); wnd.Gfx().DrawTestTriangle();
......
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