Go to the documentation of this file.
20 , realtime(Timer::getTime())
28 :
TimedEvent(type_), keyCode(keyCode_), scanCode(scanCode_), unicode(unicode_)
52 bool KeyEvent::lessImpl(
const Event& other)
const
55 const auto& o = checked_cast<const KeyEvent&>(other);
72 bool MouseButtonEvent::lessImpl(
const Event& other)
const
74 const auto& o = checked_cast<const MouseButtonEvent&>(other);
118 bool MouseWheelEvent::lessImpl(
const Event& other)
const
120 const auto& o = checked_cast<const MouseWheelEvent&>(other);
121 return std::tuple(
getX(),
getY()) <
122 std::tuple(o.getX(), o.getY());
130 , xrel(xrel_), yrel(yrel_)
131 , xabs(xabs_), yabs(yabs_)
140 bool MouseMotionEvent::lessImpl(
const Event& other)
const
142 const auto& o = checked_cast<const MouseMotionEvent&>(other);
144 std::tuple(o.getX(), o.getY(), o.getAbsX(), o.getAbsY());
160 bool JoystickEvent::lessImpl(
const Event& other)
const
162 const auto& o = checked_cast<const JoystickEvent&>(other);
172 EventType type_,
unsigned joystick_,
unsigned button_)
184 bool JoystickButtonEvent::lessImpl(
const JoystickEvent& other)
const
186 const auto& o = checked_cast<const JoystickButtonEvent&>(other);
220 unsigned joystick_,
unsigned axis_,
int value_)
222 , axis(axis_), value(value_)
233 bool JoystickAxisMotionEvent::lessImpl(
const JoystickEvent& other)
const
235 const auto& o = checked_cast<const JoystickAxisMotionEvent&>(other);
237 std::tuple(o.getAxis(), o.getValue());
245 , hat(hat_), value(value_)
252 const char* str = [&] {
254 case SDL_HAT_UP:
return "up";
255 case SDL_HAT_RIGHT:
return "right";
256 case SDL_HAT_DOWN:
return "down";
257 case SDL_HAT_LEFT:
return "left";
258 case SDL_HAT_RIGHTUP:
return "rightup";
259 case SDL_HAT_RIGHTDOWN:
return "rightdown";
260 case SDL_HAT_LEFTUP:
return "leftup";
261 case SDL_HAT_LEFTDOWN:
return "leftdown";
262 default:
return "center";
269 bool JoystickHatEvent::lessImpl(
const JoystickEvent& other)
const
271 const auto& o = checked_cast<const JoystickHatEvent&>(other);
273 std::tuple(o.getHat(), o.getValue());
289 bool FocusEvent::lessImpl(
const Event& other)
const
291 const auto& o = checked_cast<const FocusEvent&>(other);
292 return getGain() < o.getGain();
308 bool ResizeEvent::lessImpl(
const Event& other)
const
310 const auto& o = checked_cast<const ResizeEvent&>(other);
311 return std::tuple(
getX(),
getY()) <
312 std::tuple(o.getX(), o.getY());
328 bool FileDropEvent::lessImpl(
const Event& other)
const
330 const auto& o = checked_cast<const FileDropEvent&>(other);
346 bool QuitEvent::lessImpl(
const Event& )
const
355 std::shared_ptr<const Event> origEvent_)
356 :
TimedEvent(type_), origEvent(std::move(origEvent_)), button(button_)
364 if (origEvent.get() == &other)
return false;
378 static constexpr
const char*
const names[] = {
379 "LEFT",
"RIGHT",
"UP",
"DOWN",
"A",
"B"
384 bool OsdControlEvent::lessImpl(
const Event& other)
const
386 const auto& o = checked_cast<const OsdControlEvent&>(other);
394 unsigned button_,
const std::shared_ptr<const Event>& origEvent_)
408 unsigned button_,
const std::shared_ptr<const Event>& origEvent_)
423 , typesToMatch(std::move(typesToMatch_))
424 , tclListComponents(std::move(tclListComponents_))
430 return tclListComponents;
433 bool GroupEvent::lessImpl(
const Event& )
const
439 bool GroupEvent::matches(
const Event& other)
const
441 return contains(typesToMatch, other.getType());
@ OPENMSX_MOUSE_WHEEL_EVENT
@ OPENMSX_JOY_AXIS_MOTION_EVENT
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
constexpr bool contains(ITER first, ITER last, const VAL &val)
Check if a range contains a given value, using linear search.
@ OPENMSX_MOUSE_MOTION_EVENT
KeyEvent(EventType type, Keys::KeyCode keyCode, Keys::KeyCode scanCode, uint32_t unicode)
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
uint32_t getUnicode() const
TclObject toTclHelper(std::string_view direction) const
@ OPENMSX_OSD_CONTROL_PRESS_EVENT
unsigned getJoystick() const
unsigned getButton() const
JoystickAxisMotionEvent(unsigned joystick, unsigned axis, int value)
MouseWheelEvent(int x, int y)
@ OPENMSX_MOUSE_BUTTON_UP_EVENT
string getName(KeyCode keyCode)
Translate key code to key name.
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
ResizeEvent(unsigned x, unsigned y)
MouseMotionEvent(int xrel, int yrel, int xabs, int yabs)
OsdControlPressEvent(unsigned button, const std::shared_ptr< const Event > &origEvent)
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
GroupEvent(EventType type, std::vector< EventType > typesToMatch, TclObject tclListComponents)
JoystickEvent(EventType type, unsigned joystick)
unsigned getValue() const
JoystickHatEvent(unsigned joystick, unsigned hat, unsigned value)
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
FileDropEvent(std::string fileName)
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
TemporaryString tmpStrCat(Ts &&... ts)
OsdControlReleaseEvent(unsigned button, const std::shared_ptr< const Event > &origEvent)
constexpr KeyMatrixPosition x
Keyboard bindings.
TimedEvent(EventType type)
bool isRepeatStopper(const Event &other) const final
Get the event that actually triggered the creation of this event.
TclObject toTclHelper() const
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
@ OPENMSX_MOUSE_BUTTON_DOWN_EVENT
TclObject makeTclList(Args &&... args)
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
KeyCode
Constants that identify keys and key modifiers.
@ OPENMSX_JOY_BUTTON_DOWN_EVENT
OSD events are triggered by other events.
Keys::KeyCode getKeyCode() const
This file implemented 3 utility functions:
const std::string & getFileName() const
@ OPENMSX_JOY_BUTTON_UP_EVENT
OsdControlEvent(EventType type, unsigned button_, std::shared_ptr< const Event > origEvent)
@ OPENMSX_OSD_CONTROL_RELEASE_EVENT