[GH-ISSUE #1531] Tilde and grave don't work on linux client with macOS server #1158

Open
opened 2026-05-05 07:32:25 -06:00 by gitea-mirror · 18 comments
Owner

Originally created by @plars on GitHub (Jan 21, 2022).
Original GitHub issue: https://github.com/debauchee/barrier/issues/1531

What happened?

I'm running a setup with macOS 12.1 running barrier 2.4 and Ubuntu Desktop 20.04(its) running barrier 2.4. Things seem to mostly work ok except for tilde (~) and grave (`) don't make it to the client running Linux. They show up fine on the server (macOS) but not on Linux, so the keyboard itself seems to be ok.
I've tried different keyboard layout combinations on both the server and the client (plain US, US international, etc) and no combination of them seems to resolve this.

I also enabled Debug1 logging on the client and found these messages when pressing first the grave then tilde. Log attached.

Version

v2.4.0

Git commit hash (if applicable)

No response

If applicable, where did you install Barrier from?

server: .dmg file from GitHub
client: snap

What OSes are you seeing the problem on? (Check all that apply)

Linux, macOS

What OS versions are you using?

Server: MacOS 12.1
Client: Ubuntu 20.04

Relevant log output

[2022-01-21T10:21:39] DEBUG1: recv key down id=0x0000ef2a, mask=0x0000, button=0x0033
[2022-01-21T10:21:39] DEBUG1: mapKey ef2a (61226) with mask 0000, start state: 2000
[2022-01-21T10:21:39] DEBUG1: key ef2a is not on keyboard
[2022-01-21T10:21:39] DEBUG1: recv key up id=0x00000000, mask=0x0000, button=0x0033
[2022-01-21T10:21:40] DEBUG1: recv key down id=0x0000efe1, mask=0x0001, button=0x0039
[2022-01-21T10:21:40] DEBUG1: mapKey efe1 (61409) with mask 0001, start state: 2000
[2022-01-21T10:21:40] DEBUG1: find best:  2000 0001
[2022-01-21T10:21:40] DEBUG1: best key index 1 of 1 (exact)
[2022-01-21T10:21:40] DEBUG1: found key in group 1
[2022-01-21T10:21:40] DEBUG1: state: 2000,0000,0000
[2022-01-21T10:21:40] DEBUG1: flip: 0000 (2000 vs 0000 in 0000 - 0000)
[2022-01-21T10:21:40] DEBUG1: desired state: 0001 2000,0000,0000
[2022-01-21T10:21:40] DEBUG1: flip: 0000 (2000 vs 0001 in fffe - 6020)
[2022-01-21T10:21:40] DEBUG1: mapped to 032, new state 2001
[2022-01-21T10:21:40] DEBUG1: keystrokes:
[2022-01-21T10:21:40] DEBUG1:   032 (00000000) down
[2022-01-21T10:21:41] DEBUG1: recv key down id=0x0000ef2a, mask=0x0001, button=0x0033
[2022-01-21T10:21:41] DEBUG1: mapKey ef2a (61226) with mask 0001, start state: 2001
[2022-01-21T10:21:41] DEBUG1: key ef2a is not on keyboard
[2022-01-21T10:21:41] DEBUG1: recv key up id=0x00000000, mask=0x0001, button=0x0033
[2022-01-21T10:21:41] DEBUG1: recv key up id=0x0000efe1, mask=0x0000, button=0x0039
[2022-01-21T10:21:41] DEBUG1: new state 2000
[2022-01-21T10:21:41] DEBUG1: keystrokes:
[2022-01-21T10:21:41] DEBUG1:   032 (00000000) up

Any other information

No response

Originally created by @plars on GitHub (Jan 21, 2022). Original GitHub issue: https://github.com/debauchee/barrier/issues/1531 ### What happened? I'm running a setup with macOS 12.1 running barrier 2.4 and Ubuntu Desktop 20.04(its) running barrier 2.4. Things seem to mostly work ok except for tilde (~) and grave (`) don't make it to the client running Linux. They show up fine on the server (macOS) but not on Linux, so the keyboard itself seems to be ok. I've tried different keyboard layout combinations on both the server and the client (plain US, US international, etc) and no combination of them seems to resolve this. I also enabled Debug1 logging on the client and found these messages when pressing first the grave then tilde. Log attached. ### Version v2.4.0 ### Git commit hash (if applicable) _No response_ ### If applicable, where did you install Barrier from? server: .dmg file from GitHub client: snap ### What OSes are you seeing the problem on? (Check all that apply) Linux, macOS ### What OS versions are you using? Server: MacOS 12.1 Client: Ubuntu 20.04 ### Relevant log output ```shell [2022-01-21T10:21:39] DEBUG1: recv key down id=0x0000ef2a, mask=0x0000, button=0x0033 [2022-01-21T10:21:39] DEBUG1: mapKey ef2a (61226) with mask 0000, start state: 2000 [2022-01-21T10:21:39] DEBUG1: key ef2a is not on keyboard [2022-01-21T10:21:39] DEBUG1: recv key up id=0x00000000, mask=0x0000, button=0x0033 [2022-01-21T10:21:40] DEBUG1: recv key down id=0x0000efe1, mask=0x0001, button=0x0039 [2022-01-21T10:21:40] DEBUG1: mapKey efe1 (61409) with mask 0001, start state: 2000 [2022-01-21T10:21:40] DEBUG1: find best: 2000 0001 [2022-01-21T10:21:40] DEBUG1: best key index 1 of 1 (exact) [2022-01-21T10:21:40] DEBUG1: found key in group 1 [2022-01-21T10:21:40] DEBUG1: state: 2000,0000,0000 [2022-01-21T10:21:40] DEBUG1: flip: 0000 (2000 vs 0000 in 0000 - 0000) [2022-01-21T10:21:40] DEBUG1: desired state: 0001 2000,0000,0000 [2022-01-21T10:21:40] DEBUG1: flip: 0000 (2000 vs 0001 in fffe - 6020) [2022-01-21T10:21:40] DEBUG1: mapped to 032, new state 2001 [2022-01-21T10:21:40] DEBUG1: keystrokes: [2022-01-21T10:21:40] DEBUG1: 032 (00000000) down [2022-01-21T10:21:41] DEBUG1: recv key down id=0x0000ef2a, mask=0x0001, button=0x0033 [2022-01-21T10:21:41] DEBUG1: mapKey ef2a (61226) with mask 0001, start state: 2001 [2022-01-21T10:21:41] DEBUG1: key ef2a is not on keyboard [2022-01-21T10:21:41] DEBUG1: recv key up id=0x00000000, mask=0x0001, button=0x0033 [2022-01-21T10:21:41] DEBUG1: recv key up id=0x0000efe1, mask=0x0000, button=0x0039 [2022-01-21T10:21:41] DEBUG1: new state 2000 [2022-01-21T10:21:41] DEBUG1: keystrokes: [2022-01-21T10:21:41] DEBUG1: 032 (00000000) up ``` ### Any other information _No response_
Author
Owner

@Entr04y commented on GitHub (Jan 25, 2022):

I'm also seeing this issue running the server on Big Sur and connecting to another Mac running Big Sur. Server is running version 2.4.0-release-3e0d758b, build date nov. 11, 2021. Client is currently Version 2.3.3-release-3395cca9, build date july 14, 2020. Barrier was installed on both machines via homebrew.

Also reported as issue #1407

workaround alt codes:

alt+126 : ~
alt+96 : `

<!-- gh-comment-id:1021282871 --> @Entr04y commented on GitHub (Jan 25, 2022): I'm also seeing this issue running the server on Big Sur and connecting to another Mac running Big Sur. Server is running version 2.4.0-release-3e0d758b, build date nov. 11, 2021. Client is currently Version 2.3.3-release-3395cca9, build date july 14, 2020. Barrier was installed on both machines via homebrew. Also reported as issue #1407 workaround alt codes: alt+126 : ~ alt+96 : `
Author
Owner

@vladimirlagunov commented on GitHub (Jan 26, 2022):

It starts working properly when I comment the selected line. 7a4c6a25d7/src/lib/platform/OSXKeyState.cpp (L135)

<!-- gh-comment-id:1022467473 --> @vladimirlagunov commented on GitHub (Jan 26, 2022): It starts working properly when I comment the selected line. https://github.com/debauchee/barrier/blob/7a4c6a25d7305c1772149fd9e20db8594565020b/src/lib/platform/OSXKeyState.cpp#L135
Author
Owner

@AdamMomen commented on GitHub (Jan 28, 2022):

@plars are you running it on Mac m1?

<!-- gh-comment-id:1024193494 --> @AdamMomen commented on GitHub (Jan 28, 2022): @plars are you running it on Mac m1?
Author
Owner

@plars commented on GitHub (Jan 28, 2022):

Yes, this is on a m1 mac mini

<!-- gh-comment-id:1024286313 --> @plars commented on GitHub (Jan 28, 2022): Yes, this is on a m1 mac mini
Author
Owner

@Entr04y commented on GitHub (Jan 28, 2022):

In my case both the server and client are 2017 intel macbook pros.

<!-- gh-comment-id:1024290885 --> @Entr04y commented on GitHub (Jan 28, 2022): In my case both the server and client are 2017 intel macbook pros.
Author
Owner

@SamuelMereau commented on GitHub (Jan 30, 2022):

Seeing this issue too with macOS as the server, macOS Monterey 12.1 (Intel Macbook Air) --> Windows 11 Pro 21H2

<!-- gh-comment-id:1025071049 --> @SamuelMereau commented on GitHub (Jan 30, 2022): Seeing this issue too with macOS as the server, macOS Monterey 12.1 (Intel Macbook Air) --> Windows 11 Pro 21H2
Author
Owner

@ignacimo98 commented on GitHub (Feb 3, 2022):

Seeing this issue as well with macOS Big Sur on Intel -> Windows 10

<!-- gh-comment-id:1029452061 --> @ignacimo98 commented on GitHub (Feb 3, 2022): Seeing this issue as well with macOS Big Sur on Intel -> Windows 10
Author
Owner

@eoleumbi commented on GitHub (May 13, 2022):

It starts working properly when I comment the selected line.

7a4c6a25d7/src/lib/platform/OSXKeyState.cpp (L135)

Barrier 2.4.0 with this patch fixes the issue with tilde and grave.
Tested: Linux client with macOS Barrier server (2017 intel MacBook / macOS Monterey).

Thanks! @vladimirlagunov

<!-- gh-comment-id:1125572290 --> @eoleumbi commented on GitHub (May 13, 2022): > It starts working properly when I comment the selected line. > > https://github.com/debauchee/barrier/blob/7a4c6a25d7305c1772149fd9e20db8594565020b/src/lib/platform/OSXKeyState.cpp#L135 Barrier 2.4.0 with this patch fixes the issue with tilde and grave. Tested: Linux client with macOS Barrier server (2017 intel MacBook / macOS Monterey). Thanks! @vladimirlagunov
Author
Owner

@dgentry commented on GitHub (Jul 6, 2022):

Either @vladimirlagunov's PR #1541 or my newer #1711 will fix this. I "released" a binary for m1 Macs running Monterey, downloadable from my fork in the meantime. You'll probably have to codesign it yourself (see the link).

<!-- gh-comment-id:1176866364 --> @dgentry commented on GitHub (Jul 6, 2022): Either @vladimirlagunov's PR #1541 or my newer #1711 will fix this. I "released" a binary for m1 Macs running Monterey, downloadable [from my fork](https://github.com/dgentry/barrier/releases/tag/fix_broken_tilde_and_grave) in the meantime. You'll probably have to codesign it yourself (see the link).
Author
Owner

@jaredl7 commented on GitHub (Oct 16, 2022):

An alternative fix is to create a hotkey for tilde and backtick (grave) as recommended by this comment: https://github.com/debauchee/barrier/issues/1160#issuecomment-1180576043. I had the same issue using a Linux client connecting to a Barrier server running on Monterey. Using hotkeys to send the tilde and backtick keystrokes works flawlessly.

<!-- gh-comment-id:1280030746 --> @jaredl7 commented on GitHub (Oct 16, 2022): An alternative fix is to create a hotkey for tilde and backtick (grave) as recommended by this comment: [https://github.com/debauchee/barrier/issues/1160#issuecomment-1180576043](https://github.com/debauchee/barrier/issues/1160#issuecomment-1180576043 ). I had the same issue using a Linux client connecting to a Barrier server running on Monterey. Using hotkeys to send the tilde and backtick keystrokes works flawlessly.
Author
Owner

@lorrin commented on GitHub (Oct 21, 2022):

I tried using the hotkey work-around. It worked for sending tidle and backtick to other machines, but made it no longer possible to type those characters on the server. :-(

<!-- gh-comment-id:1286298427 --> @lorrin commented on GitHub (Oct 21, 2022): I tried using the hotkey work-around. It worked for sending tidle and backtick to other machines, but made it no longer possible to type those characters on the server. :-(
Author
Owner

@Joshfindit commented on GitHub (Nov 28, 2022):

I write markdown all the time, so backtick is an important key for both server and client.

Intel macOS 12.3 -> Windows

Looking forward to a fix being in the official release!

<!-- gh-comment-id:1329314210 --> @Joshfindit commented on GitHub (Nov 28, 2022): I write markdown all the time, so backtick is an important key for both server and client. Intel macOS 12.3 -> Windows Looking forward to a fix being in the official release!
Author
Owner

@rhstanton commented on GitHub (Jan 13, 2023):

Following up on on the solution proposed by @vladimirlagunov above, I recompiled the code and the fix MOSTLY works (OSX server, Ubuntu client). When I first move to the client, both the quote and tilde work fine. But if I move the mouse back to the server and then back to the client, only the tilde shows, regardless of whether I press shift or not. Thanks!

<!-- gh-comment-id:1381209009 --> @rhstanton commented on GitHub (Jan 13, 2023): Following up on on the solution proposed by @vladimirlagunov above, I recompiled the code and the fix MOSTLY works (OSX server, Ubuntu client). When I first move to the client, both the quote and tilde work fine. But if I move the mouse back to the server and then back to the client, only the tilde shows, regardless of whether I press shift or not. Thanks!
Author
Owner

@jmatsushita commented on GitHub (Mar 19, 2024):

Please note there is a MacOS build with @dgentry's fix available as an Azure pipeline published artifact.

<!-- gh-comment-id:2006916027 --> @jmatsushita commented on GitHub (Mar 19, 2024): Please note there is a MacOS build with @dgentry's fix [available as an Azure pipeline published artifact](https://dev.azure.com/debauchee/Barrier/_build/results?buildId=782&view=artifacts&pathAsName=false&type=publishedArtifacts).
Author
Owner

@mricos commented on GitHub (May 27, 2024):

With Mac running 2.4.0 in server mode I configured my setup with the GUI server config and then saved the config to ~/.config/barrier/barrier.conf

I then added this at the bottom

section: options
keystroke(Shift+grave) = keystroke(tilde)
keystroke(grave) = keystroke(grave)
end

and it works as expected.

<!-- gh-comment-id:2132605177 --> @mricos commented on GitHub (May 27, 2024): With Mac running 2.4.0 in server mode I configured my setup with the GUI server config and then saved the config to ~/.config/barrier/barrier.conf I then added this at the bottom section: options keystroke(Shift+grave) = keystroke(tilde) keystroke(grave) = keystroke(grave) end and it works as expected.
Author
Owner

@forrestjgq commented on GitHub (Jun 25, 2024):

With Mac running 2.4.0 in server mode I configured my setup with the GUI server config and then saved the config to ~/.config/barrier/barrier.conf

I then added this at the bottom

section: options keystroke(Shift+grave) = keystroke(tilde) keystroke(grave) = keystroke(grave) end

and it works as expected.

You are my hero!

<!-- gh-comment-id:2188195506 --> @forrestjgq commented on GitHub (Jun 25, 2024): > With Mac running 2.4.0 in server mode I configured my setup with the GUI server config and then saved the config to ~/.config/barrier/barrier.conf > > I then added this at the bottom > > section: options keystroke(Shift+grave) = keystroke(tilde) keystroke(grave) = keystroke(grave) end > > and it works as expected. You are my hero!
Author
Owner

@forrestjgq commented on GitHub (Jun 25, 2024):

||\

With Mac running 2.4.0 in server mode I configured my setup with the GUI server config and then saved the config to ~/.config/barrier/barrier.conf
I then added this at the bottom
section: options keystroke(Shift+grave) = keystroke(tilde) keystroke(grave) = keystroke(grave) end
and it works as expected.

You are my hero!

@mricos In this way you can not type tilde on macos, so it could not be accepted

<!-- gh-comment-id:2188199409 --> @forrestjgq commented on GitHub (Jun 25, 2024): ||\\ > > With Mac running 2.4.0 in server mode I configured my setup with the GUI server config and then saved the config to ~/.config/barrier/barrier.conf > > I then added this at the bottom > > section: options keystroke(Shift+grave) = keystroke(tilde) keystroke(grave) = keystroke(grave) end > > and it works as expected. > > You are my hero! @mricos In this way you can not type tilde on macos, so it could not be accepted
Author
Owner

@erickmiller commented on GitHub (Jul 9, 2024):

is there still no official solution to this problem?

the hotkeys setup makes the keys no longer work on the mac server! they work on the linux client but then stop working on the mac server... this is a deal breaker. i'm writing code all day long between my mac machine and my linux machine, and this problem literally makes barrier completely un-usable -- it is impossible to code all day long and not be able to type ~ or ` on one of the machines.

also, as an aside, the mac command-key (aka the super/meta key on gnome) has issues when its remapped as the ctrl key using gnome tweaks or any other method, the key remapping is not obeyed on the linux client machine (it works on the regular keyboard plugged into the linux machine but not on the keyboard coming from the mac client).

i've tried everything, literally wasted an entire day trying to solve this problem. i'm hesitant to waste even more time trying to build this fork but am probably going to try that next... an official fix planned for this problem any time soon?

<!-- gh-comment-id:2216282665 --> @erickmiller commented on GitHub (Jul 9, 2024): is there still no official solution to this problem? the hotkeys setup makes the keys no longer work on the mac server! they work on the linux client but then stop working on the mac server... this is a deal breaker. i'm writing code all day long between my mac machine and my linux machine, and this problem literally makes barrier completely un-usable -- it is impossible to code all day long and not be able to type ~ or ` on one of the machines. also, as an aside, the mac command-key (aka the super/meta key on gnome) has issues when its remapped as the ctrl key using gnome tweaks or any other method, the key remapping is not obeyed on the linux client machine (it works on the regular keyboard plugged into the linux machine but not on the keyboard coming from the mac client). i've tried everything, literally wasted an entire day trying to solve this problem. i'm hesitant to waste even more time trying to build this [fork](https://github.com/dgentry/barrier/releases/tag/fix_broken_tilde_and_grave) but am probably going to try that next... an official fix planned for this problem any time soon?
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#1158
No description provided.