[Solved] CTRL+Fn key combinations not sent to guest

Discussions about using Linux guests in VirtualBox.
Post Reply
Zevel
Posts: 9
Joined: 22. Feb 2021, 19:21
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Xubuntu 20.04

[Solved] CTRL+Fn key combinations not sent to guest

Post by Zevel »

VirtualBox 6.1.18
Host: Windows 10
Guest: Ubuntu 20.04
Guest extensions installed and active

None of the CTRL+Fn key combinations seem to work in any program I tried (Visual Studio Code, LibreOffice, etc.) Nothing gets sent.
Interestingly, CTRL+SHIFT+Fn combinations, as well as the Fn keys by themselves, seem to work fine.

Any suggestions?
Last edited by Zevel on 25. Feb 2021, 17:36, edited 1 time in total.
Zevel
Posts: 9
Joined: 22. Feb 2021, 19:21
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Xubuntu 20.04

Re: CTRL+Fn key combinations not sent to guest

Post by Zevel »

Anyone?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CTRL+Fn key combinations not sent to guest

Post by mpack »

I'm not entirely sure what kind of response you expected there. This is a user self help discussion forum, so unless other users have similar concerns you may not get a quick reply.

But, I just tested your proposition using keyboard testing website https://www.keyboardtester.com/tester.html, using a Windows VM, and I am definitely getting keyboard events when I press Ctrl, Fn, and Ctrl+Fn. Unfortunately I can't think of any apps I have that use Ctrl+Fn keys, so I can't test it fully. However it appears that the virtual "hardware" is working, and so should work for any guest OS.
Zevel
Posts: 9
Joined: 22. Feb 2021, 19:21
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Xubuntu 20.04

Re: CTRL+Fn key combinations not sent to guest

Post by Zevel »

Hi mpack,
Thank you for your reply!
mpack wrote:But, I just tested your proposition using keyboard testing website https://www.keyboardtester.com/tester.html, using a Windows VM, and I am definitely getting keyboard events when I press Ctrl, Fn, and Ctrl+Fn. Unfortunately I can't think of any apps I have that use Ctrl+Fn keys, so I can't test it fully. However it appears that the virtual "hardware" is working, and so should work for any guest OS.
I navigated to the site from the VM and, as expected, it detects Fn keys, CTRL+SHIFT+Fn key combinations, but not CTRL+Fn combinations.
I do not have a Windows VM to test with so I cannot tell if the the virtual hardware is working on my end or it is a guest OS problem.
Can you please suggest how I can test that?

Thank you.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: CTRL+Fn key combinations not sent to guest

Post by fth0 »

Several more things to check:

If the right Ctrl key is configured as your VirtualBox Host key, does your problem occur with the left and the right Ctrl key?

What keyboard and keyboard layout do you use?

In your favorite browser on the host and in the guest, use the Keyboard Event Viewer to see all key down and key up events. When you press the Ctrl key, the computer cannot foresee that you are going to press a F<n > key next. Which events do you see?
Zevel
Posts: 9
Joined: 22. Feb 2021, 19:21
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Xubuntu 20.04

Re: CTRL+Fn key combinations not sent to guest

Post by Zevel »

Hello fth0,
fth0 wrote:Several more things to check:

If the right Ctrl key is configured as your VirtualBox Host key, does your problem occur with the left and the right Ctrl key?
The left one.

fth0 wrote:What keyboard and keyboard layout do you use?
I have two keyboards: the built-in Thinkpad keyboard and a wireless Logitech K800. The problem happens with both.
The keyboard layout on the guest VM is the system default (Generic 105-key PC intl). Changing it to the Generic 104-key PC did not help.
fth0 wrote:In your favorite browser on the host and in the guest, use the Keyboard Event Viewer to see all key down and key up events. When you press the Ctrl key, the computer cannot foresee that you are going to press a F<n > key next. Which events do you see?
On the host:

1-2: CTRL
3-4: F2
5-8: CTRL+F2
9-14: CTRL+SHIFT+F2

Code: Select all

14	keyup	0	17Control	17	NumLock	✗	✗	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''
13	keyup	0	16Shift	16	Control, NumLock	✗	✓	✗	✗	Shift	ShiftLeft	LEFT	✗	✗	-	-	''
12	keyup	0	113	113	Control, Shift, NumLock	✓	✓	✗	✗	F2	F2	0	✗	✗	-	-	''
11	keydown	0	113	113	Control, Shift, NumLock	✓	✓	✗	✗	F2	F2	0	✗	✗	-	-	''
10	keydown	0	16Shift	16	Control, Shift, NumLock	✓	✓	✗	✗	Shift	ShiftLeft	LEFT	✗	✗	-	-	''
9	keydown	0	17Control	17	Control, NumLock	✗	✓	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''

8	keyup	0	113	113	NumLock	✗	✗	✗	✗	F2	F2	0	✗	✗	-	-	''
7	keyup	0	17Control	17	NumLock	✗	✗	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''
6	keydown	0	113	113	Control, NumLock	✗	✓	✗	✗	F2	F2	0	✗	✗	-	-	''
5	keydown	0	17Control	17	Control, NumLock	✗	✓	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''

