File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ void WindowSDL::onKeyPress(const SDL_Event* event) {
145
145
Input::Axis axis = Input::Axis::AxisMax;
146
146
int axisvalue = 0 ;
147
147
int ax = 0 ;
148
+ std::string backButtonBehavior = Config::getBackButtonBehavior ();
148
149
switch (event->key .key ) {
149
150
case SDLK_UP:
150
151
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_UP;
@@ -278,7 +279,15 @@ void WindowSDL::onKeyPress(const SDL_Event* event) {
278
279
ax = Input::GetAxis (0 , 0x80 , axisvalue);
279
280
break ;
280
281
case SDLK_SPACE:
281
- button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_TOUCH_PAD;
282
+ if (backButtonBehavior != " none" ) {
283
+ float x = backButtonBehavior == " left" ? 0 .25f
284
+ : (backButtonBehavior == " right" ? 0 .75f : 0 .5f );
285
+ // trigger a touchpad event so that the touchpad emulation for back button works
286
+ controller->SetTouchpadState (0 , true , x, 0 .5f );
287
+ button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_TOUCH_PAD;
288
+ } else {
289
+ button = 0 ;
290
+ }
282
291
break ;
283
292
case SDLK_F11:
284
293
if (event->type == SDL_EVENT_KEY_DOWN) {
You can’t perform that action at this time.
0 commit comments