7using namespace std::literals;
23 return std::tuple(a.getX(), a.getY(), a.getAbsX(), a.getAbsY()) ==
24 std::tuple(b.getX(), b.getY(), b.getAbsX(), b.getAbsY());
27 return a.getButton() == b.getButton();
30 return a.getButton() == b.getButton();
33 return std::tuple(a.getX(), a.getY()) ==
34 std::tuple(b.getX(), b.getY());
37 return std::tuple(a.getJoystick(), a.getAxis(), a.getValue()) ==
38 std::tuple(b.getJoystick(), b.getAxis(), b.getValue());
41 return std::tuple(a.getJoystick(), a.getHat(), a.getValue()) ==
42 std::tuple(b.getJoystick(), b.getHat(), b.getValue());
45 return std::tuple(a.getJoystick(), a.getButton()) ==
46 std::tuple(b.getJoystick(), b.getButton());
49 return std::tuple(a.getJoystick(), a.getButton()) ==
50 std::tuple(b.getJoystick(), b.getButton());
53 return a.getButton() == b.getButton();
56 return a.getButton() == b.getButton();
59 return a.getGain() == b.getGain();
62 return std::tuple(a.getX(), a.getY()) ==
63 std::tuple(b.getX(), b.getY());
66 return a.getFileName() == b.getFileName();
69 return std::tuple(a.getSource(), a.getSelectedSource(), a.isSkipped()) ==
70 std::tuple(b.getSource(), b.getSelectedSource(), b.isSkipped());
73 return a.getCommand() == b.getCommand();
76 return a.getTclListComponents() ==
77 b.getTclListComponents();
87 static constexpr std::array osdControlNames = {
88 "LEFT"sv,
"RIGHT"sv,
"UP"sv,
"DOWN"sv,
"A"sv,
"B"sv
105 if (
e.getUnicode() != 0) {
106 result.addListElement(
tmpStrCat(
"unicode",
e.getUnicode()));
111 return makeTclList(
"mouse",
"motion",
e.getX(),
e.getY(),
e.getAbsX(),
e.getAbsY());
126 const char* str = [&] {
127 switch (
e.getValue()) {
128 case SDL_HAT_UP:
return "up";
129 case SDL_HAT_RIGHT:
return "right";
130 case SDL_HAT_DOWN:
return "down";
131 case SDL_HAT_LEFT:
return "left";
132 case SDL_HAT_RIGHTUP:
return "rightup";
133 case SDL_HAT_RIGHTDOWN:
return "rightdown";
134 case SDL_HAT_LEFTUP:
return "leftup";
135 case SDL_HAT_LEFTDOWN:
return "leftdown";
136 default:
return "center";
148 return makeTclList(
"OSDcontrol", osdControlNames[
e.getButton()],
"RELEASE");
151 return makeTclList(
"OSDcontrol", osdControlNames[
e.getButton()],
"PRESS");
166 return makeTclList(
"finishframe",
int(
e.getSource()),
int(
e.getSelectedSource()),
e.isSkipped());
172 return e.getTclListComponents();
182 return std::string(
toTclList(event).getString());
187 assert(self && other);
198 if (!
e.getOrigEvent())
return true;
199 if (
e.getOrigEvent() == other)
return false;
218 assert(self && other);
224 return self == other;
Command received on CliComm connection.
This event is send when a device (v99x8, v9990, video9000, laserdisc) reaches the end of a frame.
Keys::KeyCode getKeyCode() const
OSD events are triggered by other events.
std::string getName(KeyCode keyCode)
Translate key code to key name.
This file implemented 3 utility functions:
bool operator==(const Event &x, const Event &y)
bool isRepeatStopper(const Event &self, const Event &other)
Should 'bind -repeat' be stopped by 'other' event.
bool matches(const Event &self, const Event &other)
Does this event 'match' the given event.
auto visit(Visitor &&visitor, const Event &event)
TclObject toTclList(const Event &event)
Similar to toString(), but retains the structure of the event.
EventType getType(const Event &event)
TclObject makeTclList(Args &&... args)
std::string toString(const Event &event)
Get a string representation of this event.
constexpr bool contains(ITER first, ITER last, const VAL &val)
Check if a range contains a given value, using linear search.
TemporaryString tmpStrCat(Ts &&... ts)