0 Members and 1 Guest are viewing this topic.
Option ExplicitPrivate Const VK_CAPITAL = &H14Private Type KeyboardBytes kbByte(0 To 255) As ByteEnd TypePrivate kbArray As KeyboardBytesPrivate Declare Function GetKeyState Lib "user32" _ (ByVal nVirtKey As Long) As LongPrivate Declare Function GetKeyboardState Lib "user32" _ (kbArray As KeyboardBytes) As LongPrivate Declare Function SetKeyboardState Lib "user32" _ (kbArray As KeyboardBytes) As LongPrivate Declare Function GetForegroundWindow Lib "user32" () As Long
Private Sub AcadDocument_BeginCommand(ByVal CommandName As String) If CommandName = "TEXT" Or CommandName = "DTEXT" Or _ CommandName = "DDEDIT" Or CommandName = "MTEDIT" Or _ CommandName = "ATTEDIT" Or CommandName = "EATTEDIT" Or _ CommandName = "DIMLINEAR" Or CommandName = "QLEADER" Or _ CommandName = "MTEXT" Then 'add any other command names you want caps on for 'be sure to add them to the endcommand section below as well GetKeyboardState kbArray kbArray.kbByte(VK_CAPITAL) = 1 SetKeyboardState kbArray End IfEnd SubPrivate Sub AcadDocument_EndCommand(ByVal CommandName As String) If CommandName = "TEXT" Or CommandName = "DTEXT" Or _ CommandName = "DDEDIT" Or CommandName = "MTEDIT" Or _ CommandName = "ATTEDIT" Or CommandName = "EATTEDIT" Or _ CommandName = "DIMLINEAR" Or CommandName = "QLEADER" Or _ CommandName = "MTEXT" Then GetKeyboardState kbArray kbArray.kbByte(VK_CAPITAL) = 0 SetKeyboardState kbArray End IfEnd Sub
in mtext theres an AutoCAPS and a Change Case from the right-click menu.....so if text is written lowercase CTRL-A, CTRL-SHIFT-U [or -L] depending on upper or lower chars....
If you don't want to use code, but want a single button that toggles caplock, you might try this.
unfortunately, and I know this is hard to believe, cap lock is a system setting, not an autocad one. Without accessing the system, you can't do it.
Yeah, AutoCAD controlling my OS. That's what I want
CapsMan is located here
For those interested, the Caps Manager is at Resource Cad International...http://www.resourcecad.com/ here.It works well for me here when I'm jumping from proggy to proggy. I want caps on in ACAD and off in other programs....this does it automatically.
FWIW - It does still work for AutoCAD applications (2014-2016 here), but needs to be updated for apps outside of ACAD.exe, as capslock stays enabled when switching to Office 2013/O365 Apps, Chrome, etc.