added missing buttons and analog buttons to keyboard

This commit is contained in:
georgemoralis 2024-06-21 14:37:49 +03:00
parent 19edb8155f
commit 7519d4610c
2 changed files with 43 additions and 2 deletions

View File

@ -52,8 +52,14 @@ int PS4_SYSV_ABI sceKernelOpen(const char* path, int flags, u16 mode) {
bool direct = (flags & ORBIS_KERNEL_O_DIRECT) != 0; bool direct = (flags & ORBIS_KERNEL_O_DIRECT) != 0;
bool directory = (flags & ORBIS_KERNEL_O_DIRECTORY) != 0; bool directory = (flags & ORBIS_KERNEL_O_DIRECTORY) != 0;
if (std::string_view{path} == "/dev/console" || std::string_view{path} == "/dev/deci_tty6") { if (std::string_view{path} == "/dev/console") {
return ORBIS_OK; return 2000;
}
if (std::string_view{path} == "/dev/deci_tty6") {
return 2001;
}
if (std::string_view{path} == "/dev/stdout") {
return 2002;
} }
u32 handle = h->CreateHandle(); u32 handle = h->CreateHandle();
auto* file = h->GetFile(handle); auto* file = h->GetFile(handle);

View File

@ -202,6 +202,41 @@ void WindowSDL::onKeyPress(const SDL_Event* event) {
} }
ax = Input::GetAxis(-0x80, 0x80, axisvalue); ax = Input::GetAxis(-0x80, 0x80, axisvalue);
break; break;
case SDLK_x:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_L3;
break;
case SDLK_m:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_R3;
break;
case SDLK_q:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_L1;
break;
case SDLK_u:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_R1;
break;
case SDLK_e:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_L2;
axis = Input::Axis::TriggerLeft;
if (event->type == SDL_EVENT_KEY_DOWN) {
axisvalue += 255;
} else {
axisvalue = 0;
}
ax = Input::GetAxis(0, 0x80, axisvalue);
break;
case SDLK_o:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_R2;
axis = Input::Axis::TriggerRight;
if (event->type == SDL_EVENT_KEY_DOWN) {
axisvalue += 255;
} else {
axisvalue = 0;
}
ax = Input::GetAxis(0, 0x80, axisvalue);
break;
case SDLK_SPACE:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_TOUCH_PAD;
break;
default: default:
break; break;
} }