Powershell - 在 powershell 控制台内捕获鼠标单击事件

Fen*_*yal 6 powershell

我正在尝试使用 Powershell 做一些技巧。我想编写一个脚本,该脚本可以监听 powershell 控制台内的鼠标事件(单击、移动等)。

例如,当我的脚本处于活动状态时,当我在 powershell 控制台内单击鼠标时,控制台可以输出光标的位置。

是否可以?如果可以的话,怎样做?

提前致谢。

小智 1

不确定所有这些将如何拼凑在一起。也许这会有所帮助。

<# Gets the Mouse Position #>
[System.Windows.Forms.Cursor]::Position
Run Code Online (Sandbox Code Playgroud)