Not
Åtkomst till denna sida kräver auktorisation. Du kan prova att logga in eller byta katalog.
Åtkomst till denna sida kräver auktorisation. Du kan prova att byta katalog.
Continuing in my series on Hyper-V automation; as well as being able to get the position of the mouse cursor in the virtual machine - you can also check the mouse button state.
$VMName = "Windows 10 Enterprise"
$VMCS = Get-WmiObject -Namespace root\virtualization\v2 -Class Msvm_ComputerSystem -Filter "ElementName='$($VMName)'"
$mouse = $VMCS.GetRelated("Msvm_SyntheticMouse")
$mouse.GetButtonState(1).IsDown
$mouse.GetButtonState(2).IsDown
This PowerShell code returns information about whether the first or second mouse button is currently down or not.
Cheers,
Ben