Fixed Button dll input/output.
This commit is contained in:
@@ -10,7 +10,7 @@ namespace ehs
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
Array<InputHandler*> handlers;
|
Array<InputHandler*> handlers;
|
||||||
bool initalized;
|
bool initialized;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~Input();
|
~Input();
|
||||||
@@ -31,13 +31,13 @@ namespace ehs
|
|||||||
|
|
||||||
void Poll();
|
void Poll();
|
||||||
|
|
||||||
bool HasHandler(const UInt_64 hashId) const;
|
bool HasHandler(UInt_64 hashId) const;
|
||||||
|
|
||||||
bool HasHandler(const Str_8& id) const;
|
bool HasHandler(const Str_8& id) const;
|
||||||
|
|
||||||
bool AddHandler(InputHandler* handler);
|
bool AddHandler(InputHandler* handler);
|
||||||
|
|
||||||
const InputHandler* GetHandler(const UInt_64 hashId) const;
|
const InputHandler* GetHandler(UInt_64 hashId) const;
|
||||||
|
|
||||||
const InputHandler* GetHandler(const Str_8& id) const;
|
const InputHandler* GetHandler(const Str_8& id) const;
|
||||||
|
|
||||||
|
@@ -31,9 +31,9 @@ namespace ehs
|
|||||||
|
|
||||||
InputHandler& operator=(const InputHandler& ih);
|
InputHandler& operator=(const InputHandler& ih);
|
||||||
|
|
||||||
bool operator==(const UInt_64 otherHashId) const;
|
bool operator==(UInt_64 otherHashId) const;
|
||||||
|
|
||||||
bool operator!=(const UInt_64 otherHashId) const;
|
bool operator!=(UInt_64 otherHashId) const;
|
||||||
|
|
||||||
virtual bool Initialize();
|
virtual bool Initialize();
|
||||||
|
|
||||||
@@ -47,13 +47,13 @@ namespace ehs
|
|||||||
|
|
||||||
void ResetAllStates();
|
void ResetAllStates();
|
||||||
|
|
||||||
bool HasDevice(const UInt_64 id) const;
|
bool HasDevice(UInt_64 id) const;
|
||||||
|
|
||||||
bool AddDevice(HID* device);
|
bool AddDevice(HID* device);
|
||||||
|
|
||||||
HID* GetDevice(const UInt_64 id) const;
|
HID* GetDevice(UInt_64 id) const;
|
||||||
|
|
||||||
HID* GetDeviceByType(const UInt_8 type) const;
|
HID* GetDeviceByType(UInt_8 type) const;
|
||||||
|
|
||||||
virtual bool IsInitialized() const;
|
virtual bool IsInitialized() const;
|
||||||
};
|
};
|
||||||
|
@@ -9,18 +9,18 @@ namespace ehs
|
|||||||
}
|
}
|
||||||
|
|
||||||
Input::Input()
|
Input::Input()
|
||||||
: initalized(false)
|
: initialized(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Input::Input(Input&& input) noexcept
|
Input::Input(Input&& input) noexcept
|
||||||
: handlers((Array<InputHandler*>&&)input.handlers), initalized(input.initalized)
|
: handlers((Array<InputHandler*>&&)input.handlers), initialized(input.initialized)
|
||||||
{
|
{
|
||||||
input.initalized = false;
|
input.initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Input::Input(const Input& input)
|
Input::Input(const Input& input)
|
||||||
: initalized(false)
|
: initialized(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,9 +30,9 @@ namespace ehs
|
|||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
handlers = (Array<InputHandler*>&&)input.handlers;
|
handlers = (Array<InputHandler*>&&)input.handlers;
|
||||||
initalized = input.initalized;
|
initialized = input.initialized;
|
||||||
|
|
||||||
input.initalized = false;
|
input.initialized = false;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -46,14 +46,14 @@ namespace ehs
|
|||||||
delete handlers;
|
delete handlers;
|
||||||
|
|
||||||
handlers = Array<InputHandler*>();
|
handlers = Array<InputHandler*>();
|
||||||
initalized = false;
|
initialized = false;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Input::Initialize()
|
void Input::Initialize()
|
||||||
{
|
{
|
||||||
if (initalized)
|
if (initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UInt_64 i = 0;
|
UInt_64 i = 0;
|
||||||
@@ -72,12 +72,12 @@ namespace ehs
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
initalized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Input::Release()
|
void Input::Release()
|
||||||
{
|
{
|
||||||
if (!initalized)
|
if (!initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UInt_64 i = 0;
|
UInt_64 i = 0;
|
||||||
@@ -96,7 +96,7 @@ namespace ehs
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
initalized = false;
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Input::Poll()
|
void Input::Poll()
|
||||||
@@ -124,7 +124,7 @@ namespace ehs
|
|||||||
if (HasHandler(handler->GetHashId()))
|
if (HasHandler(handler->GetHashId()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (initalized)
|
if (initialized)
|
||||||
{
|
{
|
||||||
bool hInitialized = handler->Initialize();
|
bool hInitialized = handler->Initialize();
|
||||||
if (!hInitialized)
|
if (!hInitialized)
|
||||||
@@ -155,6 +155,6 @@ namespace ehs
|
|||||||
|
|
||||||
bool Input::IsInitialized() const
|
bool Input::IsInitialized() const
|
||||||
{
|
{
|
||||||
return initalized;
|
return initialized;
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user