Add scancode and virtual key and fix some sdl stuff on Windows
This commit is contained in:
@@ -19,9 +19,9 @@ void MenuState::Enter(Ndk::StateMachine& fsm)
|
||||
Nz::EventHandler& eventHandler = m_context.window.GetEventHandler();
|
||||
m_keyPressedSlot.Connect(eventHandler.OnKeyPressed, [this] (const Nz::EventHandler*, const Nz::WindowEvent::KeyEvent& key)
|
||||
{
|
||||
if (key.code >= Nz::Keyboard::Key::A && key.code < (Nz::Keyboard::Key::A + static_cast<int>(EventStatus::Max) - 1))
|
||||
if (key.virtualKey >= Nz::Keyboard::VKey::A && key.virtualKey < static_cast<Nz::Keyboard::VKey>(static_cast<int>(Nz::Keyboard::VKey::A) + static_cast<int>(EventStatus::Max) - 1))
|
||||
{
|
||||
m_selectedNextState = key.code - static_cast<int>(Nz::Keyboard::Key::A);
|
||||
m_selectedNextState = static_cast<int>(key.virtualKey) - static_cast<int>(Nz::Keyboard::VKey::A);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -44,4 +44,4 @@ bool MenuState::Update(Ndk::StateMachine& fsm, float /*elapsedTime*/)
|
||||
void MenuState::DrawMenu()
|
||||
{
|
||||
m_text.SetContent("a. Event\nb. Focus\nc. Key\nd. Mouse click\ne. Mouse enter\nf. Mouse move\ng. Text enter\nh. Window modification");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user