mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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
Reference in a new issue