From 7519d4610c012347a4a0865d36f44dd6cc5dd2c1 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Fri, 21 Jun 2024 14:37:49 +0300 Subject: [PATCH] added missing buttons and analog buttons to keyboard --- src/core/libraries/kernel/file_system.cpp | 10 +++++-- src/sdl_window.cpp | 35 +++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 286d93d5..2a874c63 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -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 directory = (flags & ORBIS_KERNEL_O_DIRECTORY) != 0; - if (std::string_view{path} == "/dev/console" || std::string_view{path} == "/dev/deci_tty6") { - return ORBIS_OK; + if (std::string_view{path} == "/dev/console") { + 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(); auto* file = h->GetFile(handle); diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index 57297d0a..ef492db6 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -202,6 +202,41 @@ void WindowSDL::onKeyPress(const SDL_Event* event) { } ax = Input::GetAxis(-0x80, 0x80, axisvalue); 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: break; }