Mouse click event

Started by Juergen, October 17, 2014, 04:44:38 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Juergen

I guess there is no way to catch a left or right mouse click event?

Kind regards,

Juergen

prl

#1
No.  You would need a deeper level system (message) hook.  There is code out there for Delphi keyboard and mouse hooks (getting the window's handle of the DesignCAD app), not sure for the Net languages.

But generally speaking AutoHotKey is simpler and already created by someone else.  Great for intercepting keyboard and mouse events. You could have your OLE run a compiled AutoHotKey program  that intercepts what you need.  I've been intercepting the mouse wheel for many years making DesignCAD zoom like AutoCAD and TurboCAD (and all typical CAD programs).  This mouse wheel zooming in/out feature was  finally added in version 23, (think you need to hold down the Ctrl button or something odd) but I still prefer my approach.

Anyway, my 2 Euros.

Lar

Quote from: prl on October 17, 2014, 05:54:58 AM
mouse wheel zooming in/out feature was  finally added in version 23, (think you need to hold down the Ctrl button or something odd)
Just for the record mouse-wheel zooming was around way long before v23 (I may be wrong but I remember a mildly funny incident while doing it around 2004) but you had (and still have) to hold ctrl or start the zoom command first and it only zoomed to the center of the window. What was added in v23 was the zooming in focusing in on the cursor location (by first bringing the cursor location to the center of the window).

Lar

prl

#3
Quote from: Lar on October 17, 2014, 05:23:56 PM
Just for the record mouse-wheel zooming was around way long before v23

Thanks Lar, yes.  It was the center on the cursor location while zooming in/out that was missing before.

Juergen

> Anyway, my 2 Euros.  ;)

Nice approach, I'll get into it.

Thanks,

Juergen

Juergen

Hey Prl, what a found! Thanks for sharing this idea.

QuoteYou could have your OLE run a compiled AutoHotKey program

There is no need to compile a AHK source. There is an AutoHotkey.dll.
Once imported it works like this:

        Dim script = "#n::Run Notepad"
        ahktextdll(script, "", "")
      
That's all.

Next step is to find out how to catch the mouse events and transfer the
results to my program - I have to read a bit  ;D

Thanks again!

Just my two Euro cents  ;)
Juergen

prl

Quote from: Juergen on October 24, 2014, 11:54:48 AM
There is no need to compile a AHK source. There is an AutoHotkey.dll.

Juergen,  Das ist Toll! Eine DLL. Ja natürlich!! Vielen Dank für den Hinweis. 


Translated:  Cool.

Juergen

QuoteJuergen,  Das ist Toll! Eine DLL. Ja natürlich!! Vielen Dank für den Hinweis. 

Prl, what a funny language - and a keyboard with Umlauts -- J_ü_rgen ;)

Be aware to use the Win32w dll - you'll save some time.

Kind regards,
Juergen