mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
reverted input key handling back to 0.52(the keyboard layout problem should be fixed with sdl 1.3 or a customised one). Closes #3. Closes #15.
This commit is contained in:
parent
0fc74db57a
commit
8efbdda546
|
@ -31,7 +31,6 @@ CInput::CInput()
|
||||||
{
|
{
|
||||||
mem_zero(m_aInputCount, sizeof(m_aInputCount));
|
mem_zero(m_aInputCount, sizeof(m_aInputCount));
|
||||||
mem_zero(m_aInputState, sizeof(m_aInputState));
|
mem_zero(m_aInputState, sizeof(m_aInputState));
|
||||||
mem_zero(m_Keys, sizeof(m_Keys));
|
|
||||||
|
|
||||||
m_InputCurrent = 0;
|
m_InputCurrent = 0;
|
||||||
m_InputGrabbed = 0;
|
m_InputGrabbed = 0;
|
||||||
|
@ -146,20 +145,11 @@ void CInput::Update()
|
||||||
// handle keys
|
// handle keys
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
AddEvent(Event.key.keysym.unicode, 0, 0); // ignore_convention
|
AddEvent(Event.key.keysym.unicode, 0, 0); // ignore_convention
|
||||||
if(Event.key.keysym.unicode != 0 && Event.key.keysym.unicode < 256) // ignore_convention
|
Key = Event.key.keysym.sym; // ignore_convention
|
||||||
{
|
|
||||||
Key = Event.key.keysym.unicode; // ignore_convention
|
|
||||||
m_Keys[Event.key.keysym.sym] = Event.key.keysym.unicode; // ignore_convention
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Key = Event.key.keysym.sym; // ignore_convention
|
|
||||||
break;
|
break;
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
Action = IInput::FLAG_RELEASE;
|
Action = IInput::FLAG_RELEASE;
|
||||||
if(m_Keys[Event.key.keysym.sym] != 0) // ignore_convention
|
Key = Event.key.keysym.sym; // ignore_convention
|
||||||
Key = m_Keys[Event.key.keysym.sym]; // ignore_convention
|
|
||||||
else
|
|
||||||
Key = Event.key.keysym.sym; // ignore_convention
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// handle mouse buttons
|
// handle mouse buttons
|
||||||
|
|
|
@ -10,8 +10,6 @@ class CInput : public IEngineInput
|
||||||
unsigned int m_LastRelease;
|
unsigned int m_LastRelease;
|
||||||
unsigned int m_ReleaseDelta;
|
unsigned int m_ReleaseDelta;
|
||||||
|
|
||||||
int m_Keys[1024];
|
|
||||||
|
|
||||||
void AddEvent(int Unicode, int Key, int Flags);
|
void AddEvent(int Unicode, int Key, int Flags);
|
||||||
|
|
||||||
IEngineGraphics *Graphics() { return m_pGraphics; }
|
IEngineGraphics *Graphics() { return m_pGraphics; }
|
||||||
|
|
Loading…
Reference in a new issue