[Search tip detail and code files using keywords, tip number, author name, etc ]
 
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Control Caps Lock, Num Lock, and Scroll Lock Status
Tip# 3919 By Mathew Kirkland On 17-Jun-2012
0
Rated By 0 users Downloaded : 307
Categories : Programming Examples, LISP Code Modules, Libraries
Software type : AutoCAD 2012
Rename File To : LispKeys/,LispKeys/capslock.htm,LispKeys/LispKeys.dll,LispKeys/LispKeys.txt,LispKeys/numlock.htm,LispKeys/Reactor_CapsLock._ls,LispKeys/Reactor_CapsLock.lsp,LispKeys/scrolllock.htm
Turn on Caps Lock automatically using a reactor.

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.

 

Average Rating:
0


User comments