Skip to content

Commit

Permalink
fix keys being pressed when pressing Vita buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Dec 24, 2017
1 parent a985fc3 commit 70d8f55
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Readme.txt
Expand Up @@ -112,6 +112,9 @@ Square = Backspace
Triangle = Toggle Shift

CHANGELOG:
1.56

- fix keys being pressed when pressing Vita buttons (introduced in 1.55)

1.55

Expand Down
7 changes: 6 additions & 1 deletion src/gp2x/menu/menu_main.cpp
Expand Up @@ -35,6 +35,7 @@
#include <psp2/shellutil.h>
#include <psp2/io/fcntl.h>
#define SDL_PollEvent PSP2_PollEvent
int inside_menu = 0;
#endif

extern int kickstart;
Expand Down Expand Up @@ -844,6 +845,7 @@ int run_mainMenu()
init_text(0);

#ifdef __PSP2__
inside_menu = 1;
SDL_Event event;
while (SDL_PollEvent(&event) > 0);
#endif
Expand Down Expand Up @@ -1047,11 +1049,14 @@ int run_mainMenu()
#endif

//See if new joysticks have been paired
close_joystick();
close_joystick();
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
init_joystick();

update_display();
#ifdef __PSP2__
inside_menu = 0;
#endif
return mainMenu_case;
}
4 changes: 3 additions & 1 deletion src/psp2/psp2_input.c
@@ -1,5 +1,7 @@
#include "psp2_input.h"

extern int inside_menu;

SDLKey getKey(Uint8 button) {

switch(button) {
Expand Down Expand Up @@ -51,7 +53,7 @@ int PSP2_PollEvent(SDL_Event *event) {

int ret = SDL_PollEvent(event);

if(event != NULL) {
if(event != NULL && inside_menu) {

switch (event->type) {

Expand Down

0 comments on commit 70d8f55

Please sign in to comment.