IOS/USB_KBD: Make IsKeyPressed() a non-virtual const member function
No other class inherits the USB_KBD class, and this function doesn't actually modify instance state, so it can be made a const member function.
This commit is contained in:
parent
bcdc5b5f7e
commit
d89ea8bf41
|
@ -219,13 +219,10 @@ IPCCommandResult USB_KBD::IOCtl(const IOCtlRequest& request)
|
|||
return GetDefaultReply(IPC_SUCCESS);
|
||||
}
|
||||
|
||||
bool USB_KBD::IsKeyPressed(int _Key)
|
||||
bool USB_KBD::IsKeyPressed(int key) const
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (GetAsyncKeyState(_Key) & 0x8000)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return (GetAsyncKeyState(key) & 0x8000) != 0;
|
||||
#else
|
||||
// TODO: do it for non-Windows platforms
|
||||
return false;
|
||||
|
|
|
@ -54,7 +54,7 @@ private:
|
|||
std::array<bool, 256> m_OldKeyBuffer{};
|
||||
u8 m_OldModifiers = 0;
|
||||
|
||||
virtual bool IsKeyPressed(int _Key);
|
||||
bool IsKeyPressed(int key) const;
|
||||
|
||||
// This stuff should probably die
|
||||
enum
|
||||
|
|
Loading…
Reference in New Issue