ddnet/src/engine/client/input.h

53 lines
1.4 KiB
C
Raw Normal View History

2010-11-20 10:37:14 +00:00
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com. */
2010-05-29 07:25:38 +00:00
#ifndef ENGINE_CLIENT_INPUT_H
#define ENGINE_CLIENT_INPUT_H
class CInput : public IEngineInput
{
IEngineGraphics *m_pGraphics;
int m_InputGrabbed;
char *m_pClipboardText;
2010-05-29 07:25:38 +00:00
2010-09-05 12:04:50 +00:00
int64 m_LastRelease;
int64 m_ReleaseDelta;
2010-05-29 07:25:38 +00:00
2014-06-16 11:29:18 +00:00
int m_VideoRestartNeeded;
2016-04-30 02:02:32 +00:00
void AddEvent(char *pText, int Key, int Flags);
2010-05-29 07:25:38 +00:00
IEngineGraphics *Graphics() { return m_pGraphics; }
public:
CInput();
virtual void Init();
int KeyState(int Key) const;
int KeyStateOld(int Key) const;
int KeyWasPressed(int Key) const { return KeyStateOld(Key); }
int KeyPressed(int Key) const { return KeyState(Key); }
int KeyReleases(int Key) const { return m_aInputCount[m_InputCurrent][Key].m_Releases; }
int KeyPresses(int Key) const { return m_aInputCount[m_InputCurrent][Key].m_Presses; }
int KeyDown(int Key) const { return KeyPressed(Key)&&!KeyWasPressed(Key); }
virtual void MouseRelative(float *x, float *y);
2010-05-29 07:25:38 +00:00
virtual void MouseModeAbsolute();
virtual void MouseModeRelative();
virtual int MouseDoubleClick();
virtual const char* GetClipboardText();
virtual void SetClipboardText(const char *Text);
2010-05-29 07:25:38 +00:00
void ClearKeyStates();
int ButtonPressed(int Button) { return m_aInputState[m_InputCurrent][Button]; }
virtual int Update();
2014-06-16 11:29:18 +00:00
virtual int VideoRestartNeeded();
2010-05-29 07:25:38 +00:00
};
#endif