don't send spurious events for global keys
This commit is contained in:
@@ -321,8 +321,9 @@ static void HandleInputEvents(float fDeltaTime)
|
|||||||
DeviceInput DeviceI = (DeviceInput)ieArray[i];
|
DeviceInput DeviceI = (DeviceInput)ieArray[i];
|
||||||
InputEventType type = ieArray[i].type;
|
InputEventType type = ieArray[i].type;
|
||||||
|
|
||||||
if(type == IET_FIRST_PRESS && DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F4))
|
if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F4))
|
||||||
{
|
{
|
||||||
|
if(type != IET_FIRST_PRESS) continue;
|
||||||
if( INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_RALT)) ||
|
if( INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_RALT)) ||
|
||||||
INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_LALT)) )
|
INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_LALT)) )
|
||||||
{
|
{
|
||||||
@@ -339,34 +340,32 @@ static void HandleInputEvents(float fDeltaTime)
|
|||||||
PREFSMAN->m_bWindowed = !PREFSMAN->m_bWindowed;
|
PREFSMAN->m_bWindowed = !PREFSMAN->m_bWindowed;
|
||||||
ApplyGraphicOptions();
|
ApplyGraphicOptions();
|
||||||
continue;
|
continue;
|
||||||
/* why fall through? other code shouldn't be using
|
|
||||||
* globally-bound keys -glenn */
|
|
||||||
/* you're right. -Chris */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( type == IET_FIRST_PRESS && DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F5))
|
else if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F5))
|
||||||
{
|
{
|
||||||
|
if(type != IET_FIRST_PRESS) continue;
|
||||||
|
|
||||||
// pressed F5. Toggle detail.
|
// pressed F5. Toggle detail.
|
||||||
if(PREFSMAN->m_iDisplayWidth != 640)
|
if(PREFSMAN->m_iDisplayWidth != 640)
|
||||||
{
|
{
|
||||||
PREFSMAN->m_iDisplayWidth = 640;
|
PREFSMAN->m_iDisplayWidth = 640;
|
||||||
PREFSMAN->m_iDisplayHeight = 480;
|
PREFSMAN->m_iDisplayHeight = 480;
|
||||||
ApplyGraphicOptions();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PREFSMAN->m_iDisplayWidth = 320;
|
PREFSMAN->m_iDisplayWidth = 320;
|
||||||
PREFSMAN->m_iDisplayHeight = 240;
|
PREFSMAN->m_iDisplayHeight = 240;
|
||||||
|
}
|
||||||
ApplyGraphicOptions();
|
ApplyGraphicOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_RETURN))
|
||||||
|
|
||||||
if(type == IET_FIRST_PRESS && DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_RETURN))
|
|
||||||
{
|
{
|
||||||
if( INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_RALT)) ||
|
if( INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_RALT)) ||
|
||||||
INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_LALT)) )
|
INPUTMAN->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_LALT)) )
|
||||||
{
|
{
|
||||||
|
if(type != IET_FIRST_PRESS) continue;
|
||||||
/* alt-enter */
|
/* alt-enter */
|
||||||
PREFSMAN->m_bWindowed = !PREFSMAN->m_bWindowed;
|
PREFSMAN->m_bWindowed = !PREFSMAN->m_bWindowed;
|
||||||
ApplyGraphicOptions();
|
ApplyGraphicOptions();
|
||||||
|
|||||||
Reference in New Issue
Block a user