4	keyup	0	113	113	NumLock	✗	✗	✗	✗	F2	F2	0	✗	✗	-	-	''
3	keydown	0	113	113	NumLock	✗	✗	✗	✗	F2	F2	0	✗	✗	-	-	''

2	keyup	0	17Control	17	NumLock	✗	✗	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''
1	keydown	0	17Control	17	Control, NumLock	✗	✓	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''
On the VM:

1-2: CTRL
3-4: F2
5-6: CTRL+F2 (the F2 is not registered when CTRL is pressed)
7-12: CTRL+SHIFT+F2

Code: Select all

12	keyup	0	17Control	17	NumLock	✗	✗	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''
11	keyup	0	16Shift	16	Control, NumLock	✗	✓	✗	✗	Shift	ShiftLeft	LEFT	✗	✗	-	-	''
10	keyup	0	113	113	Control, Shift, NumLock	✓	✓	✗	✗	F2	F2	0	✗	✗	-	-	''
9	keydown	0	113	113	Control, Shift, NumLock	✓	✓	✗	✗	F2	F2	0	✗	✗	-	-	''
8	keydown	0	16Shift	16	Control, Shift, NumLock	✓	✓	✗	✗	Shift	ShiftLeft	LEFT	✗	✗	-	-	''
7	keydown	0	17Control	17	Control, NumLock	✗	✓	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''

6	keyup	0	17Control	17	NumLock	✗	✗	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''
5	keydown	0	17Control	17	Control, NumLock	✗	✓	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''

4	keyup	0	113	113	NumLock	✗	✗	✗	✗	F2	F2	0	✗	✗	-	-	''
3	keydown	0	113	113	NumLock	✗	✗	✗	✗	F2	F2	0	✗	✗	-	-	''

2	keyup	0	17Control	17	NumLock	✗	✗	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''
1	keydown	0	17Control	17	Control, NumLock	✗	✓	✗	✗	Control	ControlLeft	LEFT	✗	✗	-	-	''
Thank you.
Zevel
Posts: 9
Joined: 22. Feb 2021, 19:21
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Xubuntu 20.04

Re: CTRL+Fn key combinations not sent to guest

Post by Zevel »

Same problem with the "soft keyboard"
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CTRL+Fn key combinations not sent to guest

Post by mpack »

I suspect that you might have some software on your host which is capturing Ctrl+Fn keystrokes before VirtualBox gets them to pass to the VM.

It can't be a guest OS issue. The guest doesn't get to choose what keystrokes are sent to it by VirtualBox. So it doesn't make any difference if the guest is Windows or Linux.

It can't be a VirtualBox issue, or we'd all see the same problem.

It can't be a host OS issue because I believe we're all using the same host OS.

It can't be a keyboard driver issue because the problem happens on different keyboards.

Hence, I'm saying you have some kind of "smart keyboard" app intercepting those keystrokes and replacing them with something that VirtualBox doesn't recognize.
Zevel
Posts: 9
Joined: 22. Feb 2021, 19:21
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Xubuntu 20.04

Re: CTRL+Fn key combinations not sent to guest

Post by Zevel »

Found the answer here.
Wasn't a VBox issue but an XFCE one.

Thank you all for your help.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: [Solved] CTRL+Fn key combinations not sent to guest

Post by fth0 »

Good to know that XFCE uses Ctrl+F<n> to switch between its virtual desktops. Thanks for reporting back.
Zevel
Posts: 9
Joined: 22. Feb 2021, 19:21
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Xubuntu 20.04

Re: CTRL+Fn key combinations not sent to guest

Post by Zevel »

mpack wrote:I suspect that you might have some software on your host which is capturing Ctrl+Fn keystrokes before VirtualBox gets them to pass to the VM.
Actually, it turned out to be the Window Manager of the guest OS capturing the keystrokes.
fth0 wrote:Thanks for reporting back.
Common courtesy :)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CTRL+Fn key combinations not sent to guest

Post by mpack »

Zevel wrote: Actually, it turned out to be the Window Manager of the guest OS capturing the keystrokes.
The logic of my last post was evidently founded on bad data. I took you at your word that the keystrokes were not reaching the guest, a claim that's still embedded in the topic title.
Zevel
Posts: 9
Joined: 22. Feb 2021, 19:21
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Xubuntu 20.04

Re: [Solved] CTRL+Fn key combinations not sent to guest

Post by Zevel »

mpack wrote: The logic of my last post was evidently founded on bad data. I took you at your word that the keystrokes were not reaching the guest
That was my assumption at the time, as those keystrokes were not reaching any application.
Did I make a mistake? Yes, I did. Mea culpa. I apologize for the bad data, but if I was an expert I would not be to asking for assistance here. I only stumbled on the real culprit by chance and made sure to report back.
mpack wrote: a claim that's still embedded in the topic title.
I would change the title but it does not allow me to edit for some reason.
Can you do it? Something like "CTRL+Fn key combinations not reaching guest applications".
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [Solved] CTRL+Fn key combinations not sent to guest

Post by mpack »

I believe the title should remain, it's an important part of understanding the discussion and retconing it now would just confuse matters more.
Post Reply