Author Topic: cAPS lOCK & aUTOcad  (Read 10596 times)

0 Members and 1 Guest are viewing this topic.

M-dub

  • Guest
cAPS lOCK & aUTOcad
« on: March 20, 2009, 02:30:44 PM »
Quick question:  Is there a way to turn CAPS LOCK on or off from the command line?
I'm looking for an out-of-the-box solution without having to use any code.

deegeecees

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #1 on: March 20, 2009, 02:39:22 PM »
In case you change your mind about using code...
Do a search for acad.dvb, and copy it to your recognized support directory. Press Alt+F11, and copy paste the following code to the beginning of the ThisDrawing module.

Code: [Select]

Option Explicit
Private Const VK_CAPITAL = &H14

Private Type KeyboardBytes
    kbByte(0 To 255) As Byte
End Type

Private kbArray As KeyboardBytes

Private Declare Function GetKeyState Lib "user32" _
  (ByVal nVirtKey As Long) As Long

Private Declare Function GetKeyboardState Lib "user32" _
  (kbArray As KeyboardBytes) As Long

Private Declare Function SetKeyboardState Lib "user32" _
  (kbArray As KeyboardBytes) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long


Then copy/paste this code to the end of the module.

Code: [Select]

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 If
End Sub

Private 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 If
End Sub


You will never be plagued by the caps monster ever again, unless you so choose to be.

M-dub

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #2 on: March 20, 2009, 02:44:26 PM »
Thanks Deeg... I just wanted to edit a button we have to change selected text to all caps so that the button would also turn caps lock on.  Far from a big deal... more of a curiosity, I guess.
Thanks again.

deegeecees

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #3 on: March 20, 2009, 02:48:36 PM »
I hear ya. I wouldn't know how to do that without using some code.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: cAPS lOCK & aUTOcad
« Reply #4 on: March 20, 2009, 02:56:28 PM »
Is there not a little routine that someone the Swamp cook up a long time ago.  Do a search for CAPsMan EXE.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Maverick®

  • Seagull
  • Posts: 14778
Re: cAPS lOCK & aUTOcad
« Reply #5 on: March 20, 2009, 03:54:35 PM »
You could PM Cmdrduh.  He has a caps lock utility that turns on caps lock depending on the name of the active window (editable).  Might work for ya.

M-dub

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #6 on: March 20, 2009, 03:57:01 PM »
Thanks guys.  99.293% of the time, this isn't a problem, so I'm not going to worry about it.  I just wondered if there was some new variable they had come out with for acad.

Big G

  • Bull Frog
  • Posts: 415
Re: cAPS lOCK & aUTOcad
« Reply #7 on: March 23, 2009, 01:35:35 AM »
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....
I thought i seen the light at the end of the tunnel. But it was just someone with a torch bringing me more work.
"You have to accept that somedays youre the pigeon and  somedays youre the statue"

rhino

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #8 on: March 25, 2009, 12:25:34 PM »
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....


That works for DTEXT as well - Thanks Big G :kewl:

Bob Wahr

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #9 on: March 25, 2009, 12:40:23 PM »
If you don't want to use code, but want a single button that toggles caplock, you might try this.

M-dub

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #10 on: March 25, 2009, 12:47:58 PM »
If you don't want to use code, but want a single button that toggles caplock, you might try this.

Aside from physically picking up the mouse and using it to depress said key, I was looking for a way to turn caps on with a setvar so I could put it in a macro.

Bob Wahr

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #11 on: March 25, 2009, 12:53:32 PM »
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.

M-dub

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #12 on: March 25, 2009, 12:56:50 PM »
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.

Yep, maybe I should put it on the wish list.  :P

Maverick®

  • Seagull
  • Posts: 14778
Re: cAPS lOCK & aUTOcad
« Reply #13 on: March 25, 2009, 01:05:18 PM »
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.

Just another example of The Man keeping you down.

Bob Wahr

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #14 on: March 25, 2009, 01:12:59 PM »
Yeah, AutoCAD controlling my OS.  That's what I want  :roll: