aboutsummaryrefslogtreecommitdiff
path: root/drafts/input_util.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-12-04 17:20:43 +0800
committercrupest <crupest@outlook.com>2021-12-04 17:20:43 +0800
commit2317061516b0bd0002467acbead3120cbe49a6c5 (patch)
treefb43dcc5067631d96ede6718c3fe0030678211f7 /drafts/input_util.cpp
parentff6cb3b468a0d4caf87c2291818d24e0a6d12b39 (diff)
downloadcru-2317061516b0bd0002467acbead3120cbe49a6c5.tar.gz
cru-2317061516b0bd0002467acbead3120cbe49a6c5.tar.bz2
cru-2317061516b0bd0002467acbead3120cbe49a6c5.zip
...
Diffstat (limited to 'drafts/input_util.cpp')
-rw-r--r--drafts/input_util.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/drafts/input_util.cpp b/drafts/input_util.cpp
deleted file mode 100644
index 193cba4a..00000000
--- a/drafts/input_util.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "input_util.hpp"
-
-#include <Windows.h>
-
-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 IsAnyMouseButtonDown() {
- return IsKeyDown(VK_LBUTTON) || IsKeyDown(VK_RBUTTON) ||
- IsKeyDown(VK_MBUTTON);
-}
-} // namespace cru::ui