http://qs321.pair.com?node_id=11143300


in reply to Re^2: Unable to capture mouse events in Win32::Console
in thread Unable to capture mouse events in Win32::Console

replacing your Mode call with the following works for me.

my $save = $console-> Mode; END { $console-> Mode( $save )}; $console-> Mode(( $save | 0x0010 ) & ~0x0040 ); # +MOUSE, -QUICK_EDIT

Edit. Looks like either ENABLE_INSERT_MODE or ENABLE_EXTENDED_FLAGS are necessary in the mask (i.e. passing 0x30 or 0x90 as argument would work). Without them console continues to behave as if ENABLE_QUICK_EDIT_MODE is still on i.e. mouse selects text.