Asked by:
Mouse Is Down

Question
-
Is there a simple way to check if currently mouse is pressed down?Wednesday, January 9, 2019 9:54 PM
All replies
-
Found it: [System.Windows.Forms.UserControl]::MouseButtonsWednesday, January 9, 2019 10:10 PM
-
No. Use the "MoiseDown: event on the control
#<your control>.add_MouseDown({
#$_ = [System.Windows.Forms.MouseEventArgs]
# $this = sender
# code here
})\_(ツ)_/
- Proposed as answer by LeeSeenLiMicrosoft contingent staff Friday, January 11, 2019 8:24 AM
Wednesday, January 9, 2019 10:23 PM -
Simple? No. But see here for an example of capturing mouse clicks:
I'm assuming you want to capture the mouse only while your console window has the focus?
--- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)
Wednesday, January 9, 2019 10:23 PM -
That captures mouse clicks from the whole system and not just in PowerShell. It also cannot capture a "Left" mouse down until another mose button is clicked.
\_(ツ)_/
Wednesday, January 9, 2019 11:15 PM -
Hi,
Was your issue resolved?
If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
If no, please reply and tell us the current situation in order to provide further help.
Best Regards,
Lee
Just do it.
Tuesday, January 22, 2019 7:38 AM