mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-22 07:53:51 +00:00
45 lines
788 B
C++
45 lines
788 B
C++
#include <iostream>
|
|
#include "../filters/eventlist.hpp"
|
|
|
|
using namespace std;
|
|
using namespace Mangle::Input;
|
|
|
|
struct MyEvent : Event
|
|
{
|
|
int ii;
|
|
MyEvent(int i) : ii(i) {}
|
|
|
|
void event(Event::Type type, int i, const void *p)
|
|
{
|
|
cout << " #" << ii << " got event: type=" << type << " index=" << i << endl;
|
|
}
|
|
};
|
|
|
|
EventList lst;
|
|
|
|
int iii=1;
|
|
void make(int flags)
|
|
{
|
|
lst.add(EventPtr(new MyEvent(iii++)), flags);
|
|
}
|
|
|
|
void send(Event::Type type)
|
|
{
|
|
cout << "Sending type " << type << endl;
|
|
lst.event(type,0,NULL);
|
|
}
|
|
|
|
int main()
|
|
{
|
|
make(Event::EV_ALL);
|
|
make(Event::EV_KeyDown);
|
|
make(Event::EV_KeyUp | Event::EV_MouseDown);
|
|
|
|
send(Event::EV_Unknown);
|
|
send(Event::EV_KeyDown);
|
|
send(Event::EV_KeyUp);
|
|
send(Event::EV_MouseDown);
|
|
|
|
cout << "Enough of that\n";
|
|
return 0;
|
|
}
|