This routine seems simple on the surface, but to pull this off correctly takes a fair amount of knowledge and code. The "behind the scenes" part of this routine is provided as a compiled file (.DLL) written in Visual Basic .NET by Mathew Kirkland. The purpose of this file is to report and/or control the status of three AutoCAD keyboard functions: Caps Lock, Num Lock, and Scroll Lock. Mathew has provided the source code also. On its own, it may not seem like much, but co-contributor Tim Spangler has added a few LISP functions that demonstrate the power of controlling these keys. Using Tim's example, any time you create or edit text or a leader, the Caps Lock function is turned on automatically using a reactor. Note: This routine does not work in AutoCAD 2013.
To get started, make sure the LispKeys.dll file is located in a path that is part of your support file search path, that is also a local path (not a network location). Load the LISP file named Reactor_CapsLock.lsp and manually run the function named (Reactor:CapsLock). Be sure to include the parentheses when calling this function. At this point, a reactor is loaded that will detect most text, leader, and editing functions. When you execute one of these, Caps Lock will be enabled, and when the command ends, Caps Lock will be turned off. Keep in mind that this is just one of many things you can do with this code — have fun with this! Thanks to Mathew and Tim. |