25 #include "common/scummsys.h" 26 #include "common/events.h" 27 #include "backends/platform/psp/pspkeyboard.h" 28 #include "backends/platform/psp/cursor.h" 29 #include "backends/platform/psp/image_viewer.h" 35 PSP_EVENT_SHOW_VIRTUAL_KB,
38 PSP_EVENT_MODE_SWITCH,
39 PSP_EVENT_CHANGE_SPEED,
40 PSP_EVENT_IMAGE_VIEWER,
41 PSP_EVENT_IMAGE_VIEWER_SET_BUTTONS,
50 type = PSP_EVENT_NONE;
53 bool isEmpty() {
return type == PSP_EVENT_NONE; }
80 void setKey(Common::KeyCode key, uint32 ascii = 0, uint32 flag = 0) { _key = key; _ascii = ascii; _flag = flag; }
81 void setPspEvent(PspEventType typeDown, uint32 dataDown, PspEventType typeUp, uint32 dataUp);
107 Button _button[BTN_LAST][SHIFTED_MODE_LAST];
108 uint32 _buttonsChanged[SHIFTED_MODE_LAST];
109 uint32 _prevButtonState;
114 static const uint32 _buttonMap[];
116 void initButtonsNormalMode();
117 void initButtonsLolMode();
118 void modifyButtonsForCombos(SceCtrlData &pad);
128 void setShifted(ShiftMode shifted) { _shifted = shifted; }
129 void setPadMode(PspPadMode mode) { _padMode = mode; }
130 bool isButtonDown() {
return _prevButtonState; }
132 void enableCombos(
bool value) { _combosEnabled = value; }
133 Button &getButton(ButtonType type, ShiftMode mode) {
return _button[type][mode]; }
147 int32 modifyNubAxisMotion(int32 input);
148 void translateToDpadState(
int dpadX,
int dpadY, uint32 &buttonState);
150 Nub() : _shifted(UNSHIFTED), _dpadMode(
false), _hiresX(0), _hiresY(0) { }
151 void init() { _buttonPad.initButtons(); }
153 void setCursor(
Cursor *cursor) { _cursor = cursor; }
156 void setDpadMode(
bool active) { _dpadMode = active; }
157 void setShifted(ShiftMode shifted) { _shifted = shifted; }
162 ButtonPad &getPad() {
return _buttonPad; }
167 InputHandler() : _keyboard(0), _cursor(0), _imageViewer(0), _padMode(PAD_MODE_NORMAL),
168 _lastPadCheckTime(0) {}
170 void setKeyboard(
PSPKeyboard *keyboard) { _keyboard = keyboard; }
171 void setCursor(
Cursor *cursor) { _cursor = cursor; _nub.setCursor(cursor); }
172 void setImageViewer(
ImageViewer *imageViewer) { _imageViewer = imageViewer; }
176 void setImageViewerMode(
bool active);
189 uint32 _lastPadCheckTime;
190 static const char *_padModeText[];
195 void handleShiftEvent(ShiftMode shifted);
196 void handleModeSwitchEvent();
197 void setButtonsForImageViewer();
EventType
Definition: events.h:49
Definition: atari-cursor.h:38
Definition: image_viewer.h:29
Definition: pspkeyboard.h:37