mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +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
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