30 std::tuple(b.getKeyCode(), normalizeKeyMod(b.getModifiers()));
35 std::tuple(b.getKeyCode(), normalizeKeyMod(b.getModifiers()));
38 return std::tuple(a.getX(), a.getY(), a.getAbsX(), a.getAbsY()) ==
39 std::tuple(b.getX(), b.getY(), b.getAbsX(), b.getAbsY());
42 return a.getButton() == b.getButton();
45 return a.getButton() == b.getButton();
48 return std::tuple(a.getX(), a.getY()) ==
49 std::tuple(b.getX(), b.getY());
52 return std::tuple(a.getJoystick(), a.getAxis(), a.getValue()) ==
53 std::tuple(b.getJoystick(), b.getAxis(), b.getValue());
56 return std::tuple(a.getJoystick(), a.getHat(), a.getValue()) ==
57 std::tuple(b.getJoystick(), b.getHat(), b.getValue());
60 return std::tuple(a.getJoystick(), a.getButton()) ==
61 std::tuple(b.getJoystick(), b.getButton());
64 return std::tuple(a.getJoystick(), a.getButton()) ==
65 std::tuple(b.getJoystick(), b.getButton());
68 return a.getButton() == b.getButton();
71 return a.getButton() == b.getButton();
75 const auto& b = b_.getSdlWindowEvent();
77 if (a.event != b.event)
return false;
78 if (a.windowID != b.windowID)
return false;
83 return a.getFileName() == b.getFileName();
86 return std::tuple(a.getSource(), a.getSelectedSource(), a.isSkipped()) ==
87 std::tuple(b.getSource(), b.getSelectedSource(), b.isSkipped());
90 return a.getCommand() == b.getCommand();
93 return a.getTclListComponents() ==
94 b.getTclListComponents();
105 "LEFT"sv,
"RIGHT"sv,
"UP"sv,
"DOWN"sv,
"A"sv,
"B"sv
121 auto result =
makeTclList(
"keyb", e.getKey().toString());
122 if (e.getUnicode() != 0) {
123 result.addListElement(
tmpStrCat(
"unicode", e.getUnicode()));
128 return makeTclList(
"mouse",
"motion", e.getX(), e.getY(), e.getAbsX(), e.getAbsY());
137 return makeTclList(
"mouse",
"wheel", e.getX(), e.getY());
143 const char* str = [&] {
144 switch (e.getValue()) {
145 case SDL_HAT_UP:
return "up";
146 case SDL_HAT_RIGHT:
return "right";
147 case SDL_HAT_DOWN:
return "down";
148 case SDL_HAT_LEFT:
return "left";
149 case SDL_HAT_RIGHTUP:
return "rightup";
150 case SDL_HAT_RIGHTDOWN:
return "rightdown";
151 case SDL_HAT_LEFTUP:
return "leftup";
152 case SDL_HAT_LEFTDOWN:
return "leftdown";
153 default:
return "center";
165 return makeTclList(
"OSDcontrol", osdControlNames[e.getButton()],
"RELEASE");
168 return makeTclList(
"OSDcontrol", osdControlNames[e.getButton()],
"PRESS");
171 const auto& e = e_.getSdlWindowEvent();
172 if (e.event == SDL_WINDOWEVENT_FOCUS_GAINED) {
174 }
else if (e.event == SDL_WINDOWEVENT_FOCUS_LOST) {
189 return makeTclList(
"finishframe",
int(e.getSource()),
int(e.getSelectedSource()), e.isSkipped());
195 return e.getTclListComponents();
std::variant< KeyUpEvent, KeyDownEvent, MouseMotionEvent, MouseButtonUpEvent, MouseButtonDownEvent, MouseWheelEvent, JoystickAxisMotionEvent, JoystickHatEvent, JoystickButtonUpEvent, JoystickButtonDownEvent, OsdControlReleaseEvent, OsdControlPressEvent, WindowEvent, TextEvent, FileDropEvent, QuitEvent, FinishFrameEvent, CliCommandEvent, GroupEvent, BootEvent, FrameDrawnEvent, BreakEvent, SwitchRendererEvent, TakeReverseSnapshotEvent, AfterTimedEvent, MachineLoadedEvent, MachineActivatedEvent, MachineDeactivatedEvent, MidiInReaderEvent, MidiInWindowsEvent, MidiInCoreMidiEvent, MidiInCoreMidiVirtualEvent, MidiInALSAEvent, Rs232TesterEvent, Rs232NetEvent, ImGuiDelayedActionEvent, ImGuiActiveEvent > Event
constexpr bool contains(ITER first, ITER last, const VAL &val)
Check if a range contains a given value, using linear search.