在虚拟框中使用 xdotool 模拟右 CTRL 键

问题描述

我在 Windows 10 中运行 VirtualBox我有一台运行 Raspbian 的虚拟机。

在 Raspbian 虚拟机中,我使用的是 xdotool。

在 Raspbian 中,使用 xdotool,我可以模拟按 Right Ctrl 键,它是我在 VirtualBox 中的主机键,以便我可以更改 VirtualBox 窗口的大小吗?。

我的意思是来自 Raspbian,它是来自 VirtualBox 的虚拟机,我可以执行“Host + A”吗?。 由于主机是正确的 CTRL 键,我尝试了这两件事,但它只在 Raspbian 中执行普通的 ctrl 键。

xdotool key ctrl+a

我试过了

xdotool key 'Control_R'+a

但它在 raspbian 中执行普通的 ctrl+a 并选择文件夹中的所有文件

解决方法

不,您不能在虚拟化环境中执行此操作。您必须从 Raspbian 外部自动执行该操作,使用在 Windows 上本地运行的应用程序,例如 AutoHotKey。非常相似的想法,但脚本的措辞略有不同。

Send,^a

https://www.autohotkey.com/docs/Tutorial.htm#s3