Add scancode and virtual key and fix some sdl stuff on Windows

This commit is contained in:
Lynix
2019-05-19 16:34:29 +02:00
parent 848f05a420
commit ab5188c57d
33 changed files with 920 additions and 382 deletions

View File

@@ -18,7 +18,7 @@ void FocusState::Enter(Ndk::StateMachine& fsm)
Nz::EventHandler& eventHandler = m_context.window.GetEventHandler();
m_keyPressedSlot.Connect(eventHandler.OnKeyPressed, [&] (const Nz::EventHandler*, const Nz::WindowEvent::KeyEvent& key)
{
if (key.code == Nz::Keyboard::Key::M && key.shift)
if (key.virtualKey == Nz::Keyboard::VKey::M && key.shift)
{
fsm.ChangeState(StateFactory::Get(EventStatus::Menu));
}
@@ -38,4 +38,4 @@ void FocusState::Enter(Ndk::StateMachine& fsm)
void FocusState::DrawMenu()
{
m_text.SetContent("Click outside the windows, this text should change !\nM for Menu");
}
}