-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
enum EHARDWAREMOUSEEVENT
{
HARDWAREMOUSEEVENT_MOVE,
HARDWAREMOUSEEVENT_LBUTTONDOWN,
HARDWAREMOUSEEVENT_LBUTTONUP,
HARDWAREMOUSEEVENT_LBUTTONDOUBLECLICK,
HARDWAREMOUSEEVENT_RBUTTONDOWN,
HARDWAREMOUSEEVENT_RBUTTONUP,
HARDWAREMOUSEEVENT_RBUTTONDOUBLECLICK,
HARDWAREMOUSEEVENT_MBUTTONDOWN,
HARDWAREMOUSEEVENT_MBUTTONUP,
HARDWAREMOUSEEVENT_MBUTTONDOUBLECLICK,
HARDWAREMOUSEEVENT_WHEEL
};
Код:
enum EType
{
Button, //!< State == press/hold/release -- value = 0, 1.
Toggle, //!< Transition state with a press.
RawAxis, //!< State == change -- value = movement of axis.
Axis, //!< State == change -- value = -1.0 to 1.0.
Trigger, //!< State == change -- value = 0.0 to 1.0.
};
enum EInputState : DWORD
{
eIS_Unknown = 0,
eIS_Pressed = (1 << 0),
eIS_Released = (1 << 1),
eIS_Down = (1 << 2),
eIS_Changed = (1 << 3),
};
enum EInputDeviceType : DWORD
{
eIDT_Keyboard,
eIDT_Mouse,
eIDT_Joystick,
eIDT_EyeTracker,
eIDT_Gamepad,
eIDT_MotionController,
eIDT_Unknown = 0xff,
};
Код:
enum EKeyId
{
eKI_escape = 1,
eKI_1 = 2,
eKI_2 = 3,
eKI_3 = 4,
eKI_4 = 5,
eKI_5 = 6,
eKI_6 = 7,
eKI_7 = 8,
eKI_8 = 9,
eKI_9 = 10,
eKI_0 = 11,
eKI_minus = 12,
eKI_equals = 13,
eKI_backspace = 14,
eKI_tab = 15,
eKI_q = 16,
eKI_w = 17,
eKI_e = 18,
eKI_r = 19,
eKI_t = 20,
eKI_y = 21,
eKI_u = 22,
eKI_i = 23,
eKI_o = 24,
eKI_p = 25,
eKI_lbracket = 26,
eKI_rbracket = 27,
eKI_enter = 28,
eKI_lctrl = 29,
eKI_a = 30,
eKI_s = 31,
eKI_d = 32,
eKI_f = 33,
eKI_g = 34,
eKI_h = 35,
eKI_j = 36,
eKI_k = 37,
eKI_l = 38,
eKI_semicolon = 39,
eKI_apostrophe = 40,
eKI_tilde = 41,
eKI_lshift = 42,
eKI_backslash = 43,
eKI_z = 44,
eKI_x = 45,
eKI_c = 46,
eKI_v = 47,
eKI_b = 48,
eKI_n = 49,
eKI_m = 50,
eKI_comma = 51,
eKI_period = 52,
eKI_slash = 53,
eKI_rshift = 54,
eKI_np_multiply = 55,
eKI_lalt = 56,
eKI_space = 57,
eKI_capslock = 58,
eKI_f1 = 59,
eKI_f2 = 60,
eKI_f3 = 61,
eKI_f4 = 62,
eKI_f5 = 63,
eKI_f6 = 64,
eKI_f7 = 65,
eKI_f8 = 66,
eKI_f9 = 67,
eKI_f10 = 68,
eKI_numlock = 69,
eKI_scrolllock = 70,
eKI_np_7 = 71,
eKI_np_8 = 72,
eKI_np_9 = 73,
eKI_np_subtract = 74,
eKI_np_4 = 75,
eKI_np_5 = 76,
eKI_np_6 = 77,
eKI_np_add = 78,
eKI_np_1 = 79,
eKI_np_2 = 80,
eKI_np_3 = 81,
eKI_np_0 = 82,
eKI_np_period = 83,
eKI_oem_102 = 86,
eKI_f11 = 87,
eKI_f12 = 88,
eKI_f13 = 100,
eKI_f14 = 101,
eKI_f15 = 102,
eKI_colon = 146,
eKI_underline = 147,
eKI_np_enter = 156,
eKI_rctrl = 157,
eKI_np_divide = 181,
eKI_print = 183,
eKI_ralt = 184,
eKI_pause = 197,
eKI_home = 199,
eKI_up = 200,
eKI_pgup = 201,
eKI_left = 203,
eKI_right = 205,
eKI_end = 207,
eKI_down = 208,
eKI_pgdn = 209,
eKI_insert = 210,
eKI_delete = 211,
eKI_mouse1 = 386,
eKI_mouse2 = 387,
eKI_mouse3 = 388,
eKI_mouse4 = 389,
eKI_mouse5 = 390,
eKI_mouse6 = 391,
eKI_mouse7 = 392,
eKI_mouse8 = 393,
eKI_mwheel_up = 394,
eKI_mwheel_down = 395,
eKI_maxis_x = 396,
eKI_maxis_y = 397,
eKI_maxis_z = 398,
eKI_Unknown = 0xffffffff
};
Код:
struct IHardwareMouseEventListener
{
virtual ~IHardwareMouseEventListener() {}
virtual void OnHardwareMouseEvent(int iX, int iY, EHARDWAREMOUSEEVENT eHardwareMouseEvent, int wheelDelta = 0) = 0;
};
class IHardwareMouse
{
public:
virtual void Function0(); //
virtual void Function1(); //
virtual void OnPreInitRenderer(); //
virtual void OnPostInitInput(); //
virtual void Event(int iX, int iY, EHARDWAREMOUSEEVENT eHardwareMouseEvent, int wheelDelta = 0); //
virtual void AddListener(IHardwareMouseEventListener* pHardwareMouseEventListener); //
virtual void RemoveListener(IHardwareMouseEventListener* pHardwareMouseEventListener); //
virtual void Function7(); //
virtual void Function8(); //
virtual void Function9(); //
virtual void Function10(); //
virtual void Function11(); //
virtual void GetHardwareMousePosition(float* pfX, float* pfY); //
virtual void SetHardwareMousePosition(float fX, float fY); //
virtual void GetHardwareMouseClientPosition(float* pfX, float* pfY); //
virtual void SetHardwareMouseClientPosition(float fX, float fY); //
char pad_0x0004[0x14]; //0x0004
float m_fCursorX; //0x0018
float m_fCursorY; //0x001C
float m_fIncX; //0x0020
float m_fIncY; //0x0024
bool m_bFocus; //0x0028
bool m_bPrevShowState; //0x0029
bool m_allowConfine; //0x002A
char pad_0x002B[0x15]; //0x002B
}; //Size=0x0040
bool IsInBox(float x, float y, float w, float h)
{
float MouseX, MouseY;
gEnv->pHardwareMouse->GetHardwareMouseClientPosition(&MouseX, &MouseY);
return (MouseX >= x && MouseX <= x + w && MouseY >= y && MouseY <= y + h);
}
Код:
struct SInputSymbol
{
const EKeyId keyId;
const char* name;
const uint32 devSpecId;
EInputState state;
const EType type;
float value;
uint32 user;
EInputDeviceType deviceType;
uint8 deviceIndex;
};
EInputState GetKeyState(EKeyId Id)
{
SInputSymbol* Symbol = *(SInputSymbol**)(pInputSymbols + 4 * Id);
return Symbol ? Symbol->state : EInputState::eIS_Unknown;
}
Код:
#define pInputSymbols 0x1994C10
Signature: 55 8B EC 83 EC ?? 8B 45 08 56 8B 34 85
Код:
class SSуstemGlobalEnvironment
{
public:
char pad_0x0000[0x1C]; //0x0000
ILog* pLog; //0x001C
IAISystem* pAISystem; //0x0020
ICryFont* pCryFont; //0x0024
INetwork* pNetwork; //0x0028
IScriptSystem* pScriptSystem; //0x002C
IRenderer* pRenderer; //0x0030
char pad_0x0034[0x10]; //0x0034
IPhysicalWorld* pPhysicalWorld; //0x0044
IInput* pInput; //0x0048
IRenderAuxGeom* pAuxGeomRenderer; //0x004C
char pad_0x0050[0xC]; //0x0050
ICryPak* pCryPak; //0x005C
char pad_0x0060[0x4]; //0x0060
IFrameProfileSystem* pFrameProfileSystem; //0x0064
ITimer* pTimer; //0x0068
IConsole* pConsole; //0x006C
IGame* pGame; //0x0070
char pad_0x0074[0x4]; //0x0074
IEntitySystem* pEntitySystem; //0x0078
ISoundSystem* pSoundSystem; //0x007C
ISystem* pSystem; //0x0080
char pad_0x0084[0x4]; //0x0084
I3DEngine* p3DEngine; //0x0088
char pad_0x008C[0x10]; //0x008C
IMovieSystem* pMovieSystem; //0x009C
char pad_0x00A0[0x8]; //0x00A0
IHardwareMouse* pHardwareMouse; //0x00A8
}; //Size=0x00AC
IHardwareMouse* pHardwareMouse; //0x00A8
Код:
bool IsInBox(float x, float y, float w, float h)
{
if (!gEnv->pHardwareMouse->m_bFocus) return false;
float MouseX, MouseY;
gEnv->pHardwareMouse->GetHardwareMouseClientPosition(&MouseX, &MouseY);
return (MouseX >= x && MouseX <= x + w && MouseY >= y && MouseY <= y + h);
}
Последнее редактирование: