Null key and g spontaneously sent when headphones are connected #680

Closed
opened 2026-01-30 21:59:20 +00:00 by claunia · 8 comments
Owner

Originally created by @odedp on GitHub (May 7, 2019).

  • Your Windows build number: Microsoft Windows [Version 10.0.17763.475]

  • What you're doing and what's happening: I installed WSL and Ubuntu 18.04 from Microsoft store. When I use the terminal, sometimes things seem very strange. I eventually traced it to null keys being spontaneously sent. If I just open the Ubuntu shell and run showkey -a, it seems that every second or two a null key is sent. After a few seconds I get:

<user>@<hostname>:~$ showkey -a

Press any keys - Ctrl-D will terminate this program

^@        0 0000 0x00
^@        0 0000 0x00
^@        0 0000 0x00
^@        0 0000 0x00
^@        0 0000 0x00

Moreover, when I run an X server (I use VcXsrv) it seems the spontaneous keys are g and not the null key. If I open xterm and then run showkey -a, after a few seconds I get this:

<user>@<hostname>:~$ showkey -a

Press any keys - Ctrl-D will terminate this program

g       103 0147 0x67
g       103 0147 0x67
g       103 0147 0x67
g       103 0147 0x67
g       103 0147 0x67

This seems somewhat similar to #215, but I am not pressing any key (i.e., not the shift key), and I also do not have a touch keyboard. I'm running on a ThinkPad X1 Carbon 6th laptop. It does not have a touch screen.

  • What's wrong / what should be happening instead: See above.
Originally created by @odedp on GitHub (May 7, 2019). * Your Windows build number: Microsoft Windows [Version 10.0.17763.475] * What you're doing and what's happening: I installed WSL and Ubuntu 18.04 from Microsoft store. When I use the terminal, sometimes things seem very strange. I eventually traced it to null keys being spontaneously sent. If I just open the Ubuntu shell and run `showkey -a`, it seems that every second or two a null key is sent. After a few seconds I get: ``` <user>@<hostname>:~$ showkey -a Press any keys - Ctrl-D will terminate this program ^@ 0 0000 0x00 ^@ 0 0000 0x00 ^@ 0 0000 0x00 ^@ 0 0000 0x00 ^@ 0 0000 0x00 ``` Moreover, when I run an X server (I use VcXsrv) it seems the spontaneous keys are `g` and not the null key. If I open `xterm` and then run `showkey -a`, after a few seconds I get this: ``` <user>@<hostname>:~$ showkey -a Press any keys - Ctrl-D will terminate this program g 103 0147 0x67 g 103 0147 0x67 g 103 0147 0x67 g 103 0147 0x67 g 103 0147 0x67 ``` This seems somewhat similar to #215, but I am not pressing any key (i.e., not the shift key), and I also do not have a touch keyboard. I'm running on a ThinkPad X1 Carbon 6th laptop. It does not have a touch screen. * What's wrong / what should be happening instead: See above.
Author
Owner

@odedp commented on GitHub (May 7, 2019):

After further experimentation, it seems that the issue only arises if the headphones are connected. I tried this with two different sets of wired headphones (connected to the 3.5mm jack), and also with Bluetooth headphones, and it happened in all three cases. With the headphones --- null key every second or two, without headphones --- no null keys for a few minutes.

@odedp commented on GitHub (May 7, 2019): After further experimentation, it seems that the issue only arises if the headphones are connected. I tried this with two different sets of wired headphones (connected to the 3.5mm jack), and also with Bluetooth headphones, and it happened in all three cases. With the headphones --- null key every second or two, without headphones --- no null keys for a few minutes.
Author
Owner

@zadjii-msft commented on GitHub (May 7, 2019):

Well this is totally insane. I've never seen a set of headphones that'll spontaneously send keystrokes like that.

Unfortunately I don't really have a way of repro'ing this, so I'm not sure there's much else we can do.

Perhaps you could build openconsole.exe from source (now that we're opensource) and get a debugger attached to it. all the keystrokes go through HandleGenericKeyEvent, so maybe that would help.

@zadjii-msft commented on GitHub (May 7, 2019): Well this is totally insane. I've never seen a set of headphones that'll spontaneously send keystrokes like that. Unfortunately I don't really have a way of repro'ing this, so I'm not sure there's much else we can do. Perhaps you could build openconsole.exe from source (now that we're opensource) and get a debugger attached to it. all the keystrokes go through `HandleGenericKeyEvent`, so maybe that would help.
Author
Owner

@odedp commented on GitHub (May 7, 2019):

I'm happy to try, could you send me a pointer to instructions on how to do that?

It's really weird. But it happened with 3 different types of headphones (both wired and Bluetooth), so it may be something more systematic.

@odedp commented on GitHub (May 7, 2019): I'm happy to try, could you send me a pointer to instructions on how to do that? It's really weird. But it happened with 3 different types of headphones (both wired and Bluetooth), so it may be something more systematic.
Author
Owner

@zadjii-msft commented on GitHub (May 8, 2019):

Sure, there's an enormous amount of resources in #489.

Basically, clone the repo, make sure to init git submodules, then open it up in VS. The project that builds openconsole.exe is Host.EXE, so if you launch that from VS, you'll have an openconsole (conhost) with a debugger attached.

@zadjii-msft commented on GitHub (May 8, 2019): Sure, there's an enormous amount of resources in #489. Basically, clone the repo, make sure to init git submodules, then open it up in VS. The project that builds openconsole.exe is `Host.EXE`, so if you launch that from VS, you'll have an openconsole (conhost) with a debugger attached.
Author
Owner

@martinmasse commented on GitHub (Jul 29, 2019):

I was searching for a solution to this problem and found this issue.

This is not related to Microsoft Terminal.

I also have a Thinkpad Carbon X1 6th Gen and this problem is present in all apps when connected to a RDP session. I open notepad or VS and the letter 'g' is added every few seconds.

Very annoying

@martinmasse commented on GitHub (Jul 29, 2019): I was searching for a solution to this problem and found this issue. This is not related to Microsoft Terminal. I also have a Thinkpad Carbon X1 6th Gen and this problem is present in all apps when connected to a RDP session. I open notepad or VS and the letter 'g' is added every few seconds. Very annoying
Author
Owner

@zadjii-msft commented on GitHub (Nov 22, 2021):

@odedp Is this still happening for you? If it is, could you try getting a debug tap trace of this happening? Might help identify the keys they're sending.

I also have a Thinkpad Carbon X1 6th Gen and this problem is present in all apps when connected to a RDP session. I open notepad or VS and the letter 'g' is added every few seconds.

That's certainly a helpful data point here, for what is a wild bug report 😄

@zadjii-msft commented on GitHub (Nov 22, 2021): @odedp Is this still happening for you? If it is, could you try getting a [debug tap trace](https://github.com/microsoft/terminal/wiki/Enabling-the-debug-tap) of this happening? Might help identify the keys they're sending. > I also have a Thinkpad Carbon X1 6th Gen and this problem is present in all apps when connected to a RDP session. I open notepad or VS and the letter 'g' is added every few seconds. That's certainly a helpful data point here, for what is a _wild_ bug report 😄
Author
Owner

@odedp commented on GitHub (Nov 22, 2021):

I haven't encountered this in a while (at least 6 months), so I assumed some update fixed it

@odedp commented on GitHub (Nov 22, 2021): I haven't encountered this in a while (at least 6 months), so I assumed some update fixed it
Author
Owner

@zadjii-msft commented on GitHub (Nov 22, 2021):

Well, that's good to hear! Thanks for confirming!

@zadjii-msft commented on GitHub (Nov 22, 2021): Well, that's good to hear! Thanks for confirming!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#680