genode/libports/src/app/qt5/qt_avplay/input_service.cpp

41 lines
746 B
C++

/*
* \brief Input service
* \author Christian Prochaska
* \date 2012-03-29
*/
/*
* Copyright (C) 2012-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/* Genode includes */
#include <input/component.h>
#include "input_service.h"
using namespace Genode;
Event_queue ev_queue;
namespace Input {
/*
* Event handling is disabled on queue creation and will be enabled later if a
* session is created.
*/
void event_handling(bool enable)
{
if (enable)
ev_queue.enable();
else
ev_queue.disable();
}
bool event_pending() { return !ev_queue.empty(); }
Event get_event() { return ev_queue.get(); }
}