[PR #1583] [CLOSED] Reset the keyboard status after ToUnicodeEx #1816

Closed
opened 2026-05-05 08:02:33 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debauchee/barrier/pull/1583
Author: @pedronavf
Created: 2/26/2022
Status: Closed

Base: masterHead: patch-1


📝 Commits (1)

  • b43a831 Reset the keyboard status after ToUnicodeEx

📊 Changes

1 file changed (+13 additions, -2 deletions)

View changed files

📝 src/lib/platform/MSWindowsKeyState.cpp (+13 -2)

📄 Description

After getting a dead key from ToUnicodeEx, add an additional VK_SPACE to the keyboard state so we reset the dead key flag and subsequent calls with modifiers, like shift, return the right result (-1) instead of 1.

This happened because without reseting the dead key status the new one was attempted to be composed with the old one, which failed and the end result was a single unicode codepoint not marked as a dead key.

This opens the door to potentially use the returned unicode from the second call to ToUnicodeEx as the key character instead of maintaining the getDeadKey function.

This should, hopefully, address issues like https://github.com/debauchee/barrier/issues/1267 or https://github.com/debauchee/barrier/issues/727 https://github.com/debauchee/barrier/issues/1143 or https://github.com/debauchee/barrier/issues/795

I have submitted the same patch to Synergy.

Contributor Checklist:

  • I have created a file in the doc/newsfragments directory IF it is a
    user-visible change (and make sure to read the README.md in that directory)

🔄 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/debauchee/barrier/pull/1583 **Author:** [@pedronavf](https://github.com/pedronavf) **Created:** 2/26/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`b43a831`](https://github.com/debauchee/barrier/commit/b43a831cd7761ce7fe49e8900f4fb3eea7f034ff) Reset the keyboard status after ToUnicodeEx ### 📊 Changes **1 file changed** (+13 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/platform/MSWindowsKeyState.cpp` (+13 -2) </details> ### 📄 Description After getting a dead key from `ToUnicodeEx`, add an additional `VK_SPACE` to the keyboard state so we reset the dead key flag and subsequent calls with modifiers, like shift, return the right result (-1) instead of 1. This happened because without reseting the dead key status the new one was attempted to be composed with the old one, which failed and the end result was a single unicode codepoint not marked as a dead key. This opens the door to potentially use the returned unicode from the second call to `ToUnicodeEx` as the key character instead of maintaining the getDeadKey function. This should, hopefully, address issues like https://github.com/debauchee/barrier/issues/1267 or https://github.com/debauchee/barrier/issues/727 https://github.com/debauchee/barrier/issues/1143 or https://github.com/debauchee/barrier/issues/795 I have submitted the same patch to Synergy. ## Contributor Checklist: * [ ] I have created a file in the `doc/newsfragments` directory *IF* it is a user-visible change (and make sure to read the `README.md` in that directory) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 08:02:33 -06: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: github-starred/barrier#1816
No description provided.