Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Unable to capture mouse events in Win32::Console

by fireblood (Scribe)
on Apr 26, 2022 at 04:13 UTC ( #11143298=note: print w/replies, xml ) Need Help??


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

Hi Marshall, thanks for modifying it and testing it with the two different consoles. That looked promising. Also, after writing what I wrote about the sample code and my own code both not working, my next thought was that if the problem appears in two different programs written by two different people, then maybe the problem was in my mouse, and that I should try re-running it using a better/newer mouse. But since you reproduced the same problem on your academic computer that I was having, I'm thinking now that the mouse is not the problem.

But both of us are running Windows 10, and the Win32::Console module has been around for a lot longer than Windows 10 has. I wonder if it's a Windows 10 problem? An Internet search of Win32::Console reveals that other languages have versions of it as well. I wonder if they are encountering problems when running programs written in those other languages on Windows 10 machines? No way to pin that down since this is a Perl forum. I did notice that one discussion about this module on Perl in particular -- http://computer-programming-forum.com/53-perl/1fb16f663d489dbe.htm -- goes back to June of 1902, so maybe it is only a Windows 10 problem. But that date makes me even more impressed with the magnitude of what Larry has accomplished beyond just the brilliant design of Perl.

  • Comment on Re^3: Unable to capture mouse events in Win32::Console

Replies are listed 'Best First'.
Re^4: Unable to capture mouse events in Win32::Console
by Marshall (Canon) on Apr 26, 2022 at 05:13 UTC
    HI fireblood,
    I did spend some hours messing with this. On the surface, it appeared simple. But I found out that it was not. I do kick myself in the behind because at one point, I did get the "2" for mouse instead of "1" for keyboard and then without thinking, changed so many things at once that I am unable to re-create that result. The false "ahh-ha" syndrome! Hey, it happens!

    I am sure that there is a way to make Win32::Console do what you want, I just don't know how. I think this is a case where the documentation is just not very good. However, Perl Tk GUI's work great. There will be more support here for Tk GUI than for low level console stuff. I commented just this day about the Tk TableMatrix object in another thread.

    It could be that this is what is called an "X Y" problem. You are asking how to do X, but what you really need to know is how to do Y. There are various formulations of this situation. Since you are talking about mouse clicks, some more detail about how you envision your interface working would be helpful. there are all kinds of zoomy GUI things like drop down context sensitive things (i.e. right click ala Windows menus) that are possible.

    It could even perhaps be that your code becomes more simple and no polling loop is required.

    Out of curiosity, where does this 16 buttons come from? I've never seen a Windows mouse with more than 3, but perhaps that exists with some sort of special thing for a gaming control?

      The Razer Naga has "up to 19" buttons. I have an older model that "only" has the 1-12 side panel that I've been very happy with past couple of years. Great for arpgs / mmos / mobas where your main inputs are usually mapped to (e.g.) your 1-0 keys (but you can of course remap things arbitrarily in their software).

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

      Hi Marshall, my mouse is a Redragon M990 -- https://www.amazon.com/Redragon-M990-High-Precision-Programmable-Profiles/dp/B0171AOQG0. I got it so that I could program its buttons to echo out passwords when clicked. I do have a password manager (Dashlane) which meets most of my needs, but the extra edge that the mouse provides is being able to click on a button to type out my login password into a login screen which is encountered prior to being logged on to where Dashlane can then take over. Also, the passwords are stored in the mouse itself, so if I go to a place where I must use a different computer on which my Dashlane profile is not available, as long as I plug my mouse into that computer I can navigate to my usual online locations and then click on the mouse buttons to enter my passwords.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11143298]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2022-12-01 16:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?