Skip to content

Commit

Permalink
VITA: remove bluetooth keyboard and mouse lag
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Apr 4, 2018
1 parent fd2e756 commit 823d2e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/video/psp2/SDL_psp2keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ PSP2_PollKeyboard(void)
}
else if (numReports) {

if (k_reports[numReports-1].modifiers[1] & 0x1) {
if (k_reports[0].modifiers[1] & 0x1) {
if (!(locks & 0x1)) {
SDL_PrivateKeyboard(SDL_PRESSED, PSP2_TranslateKey(SCANCODE_NUMLOCKCLEAR, &keysym, 1));
locks |= 0x1;
Expand All @@ -139,7 +139,7 @@ PSP2_PollKeyboard(void)
}
}

if (k_reports[numReports-1].modifiers[1] & 0x2) {
if (k_reports[0].modifiers[1] & 0x2) {
if (!(locks & 0x2)) {
SDL_PrivateKeyboard(SDL_PRESSED, PSP2_TranslateKey(SCANCODE_CAPSLOCK, &keysym, 1));
locks |= 0x2;
Expand All @@ -152,7 +152,7 @@ PSP2_PollKeyboard(void)
}
}

if (k_reports[numReports-1].modifiers[1] & 0x4) {
if (k_reports[0].modifiers[1] & 0x4) {
if (!(locks & 0x4)) {
SDL_PrivateKeyboard(SDL_PRESSED, PSP2_TranslateKey(SCANCODE_SCROLLLOCK, &keysym, 1));
locks |= 0x4;
Expand All @@ -165,7 +165,7 @@ PSP2_PollKeyboard(void)
}
}

Uint8 changed_modifiers = k_reports[numReports-1].modifiers[0] ^ prev_modifiers;
Uint8 changed_modifiers = k_reports[0].modifiers[0] ^ prev_modifiers;

if (changed_modifiers & 0x01) {
if (prev_modifiers & 0x01) {
Expand Down Expand Up @@ -232,11 +232,11 @@ PSP2_PollKeyboard(void)
}
}

prev_modifiers = k_reports[numReports-1].modifiers[0];
prev_modifiers = k_reports[0].modifiers[0];

for (int i = 0; i < 6; i++) {

int keyCode = k_reports[numReports-1].keycodes[i];
int keyCode = k_reports[0].keycodes[i];

if (keyCode != prev_keys[i]) {
if (prev_keys[i]) {
Expand Down
4 changes: 2 additions & 2 deletions src/video/psp2/SDL_psp2mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ PSP2_PollMouse(void)
{
if (mouse_hid_handle > 0)
{
int ret = sceHidMouseRead(mouse_hid_handle, (SceHidMouseReport**)&m_reports, 1);
if (ret > 0)
int numReports = sceHidMouseRead(mouse_hid_handle, (SceHidMouseReport**)&m_reports, SCE_HID_MAX_REPORT);
if (numReports > 0)
{
Uint8 changed_buttons = m_reports[0].buttons ^ prev_buttons;

Expand Down

0 comments on commit 823d2e7

Please sign in to comment.