summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGUI/Widget.h9
1 files changed, 9 insertions, 0 deletions
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