
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
The Story...
I have a few users asking if there is a way to have caps lock go on and off automatically when they switch between windows. Example: A user is typing an Email using the normal sentence case (CAPS Lock off) and then they switch to AutoCAD and add some MText which, for our firm, should be all caps. For some reason, they need to go back to the Email and want it back in lowercase. I hope that makes sense. When in AutoCAD, all caps, in any other window, lowercase.
Yes, I know you can set MText to be all caps and that's great but what about block attributes, tables, and/or DText which we use from time to time.
Anyway, I decided that a reactor would fit this bill. The vlr-docmanager-reactor to be exact because it has documentToBeActivated and documentToBeDeactivated events. I am also using DOSLib to facilitate the turning on/off of the CAPS Lock key -> (dos_capslock T) [ ON ] (dos_capslock) [ OFF ]. So this appears to be very simple.
When documentToBeActivated is fired, turn CAPS Lock on.
When doucmentToBeDeactivated is fired, turn CAPS Lock off.
Simple right?
Well, it's not working for me.
Here's the code I have. It's saved in a file named ACADAllCaps.lsp which I'm going to either drop in the startup suite or load via acaddoc.lsp or acad.lsp.
(vl-load-com)
(vlr-docmanager-reactor nil '((:vlr-documentToBeActivated . turncapson)))
(vlr-docmanager-reactor nil '((:vlr-documentToBeDeactivated . turncapsoff)))
(defun turncapson (calling-reactor docstatus / )
(dos_capslock t)
(prompt "CAPS Lock should be ON.")
(princ)
)
(defun turncapsoff (calling-reactor docstatus / )
(dos_capslock)
(prompt "CAPS Lock should be OFF.")
(princ)
)
I have the prompt statements in there to let me know if the functions fire and I haven't seen them yet. Oh, and the CAPS Lock light hasn't gone on/off either, so...
I based this off of what I read about reactors from afralisp.com which was very informative.
Please review and let me know what I'm missing. I'm sure it's something really stupid but that is escaping me now.
Thank you in advance for your help.
Mb
Solved! Go to Solution.