Author Topic: CapsLOCK on ?  (Read 4841 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
CapsLOCK on ?
« on: August 10, 2005, 04:47:13 PM »
Is there any function to use for setting the capslock ?

something like......(dos_capslock t)

from DosLib ??
Keep smile...

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
CapsLOCK on ?
« Reply #1 on: August 10, 2005, 04:54:47 PM »
Not that I am aware, but I have a windows based program that turns capslock on whenever AutoCAD is the topmost window
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

Bob Wahr

  • Guest
CapsLOCK on ?
« Reply #2 on: August 10, 2005, 05:02:14 PM »
I have a acad vba routine that turns it on for text commands and off after the command.

JohnK

  • Administrator
  • Seagull
  • Posts: 10658
CapsLOCK on ?
« Reply #3 on: August 10, 2005, 05:09:40 PM »
Or you could do something like this... (See last few lines for example use.)

Code: [Select]
(defun String->IntList (str / alst cntr)
  ;; Convert a string to a ascii number list of intigers
  ;;
  ;; $ (String->IntList "test")
  ;; $ (116 101 115 116)
  ;;
  ;; Author: John K (Se7en)
  (if (= cntr '()) (setq cntr 1))
  (while (<= cntr (strlen str))
         (setq alst (cons (ascii (substr str cntr 1)) alst)
               cntr (1+ cntr)))
  (reverse alst) )


(defun IntList->String (StrList / strlst)
  ;; Take a list of intigers and return the string.
  ;;
  ;; $ (IntList->String '(116 101 115 116))
  ;; $ "test"
  ;;
  ;; Author: John K (Se7en)
  (cond
    ((eq (type StrList) 'LIST)
     (setq strlst "")
     (mapcar
       '(lambda (x) (setq strlst (strcat strlst (chr x))))  
       strlist)))
  strlst )
;; Capatilize the fist letter of a word.
(setq myintlist (String->IntList "test"))
(IntList->String (append (list (boole 6 (car myintlist) 32)) (cdr myintlist)))
;; ...okay, so this inst really a usefull example, but its fun.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Berend

  • Guest
CapsLOCK on ?
« Reply #4 on: August 10, 2005, 05:36:52 PM »
Quote from: Bob Wahr
I have a acad vba routine that turns it on for text commands and off after the command.


bob could you post the code I like to have a look at it. I'm really intrested in it.

Bob Wahr

  • Guest
CapsLOCK on ?
« Reply #5 on: August 10, 2005, 05:45:15 PM »
I give you everything.
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
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

Berend

  • Guest
CapsLOCK on ?
« Reply #6 on: August 10, 2005, 06:02:26 PM »
Kewl!!!!!!! 8)

I know I just active for a few days but this is stuff for a code archive
with a little bit of commenting....
I don't want to recreate another forum here but what do you think Bob?
should we request a code archive to store  stuff like this?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
CapsLOCK on ?
« Reply #7 on: August 10, 2005, 06:08:52 PM »
http://www.theswamp.org/phpBB2/viewforum.php?f=11

Just make the ThreadTitle descriptive and add some body text to make the search engines job a little easier.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Berend

  • Guest
CapsLOCK on ?
« Reply #8 on: August 10, 2005, 06:29:43 PM »
Quote from: Kerry Brown
http://www.theswamp.org/phpBB2/viewforum.php?f=11

Just make the ThreadTitle descriptive and add some body text to make the search engines job a little easier.



not the same in some respects. it was better organized and far more important, code wouldn't sink.
I´ve learned a lot by looking at the Filefind code at CV Codearchive it introduceud API and collections to me. I´m sure I would not have found it if it was on page 8 of the link you provided.

What do you think about a code archive link like CV had Kerry?
I won´t request it if there´s no support to build it.

Berend

  • Guest
CapsLOCK on ?
« Reply #9 on: August 10, 2005, 06:33:12 PM »
Quote from: Bob Wahr
I give you everything


Bank, account number security code?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
CapsLOCK on ?
« Reply #10 on: August 10, 2005, 07:22:54 PM »
Quote from: Berend
not the same in some respects. it was better organized and far more important, code wouldn't sink.
I´ve learned a lot by looking at the Filefind code at CV Codearchive it introduceud API and collections to me. I´m sure I would not have found it if it was on page 8 of the link you provided.

What do you think about a code archive link like CV had Kerry?
I won´t request it if there´s no support to build it.


While I cannot speak for Mark (site owner) or the other the moderators, I would suspect that a couple of things would likely not ever happen.

a) theswamp.org will not take the same path as other forums
b) theswamp.org does not seek to be "like" any other forum, currently operating or not.

You have an array of tools to use that you can use to do exactly what you want. As far as I know you can archive code in the CVS repository you can post it in this thread, you can upload it to the lilly pond, you can just leave it in the thread where it is ....

At any rate, this is what we have to work with .. like it or not ... you can suggest that a code archive be added in the Suggestion Box Forum
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

Bob Wahr

  • Guest
CapsLOCK on ?
« Reply #11 on: August 10, 2005, 07:30:05 PM »
The east bank.
I was sitting quietly at home that evening.
I was always 88 before I gave softball up.
Blanket usually, occassionally thumb.
Not very well.

JohnK

  • Administrator
  • Seagull
  • Posts: 10658
CapsLOCK on ?
« Reply #12 on: August 10, 2005, 08:27:48 PM »
Keith, you hit the nail right on the head! The CVS is/was intended EXACTLY for that purpose. (Being a "one stop shop" for code and document snips.)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10658
CapsLOCK on ?
« Reply #13 on: August 10, 2005, 08:29:25 PM »
...hey, why didnt anybody comment on my code?!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
CapsLOCK on ?
« Reply #14 on: August 10, 2005, 08:35:14 PM »
Let's not forget the *new* subversion!!
TheSwamp.org  (serving the CAD community since 2003)