From ed0bbc22681681a16b7d45b05133c38a0b82006f Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Mon, 29 Mar 2021 18:01:20 -0400 Subject: formatting + file renames --- common/utility-rawinput.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'common/utility-rawinput.hpp') diff --git a/common/utility-rawinput.hpp b/common/utility-rawinput.hpp index c43084b..eaa23db 100644 --- a/common/utility-rawinput.hpp +++ b/common/utility-rawinput.hpp @@ -11,7 +11,9 @@ #include // needed for devpkey.h to parse properly #include -std::wstring dev_prop_wstr_from_interface(const WCHAR* interface_name, const DEVPROPKEY* key) { +inline +std::wstring dev_prop_wstr_from_interface(const WCHAR* interface_name, const DEVPROPKEY* key) +{ ULONG size = 0; DEVPROPTYPE type; CONFIGRET cm_res; @@ -37,14 +39,17 @@ std::wstring dev_prop_wstr_from_interface(const WCHAR* interface_name, const DEV return prop; } -std::wstring dev_id_from_interface(const WCHAR* interface_name) { +inline +std::wstring dev_id_from_interface(const WCHAR* interface_name) +{ auto id = dev_prop_wstr_from_interface(interface_name, &DEVPKEY_Device_InstanceId); id.resize(id.find_last_of('\\')); return id; } template -void rawinput_foreach_with_interface(Func fn, DWORD input_type = RIM_TYPEMOUSE) { +void rawinput_foreach_with_interface(Func fn, DWORD input_type = RIM_TYPEMOUSE) +{ const UINT RI_ERROR = -1; UINT num_devs = 0; @@ -75,7 +80,9 @@ void rawinput_foreach_with_interface(Func fn, DWORD input_type = RIM_TYPEMOUSE) // returns device handles corresponding to a "device id" // https://docs.microsoft.com/en-us/windows-hardware/drivers/install/device-ids -std::vector rawinput_handles_from_dev_id(const std::wstring& device_id, DWORD input_type = RIM_TYPEMOUSE) { +inline +std::vector rawinput_handles_from_dev_id(const std::wstring& device_id, DWORD input_type = RIM_TYPEMOUSE) +{ std::vector handles; rawinput_foreach_with_interface([&](const auto& dev, const WCHAR* name) { -- cgit v1.2.3