1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

LibGUI: Add GUI::KeyEvent::is_arrow_key()

This commit is contained in:
Andreas Kling 2021-10-23 14:31:48 +02:00
parent d91732f959
commit 0d8373287c

View file

@ -346,6 +346,19 @@ public:
String to_string() const; String to_string() const;
bool is_arrow_key() const
{
switch (m_key) {
case KeyCode::Key_Up:
case KeyCode::Key_Down:
case KeyCode::Key_Left:
case KeyCode::Key_Right:
return true;
default:
return false;
}
}
private: private:
friend class WindowServerConnection; friend class WindowServerConnection;
KeyCode m_key { KeyCode::Key_Invalid }; KeyCode m_key { KeyCode::Key_Invalid };