Allow flushing of queued input events.

This commit is contained in:
Steve Checkoway
2006-09-08 04:10:47 +00:00
parent 99f9d8d33c
commit 8c3f4cebba
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -354,6 +354,16 @@ void InputFilter::GetInputEvents( vector<InputEvent> &array )
array.swap( queue );
}
void InputFilter::FlushInputEvents()
{
/* Calling clear() will delete each InputEvent while holding the lock.
* This way, the LockMutex will be deleted before array which will unlock
* the mutex before deleting each InputEvent. */
vector<InputEvent> array;
LockMut(*queuemutex);
array.swap( queue );
}
void InputFilter::GetPressedButtons( vector<DeviceInput> &array )
{
LockMut(*queuemutex);