From 13fb1dbdb13b63028ff4d11f0d75bf3dc9f88d94 Mon Sep 17 00:00:00 2001
From: MyLuxy <240354279+MyLuxy@users.noreply.github.com>
Date: Thu, 15 Oct 2026 01:31:14 +0200
Subject: [PATCH] fix: remove usb keyboard support
---
README.md | 9 +-
README.ru.md | 7 -
app/search/Keyboard.jsx | 10 +-
ps5-react/CHANGELOG.md | 8 -
ps5-react/docs/NAVIGATION.md | 13 +-
ps5-react/native/ps5/native_host.cpp | 13 --
ps5-react/native/ps5/usb_keyboard.cpp | 233 --------------------------
ps5-react/native/ps5/usb_keyboard.hpp | 50 ------
ps5-react/native/shared/actions.hpp | 2 +-
ps5-react/runtime/js/index.js | 15 +-
ps5-react/runtime/js/input.js | 29 +---
ps5-react/tools/build_ps5.py | 2 +-
12 files changed, 8 insertions(+), 383 deletions(-)
delete mode 100644 ps5-react/native/ps5/usb_keyboard.cpp
delete mode 100644 ps5-react/native/ps5/usb_keyboard.hpp
diff --git a/README.md b/README.md
index eb6be12..733268c 100644
--- a/README.md
+++ b/README.md
@@ -257,7 +257,7 @@ that creates its tag, and installed apps offer exactly the tested files on their
-Changes to upstream ps5-react
+Fixes over upstream ps5-react
Two fixes in the vendored framework, both in the build tooling and both reported by a Linux build:
@@ -269,13 +269,6 @@ Two fixes in the vendored framework, both in the build tooling and both reported
which reads zstd only from Python 3.14 while the documented minimum is 3.12. It now falls back
to the `zstd` command.
-One addition, for Overdrive's text fields:
-
-- **USB keyboard.** `ps5-react/native/ps5/usb_keyboard.cpp` reads a keyboard plugged into the console
- through libSceKeyboard and hands typed characters (US layout) and Backspace, Enter, Escape and Tab to
- the new `useKeyboardInput` hook (input protocol v6, see `ps5-react/docs/NAVIGATION.md`). Without a
- keyboard nothing changes. It has no hardware evidence yet.
-
Nothing else in the framework is changed.
diff --git a/README.ru.md b/README.ru.md
index 742a13f..7a8abc3 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -273,13 +273,6 @@ Linux:
`tarfile`, а тот читает zstd только начиная с Python 3.14, тогда как документированный минимум —
3.12. Теперь есть откат на команду `zstd`.
-Одно дополнение для текстовых полей Overdrive:
-
-- **USB-клавиатура.** `ps5-react/native/ps5/usb_keyboard.cpp` читает клавиатуру, подключённую к консоли,
- через libSceKeyboard и передаёт набранные символы (раскладка US), а также Backspace, Enter, Escape и Tab
- новому хуку `useKeyboardInput` (протокол ввода v6, см. `ps5-react/docs/NAVIGATION.md`). Без клавиатуры
- ничего не меняется. На консоли пока не проверено.
-
Больше во фреймворке ничего не изменено.
diff --git a/app/search/Keyboard.jsx b/app/search/Keyboard.jsx
index 01053bc..78b8f88 100644
--- a/app/search/Keyboard.jsx
+++ b/app/search/Keyboard.jsx
@@ -1,6 +1,5 @@
// ../pub-game-store/native/search/Keyboard.jsx
// reconstructed from the esbuild bundle in eboot.bin
-// MODIFIED: a USB keyboard types into the field too.
import '../assets/Inter-Regular.ttf';
import { Fragment, jsx, jsxs } from 'react/jsx-runtime';
@@ -11,7 +10,7 @@ import { ButtonGlyph } from '../ui/ButtonHints.jsx';
import { Icon } from '../ui/Icon.jsx';
import { HINT, useHints } from '../ui/Legend.jsx';
import { colors } from '../ui/colors.js';
-import { FocusScope, Text, View, motion, useIsFocused, useKeyboardInput } from '@ps5-react/core';
+import { FocusScope, Text, View, motion, useIsFocused } from '@ps5-react/core';
var COLUMNS2 = 6;
var LTR2 = { direction: "ltr" };
@@ -57,13 +56,6 @@ import { FocusScope, Text, View, motion, useIsFocused, useKeyboardInput } from '
(value) => value === "case" ? setUpper((value2) => !value2) : value === "done" ? onSubmit() : onChange((query) => edit(query, value, url ? 8192 : MAX_QUERY)),
[onChange, onSubmit, url]
);
- // A USB keyboard types straight into the field: characters as if their keys were pressed here,
- // Backspace deletes and Enter submits. The on-screen keys and the controller work as before.
- useKeyboardInput((input) => {
- if (input.type === "text") for (const character of input.value) onKey(character);
- else if (input.value === "Backspace") onKey("delete");
- else if (input.value === "Enter") onKey("done");
- });
const onAction = (action) => {
if (action === "square") onKey("delete");
else if (action === "triangle" && !url) onKey(" ");
diff --git a/ps5-react/CHANGELOG.md b/ps5-react/CHANGELOG.md
index 42b9f1b..6153ef1 100644
--- a/ps5-react/CHANGELOG.md
+++ b/ps5-react/CHANGELOG.md
@@ -1,13 +1,5 @@
# Changelog
-## Unreleased — USB keyboard
-
-- The PS5 host reads a USB keyboard through libSceKeyboard (input protocol v6): typed characters, on a
- US layout, and the editing keys Backspace, Enter, Escape and Tab, with hold-to-repeat, reach the new
- `useKeyboardInput(handler)` as `{type: 'text' | 'key', value}`. They never move focus. Without a
- keyboard, or if the console refuses one, nothing is sent and the title runs as before; the log says
- which. The desktop host keeps its keys for the controller bindings. Not hardware-tested yet.
-
## Unreleased — comparing upscalers
- `