mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-06 11:07:01 +02:00
Initial commit
This commit is contained in:
45
arm9/source/gui/input/InputKey.h
Normal file
45
arm9/source/gui/input/InputKey.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
enum class InputKey : u16
|
||||
{
|
||||
None = 0,
|
||||
A = 1 << 0,
|
||||
B = 1 << 1,
|
||||
Select = 1 << 2,
|
||||
Start = 1 << 3,
|
||||
DpadRight = 1 << 4,
|
||||
DpadLeft = 1 << 5,
|
||||
DpadUp = 1 << 6,
|
||||
DpadDown = 1 << 7,
|
||||
R = 1 << 8,
|
||||
L = 1 << 9,
|
||||
X = 1 << 10,
|
||||
Y = 1 << 11,
|
||||
Debug = 1 << 13
|
||||
};
|
||||
|
||||
inline InputKey operator&(InputKey lhs, InputKey rhs)
|
||||
{
|
||||
return static_cast<InputKey>(static_cast<u16>(lhs) & static_cast<u16>(rhs));
|
||||
}
|
||||
|
||||
inline InputKey operator|(InputKey lhs, InputKey rhs)
|
||||
{
|
||||
return static_cast<InputKey>(static_cast<u16>(lhs) | static_cast<u16>(rhs));
|
||||
}
|
||||
|
||||
inline InputKey operator~(InputKey lhs)
|
||||
{
|
||||
return static_cast<InputKey>(~static_cast<u16>(lhs));
|
||||
}
|
||||
|
||||
inline InputKey operator^(InputKey lhs, InputKey rhs)
|
||||
{
|
||||
return static_cast<InputKey>(static_cast<u16>(lhs) ^ static_cast<u16>(rhs));
|
||||
}
|
||||
|
||||
inline InputKey operator|=(InputKey& lhs, InputKey rhs)
|
||||
{
|
||||
lhs = lhs | rhs; // don't use |= to prevent recursion
|
||||
return lhs;
|
||||
}
|
||||
Reference in New Issue
Block a user