1 #ifndef INPUTEVENTGENERATOR_HH
2 #define INPUTEVENTGENERATOR_HH
13 class CommandController;
14 class EventDistributor;
48 using EventPtr = std::shared_ptr<const Event>;
50 void handle(
const SDL_Event& evt);
51 void handleKeyDown(
const SDL_KeyboardEvent& key, uint32_t unicode);
52 void handleText(
const char*
utf8);
53 void setGrabInput(
bool grab);
56 int signalEvent(
const std::shared_ptr<const Event>& event)
override;
62 struct EscapeGrabCmd final :
Command {
65 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
68 enum EscapeGrabState {
70 ESCAPE_GRAB_WAIT_LOST,
75 void setNewOsdControlButtonState(
76 unsigned newState,
const EventPtr& origEvent);
77 void triggerOsdControlEventsFromJoystickAxisMotion(
78 unsigned axis,
int value,
const EventPtr& origEvent);
79 void triggerOsdControlEventsFromJoystickHat(
80 int value,
const EventPtr& origEvent);
81 void osdControlChangeButton(
82 bool up,
unsigned changedButtonMask,
const EventPtr& origEvent);
83 void triggerOsdControlEventsFromJoystickButtonEvent(
84 unsigned button,
bool up,
const EventPtr& origEvent);
85 void triggerOsdControlEventsFromKeyEvent(
89 unsigned osdControlButtonsState;
92 static inline bool androidButtonA =
false;
93 static inline bool androidButtonB =
false;