aboutsummaryrefslogtreecommitdiff
path: root/src/ui/input_util.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-21 21:42:28 +0800
committercrupest <crupest@outlook.com>2019-03-21 21:42:28 +0800
commitfdbb02b2cbdd4e4069005d0535a343229f7c4d32 (patch)
tree3cc25c18b3b019f09d6478b8b9f7b4ddbaed9eb6 /src/ui/input_util.cpp
parent616ebd78b543876388cb3d64f108abea041d4983 (diff)
downloadcru-fdbb02b2cbdd4e4069005d0535a343229f7c4d32.tar.gz
cru-fdbb02b2cbdd4e4069005d0535a343229f7c4d32.tar.bz2
cru-fdbb02b2cbdd4e4069005d0535a343229f7c4d32.zip
...
Diffstat (limited to 'src/ui/input_util.cpp')
-rw-r--r--src/ui/input_util.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/ui/input_util.cpp b/src/ui/input_util.cpp
index 6cf2d695..3fe34f10 100644
--- a/src/ui/input_util.cpp
+++ b/src/ui/input_util.cpp
@@ -2,22 +2,19 @@
#include "system_headers.hpp"
-namespace cru::ui
-{
- bool IsKeyDown(const int virtual_code)
- {
- const auto result = ::GetKeyState(virtual_code);
- return (static_cast<unsigned short>(result) & 0x8000) != 0;
- }
+namespace cru::ui {
+bool IsKeyDown(const int virtual_code) {
+ const auto result = ::GetKeyState(virtual_code);
+ return (static_cast<unsigned short>(result) & 0x8000) != 0;
+}
- bool IsKeyToggled(const int virtual_code)
- {
- const auto result = ::GetKeyState(virtual_code);
- return (static_cast<unsigned short>(result) & 1) != 0;
- }
+bool IsKeyToggled(const int virtual_code) {
+ const auto result = ::GetKeyState(virtual_code);
+ return (static_cast<unsigned short>(result) & 1) != 0;
+}
- bool IsAnyMouseButtonDown()
- {
- return IsKeyDown(VK_LBUTTON) || IsKeyDown(VK_RBUTTON) || IsKeyDown(VK_MBUTTON);
- }
+bool IsAnyMouseButtonDown() {
+ return IsKeyDown(VK_LBUTTON) || IsKeyDown(VK_RBUTTON) ||
+ IsKeyDown(VK_MBUTTON);
}
+} // namespace cru::ui