Author Topic: cAPS lOCK & aUTOcad  (Read 10663 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:

t-bear

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #15 on: March 25, 2009, 01:14:35 PM »
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.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: cAPS lOCK & aUTOcad
« Reply #16 on: June 22, 2009, 04:27:38 PM »
CapsMan is located here
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CHulse

  • Swamp Rat
  • Posts: 504
Re: cAPS lOCK & aUTOcad
« Reply #17 on: June 23, 2009, 10:09:28 AM »
Yeah, AutoCAD controlling my OS.  That's what I want  :roll:

I just wonder when Autodesk will come up with it's own OS.... :ugly:
Cary Hulse
Urban Forestry Manager
Wetland Studies and Solutions

Civil 3D 2020 & 2023

sinc

  • Guest
Re: cAPS lOCK & aUTOcad
« Reply #18 on: June 23, 2009, 12:30:26 PM »
I don't think they'd want to do that.  Then they wouldn't be able to blame anything on Microsoft.   :-D

RGUS

  • Newt
  • Posts: 106
Re: cAPS lOCK & aUTOcad
« Reply #19 on: July 15, 2015, 03:58:46 PM »

RGUS

  • Newt
  • Posts: 106
Re: cAPS lOCK & aUTOcad
« Reply #20 on: July 15, 2015, 03:59:07 PM »
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.

Look like they have removed it

dtkell

  • Bull Frog
  • Posts: 217
Re: cAPS lOCK & aUTOcad
« Reply #21 on: July 15, 2015, 05:42:58 PM »
I think this is what you're looking for: http://www.theswamp.org/lilly_pond/keith/CapsMan.exe?nossi=1
Although not sure if it works on current release.
\"What sane person could live in this world and not be crazy?\" -Ursula K. Le Guin

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: cAPS lOCK & aUTOcad
« Reply #22 on: July 15, 2015, 07:41:55 PM »
If so, then another great had bit the dust
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

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: cAPS lOCK & aUTOcad
« Reply #23 on: July 15, 2015, 07:50:29 PM »
It should still work
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

BlackBox

  • King Gator
  • Posts: 3770
Re: cAPS lOCK & aUTOcad
« Reply #24 on: July 16, 2015, 10:51:07 AM »
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.
"How we think determines what we do, and what we do determines what we get."

dtkell

  • Bull Frog
  • Posts: 217
Re: cAPS lOCK & aUTOcad
« Reply #25 on: July 16, 2015, 12:33:51 PM »
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.
That may be what i had in my mind, as it has been some time since I tried it and knew there was some aspect of it that didn't work.
\"What sane person could live in this world and not be crazy?\" -Ursula K. Le Guin