diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index 82bfcc0c63..830007fa8e 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -52,6 +52,15 @@ enum class VerticalDirection { Down }; +constexpr VerticalDirection key_code_to_vertical_direction(KeyCode const& key) +{ + if (key == Key_Up) + return VerticalDirection::Up; + if (key == Key_Down) + return VerticalDirection::Down; + VERIFY_NOT_REACHED(); +} + enum class AllowCallback { No, Yes