Add IInputSystem and IInputInternal interfaces.
Signed-off-by: aixxe <me@aixxe.net>
This commit is contained in:
21
include/cstrike/Interfaces/IInputInternal.h
Normal file
21
include/cstrike/Interfaces/IInputInternal.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
typedef ButtonCode_t KeyCode;
|
||||
typedef ButtonCode_t MouseCode;
|
||||
|
||||
enum MouseCodeState_t {
|
||||
BUTTON_RELEASED = 0,
|
||||
BUTTON_PRESSED,
|
||||
BUTTON_DOUBLECLICKED
|
||||
};
|
||||
|
||||
class IInputInternal {
|
||||
public:
|
||||
void SetKeyCodeState(KeyCode code, bool pressed) {
|
||||
GetVirtualFunction<void(*)(IInputInternal*, KeyCode, bool)>(this, 83)(this, code, pressed);
|
||||
}
|
||||
|
||||
void SetMouseCodeState(MouseCode code, MouseCodeState_t state) {
|
||||
GetVirtualFunction<void(*)(IInputInternal*, MouseCode, MouseCodeState_t)>(this, 84)(this, code, state);
|
||||
}
|
||||
};
|
||||
10
include/cstrike/Interfaces/IInputSystem.h
Normal file
10
include/cstrike/Interfaces/IInputSystem.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
enum ButtonCode_t;
|
||||
|
||||
class IInputSystem {
|
||||
public:
|
||||
bool IsButtonDown(ButtonCode_t button) {
|
||||
return GetVirtualFunction<bool(*)(void*, ButtonCode_t)>(this, 11)(this, button);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user