|P is for Practical|
Unable to capture mouse events in Win32::Consoleby fireblood (Scribe)
|on Apr 25, 2022 at 19:48 UTC||Need Help??|
fireblood has asked for the wisdom of the Perl Monks concerning the following question:
Dear wise ones,
I've been trying to capture mouse events using Win32::Console and after having done an advanced Google search on perlmonks, have not been able to find an answer. My code is the following:
The initial output from the above code is
While this code is running, if I press on any key, I get the following output:
The value of "1" in the first array element indicates that the event type is keyboard input. When mouse input is captured, the first array element should have a value of "2". However, while this program is running, I can click on the console window endlessly and the mouse click is not detected. I end up falling through to the final consolation message after the end of looping.
What am I missing in how I'm setting this up to enable capturing of mouse events?