Files
BCIgui/Masterarbeit/openvibe/extras-master/applications/demos/ssvep-mind-shooter/src/ovamsICommandOIS.h
T
2021-10-14 13:47:35 +02:00

42 lines
1.2 KiB
C++
Executable File

#pragma once
#include <vector>
#include <OIS.h>
#include <OISKeyboard.h>
#include <OISMouse.h>
#include "ovamsICommand.h"
namespace OpenViBE {
namespace SSVEPMindShooter {
class ICommandOIS : public ICommand, OIS::KeyListener, OIS::MouseListener
{
static std::vector<ICommandOIS*> m_instances;
static int m_nInstance;
protected:
static OIS::InputManager* m_inputManager;
static OIS::Keyboard* m_keyboard;
static OIS::Mouse* m_mouse;
public:
explicit ICommandOIS(CApplication* application);
~ICommandOIS() override;
void processFrame() override;
protected:
virtual void receiveKeyPressedEvent(OIS::KeyCode key) = 0;
virtual void receiveKeyReleasedEvent(OIS::KeyCode key) = 0;
virtual void receiveMouseEvent(const OIS::MouseEvent& /*oEvent*/) {}
private:
bool keyPressed(const OIS::KeyEvent& oEvent) override;
bool keyReleased(const OIS::KeyEvent& oEvent) override;
bool mouseMoved(const OIS::MouseEvent& event) override { return true; }
bool mousePressed(const OIS::MouseEvent& /*arg*/, OIS::MouseButtonID /*id*/) override { return true; }
bool mouseReleased(const OIS::MouseEvent& /*arg*/, OIS::MouseButtonID /*id*/) override { return true; }
};
} // namespace SSVEPMindShooter
} // namespace OpenViBE