[PR #21] [MERGED] Input updates and horizontal scrolling #335

Closed
opened 2026-10-15 12:59:49 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/wolf/pull/21
Author: @zb140
Created: 2/19/2023
Status: ✅ Merged
Merged: 2/22/2023
Merged by: @zb140

Base: stable ← Head: zb/horiz-scroll


📝 Commits (6)

  • 3bd7555 input cleanup and horizontal scrolling
  • c290d09 missed the version number change in tests
  • e4935c3 fix indentation
  • ac0efd7 feat: added paste support
  • 639ce89 fix: proper UTF-8 to UTF-32 conversion, fixed tests
  • 712da0a fix: docker build

📊 Changes

12 files changed (+566 additions, -221 deletions)

View changed files

📝 .github/workflows/linux-build-test.yml (+1 -1)
📝 Dockerfile (+1 -1)
📝 docs/modules/protocols/pages/control-specs.adoc (+3 -1)
📝 docs/modules/protocols/pages/input-data.adoc (+273 -121)
📝 docs/modules/user/pages/quickstart.adoc (+1 -1)
📝 src/input/CMakeLists.txt (+6 -0)
📝 src/input/input/input.hpp (+37 -41)
📝 src/input/platforms/linux/uinput.cpp (+131 -42)
📝 src/input/platforms/linux/uinput.hpp (+6 -2)
📝 src/moonlight/moonlight/protocol.hpp (+2 -2)
📝 tests/platforms/linux/input.cpp (+104 -8)
📝 tests/testMoonlight.cpp (+1 -1)

📄 Description

The changes in this PR are analogous to these from Sunshine, which were a huge help in understanding how this stuff works 😄:

Previously, input packets were actually being distinguished based on packet size rather than the actual packet type fields. This worked reasonably well because nearly all packets had distinct sizes, with the notable exception of keyboard input and mouse scrolling. This PR switches to using the correct type field instead.

In addition, there's are two new packet types: MOUSE_HSCROLL_PACKET for horizontal scrollwheel events, and UTF8_TEXT_PACKET for text events. Horizontal scroll events are fully implemented and tested, but UTF-8 text events currently only log a warning.

Moonlight sends UTF-8 text events when it receives pasted text. On Windows, this is straightforward to implement because there is a SendInput API that can take Unicode text; unfortunately on Linux, there is no such API. Instead, we'd have to "manually" convert the text to a series of key events -- I'm leaving that as an exercise for the future 😁


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/wolf/pull/21 **Author:** [@zb140](https://github.com/zb140) **Created:** 2/19/2023 **Status:** ✅ Merged **Merged:** 2/22/2023 **Merged by:** [@zb140](https://github.com/zb140) **Base:** `stable` ← **Head:** `zb/horiz-scroll` --- ### 📝 Commits (6) - [`3bd7555`](https://github.com/games-on-whales/wolf/commit/3bd75552ba282b66f10f8b64cbc63bb1fea581eb) input cleanup and horizontal scrolling - [`c290d09`](https://github.com/games-on-whales/wolf/commit/c290d09d0ef58f0348764f48b6db8a1ae0ec8828) missed the version number change in tests - [`e4935c3`](https://github.com/games-on-whales/wolf/commit/e4935c3b70f79c733c0431d684c3687c6ff3e764) fix indentation - [`ac0efd7`](https://github.com/games-on-whales/wolf/commit/ac0efd788069f6a8ac6da4857bc540be0e085615) feat: added paste support - [`639ce89`](https://github.com/games-on-whales/wolf/commit/639ce89ca96d29a6fe09e79bcc9755adba7c2d1d) fix: proper UTF-8 to UTF-32 conversion, fixed tests - [`712da0a`](https://github.com/games-on-whales/wolf/commit/712da0a4adb32e1d476707f492bd824fbbdab0ba) fix: docker build ### 📊 Changes **12 files changed** (+566 additions, -221 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/linux-build-test.yml` (+1 -1) 📝 `Dockerfile` (+1 -1) 📝 `docs/modules/protocols/pages/control-specs.adoc` (+3 -1) 📝 `docs/modules/protocols/pages/input-data.adoc` (+273 -121) 📝 `docs/modules/user/pages/quickstart.adoc` (+1 -1) 📝 `src/input/CMakeLists.txt` (+6 -0) 📝 `src/input/input/input.hpp` (+37 -41) 📝 `src/input/platforms/linux/uinput.cpp` (+131 -42) 📝 `src/input/platforms/linux/uinput.hpp` (+6 -2) 📝 `src/moonlight/moonlight/protocol.hpp` (+2 -2) 📝 `tests/platforms/linux/input.cpp` (+104 -8) 📝 `tests/testMoonlight.cpp` (+1 -1) </details> ### 📄 Description The changes in this PR are analogous to these from Sunshine, which were a _huge_ help in understanding how this stuff works 😄: - https://github.com/LizardByte/Sunshine/pull/511 - https://github.com/LizardByte/Sunshine/pull/793 Previously, input packets were actually being distinguished based on packet size rather than the actual packet type fields. This worked reasonably well because nearly all packets had distinct sizes, with the notable exception of keyboard input and mouse scrolling. This PR switches to using the correct type field instead. In addition, there's are two new packet types: `MOUSE_HSCROLL_PACKET` for horizontal scrollwheel events, and `UTF8_TEXT_PACKET` for text events. Horizontal scroll events are fully implemented and tested, but UTF-8 text events currently only log a warning. Moonlight sends UTF-8 text events when it receives pasted text. On Windows, this is straightforward to implement because there is a `SendInput` API that can take Unicode text; unfortunately on Linux, there is no such API. Instead, we'd have to "manually" convert the text to a series of key events -- I'm leaving that as an exercise for the future :grin: --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:59:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/wolf#335
No description provided.