Keyboard Hook Delay Problem

Keyboard Hook Delay Problem

Anonymous
Not applicable
418 Views
0 Replies
Message 1 of 1

Keyboard Hook Delay Problem

Anonymous
Not applicable
Hi All. Anybody that uses hooks ever had any delay problems like this? => Draw a line, select it with grips on, do a grip stretch on one of the endpoints. As you move it across the screen, you notice a delay or interruption. This happens just as you begin to grip stretch it, only once for each time you do this.

My VBA code for this hook is nothing spectacular, just a different flavor of what others have posted on the web which does pretty much the same thing. It sets a low level keyboard and low level mouse hook after certain commands. The mouse hook sets the OSMODE to 0, the keyboard hook sets the OSMODE to correspond to certain osnaps, for example, vbKeyE for endpoint osnap.

This problem does not manifest itself all the time. It occurs infrequently, and seems to occur only when I rarely use the hook code, as on my home computer. Seems like the problem goes away after I start using the hook code more frequently. I use the same code on my work computer every workday and I do not recall having the same problem, except maybe when I first started using it. Now it works fine on my work computer all the time.

At the time I recently noticed the problem, I recall that my gut feeling was that the setting of the OSNAP variable through VBA while AutoCAD was interpreting my mouse inputs (movement across screen) was the culprit. Unfortunately, now that the problem has gone away and I cannot reproduce it at the moment, I do not have a good frame of reference to at least describe the problem more accurately.

Could this problem be because VBA is not the best way to implement hooks for AutoCAD? Is using ObjectARX via C++ (i.e.- the pretranslate sample) a more sound way to do this? How about a .DLL via VB?
0 Likes
419 Views
0 Replies
Replies (0)