michbach has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, since two weeks i try to find a perl-module or perl-script to watch mouse events (left click, right click, double click and so on) on the desktop. I want when ever a mouseclick with the left, middle or right button is executed on the desktop or any windows on the desktop. The operating system is Windows. One more time, im not looking for mouseevents on tk windows or objekts. That would not be a problem for me to use the tk-funktions. I want to know if mouse event happens on the desktop (click on the desktop) or any window (not only tk created windows) that is on the desktop. I tried to find some hints with google but could not found anything.. Can anybody help me? It would be very nice! best regards, rommi thanks a lot regards michbach

Replies are listed 'Best First'.
Re: checking mouse events on desktop
by Anonymous Monk on Aug 24, 2008 at 10:57 UTC
    Can anybody help me?

    This is a Windows OS question, so search for it in windows forums, MSDN ... Win32::GuiTest would be for sending mouse/key events

        thanks, i will try Win32-ActAcc but at the moment i have problems to install this module with ppm. If i start ppm and want to install that module there comes a message "PPM::PPD::init: not a PPD and not a file:....". What means that message? Never had such a problem to install modules with ppm before. regards, michbach
      hi thank you for the quick answer. I want to realize it with perl and not with other languages/commands so why should this help me to search for an answer in a windows forum?! I know the Win32::GuiTest module and with this module you have no problems to emulate keyboard or mouse event and control windows and so on. So i was sure there gives a module in perl to find out mouse events like Button is pressed and which one is pressed at the moment. regards, michbach
        I want to realize it with perl and not with other languages/commands so why should this help me to search for an answer in a windows forum?!

        Language makes no difference. The OS is the limiting factor. Once you find what API is required, you can search to see if they're implemented in perl.

        Since it is windows specific you will have to research more regarding windows than perl. Lookup Hook functions in the win32 api reference at MSDN. They will allow you to snoop mouse events system-wide. You can use the Win32::API module for this direct API access.

        You may have a hard time telling which button is pressed because manipulating or querying controls inside another window (that your program does not own) is not permitted.

        You can probably get more help at a windows forum as suggested.