mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 10:06:03 +00:00
LibGUI: Add a helper for VerticalDirection
The function converts Key_[Up, Down] to the corresponding VerticalDirection.
This commit is contained in:
parent
0bcfbdb072
commit
4d93fb4789
Notes:
sideshowbarker
2024-07-17 08:55:08 +09:00
Author: https://github.com/LucasChollet
Commit: 4d93fb4789
Pull-request: https://github.com/SerenityOS/serenity/pull/14058
Reviewed-by: https://github.com/MacDue
Reviewed-by: https://github.com/petelliott
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue