TheSwamp

CAD Forums => CAD General => Topic started by: Andrea on August 10, 2005, 04:47:13 PM

Title: CapsLOCK on ?
Post by: Andrea 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 ??
Title: CapsLOCK on ?
Post by: Keith™ 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
Title: CapsLOCK on ?
Post by: Bob Wahr 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.
Title: CapsLOCK on ?
Post by: JohnK 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.
Title: CapsLOCK on ?
Post by: Berend 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.
Title: CapsLOCK on ?
Post by: Bob Wahr 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
Title: CapsLOCK on ?
Post by: Berend 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?
Title: CapsLOCK on ?
Post by: Kerry 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.
Title: CapsLOCK on ?
Post by: Berend 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.
Title: CapsLOCK on ?
Post by: Berend on August 10, 2005, 06:33:12 PM
Quote from: Bob Wahr
I give you everything


Bank, account number security code?
Title: CapsLOCK on ?
Post by: Keith™ 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 (http://www.theswamp.org/cgi-bin/cvsweb.cgi/) you can post it in this thread (http://www.theswamp.org/phpBB2/viewforum.php?f=11), you can upload it to the lilly pond (http://www.theswamp.org/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 (http://www.theswamp.org/phpBB2/viewforum.php?f=6)
Title: CapsLOCK on ?
Post by: Bob Wahr 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.
Title: CapsLOCK on ?
Post by: JohnK 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.)
Title: CapsLOCK on ?
Post by: JohnK on August 10, 2005, 08:29:25 PM
...hey, why didnt anybody comment on my code?!
Title: CapsLOCK on ?
Post by: Mark on August 10, 2005, 08:35:14 PM
Let's not forget the *new* subversion!!
Title: CapsLOCK on ?
Post by: t-bear on August 10, 2005, 08:58:41 PM
Seven....
You got nice code kidd0!





There....feel better? LOLOL
Title: CapsLOCK on ?
Post by: JohnK on August 10, 2005, 09:04:56 PM
Y3s. I f33l b3tt3r.

get it, i flipped the letters for numbers ...like i fliped the bit on the letter?!? --Bawahahah! ...Oh, I kill me. (Okay, i need to get some sleep; im going nuts.)
Title: CapsLOCK on ?
Post by: Bob Wahr on August 11, 2005, 11:22:41 AM
Sorry se7en, there's something wrong with my eyes.  For some reason I can't see anything between ( and )  WTH?  I thought I typed the word "and."
Title: CapsLOCK on ?
Post by: daron on August 11, 2005, 11:31:32 AM
Quote from: Mark Thomas
Let's not forget the *new* subversion!!
Is subversion ever going to get on the pulldown? How does one find it otherwise?
Title: CapsLOCK on ?
Post by: Mark on August 11, 2005, 01:44:01 PM
Quote from: daron
Is subversion ever going to get on the pulldown?

Depends!!

Quote
How does one find it otherwise?

Good question! I believe most of the active members have already seen the thread.

I was going to write up a nice tutorial on how to use Tortise-Subversion for the Windows users but no one really showed any interest in it so I didn't bother. I believe it would be a great addition to theswamp, IMO it's beats the heck out of the lilly pond. I use it every day for my personal stuff!! It is truly a life saver if you're behind a proxy server that's rather strict like myself.
Title: CapsLOCK on ?
Post by: Kerry on August 11, 2005, 06:31:56 PM
Quote
I was going to write up a nice tutorial on how to use Tortise-Subversion for the Windows users but no one really showed any interest in it so I didn't bother.


Can we make you an offer that you can't refuse ?

kwb
Title: CapsLOCK on ?
Post by: daron on August 12, 2005, 08:02:04 AM
Quote from: Kerry Brown
Quote
I was going to write up a nice tutorial on how to use Tortise-Subversion for the Windows users but no one really showed any interest in it so I didn't bother.


Can we make you an offer that you can't refuse ?

kwb

Make that two people interested. Sorry I didn't sound interested enough earlier. Guess I'm just too patient. I've seen it but had not clue how to load anything in it.
Title: CapsLOCK on ?
Post by: MP on August 12, 2005, 08:44:03 AM
InterestedParties.Add ("MP") ;
Title: CapsLOCK on ?
Post by: Mark on August 12, 2005, 08:51:50 AM
3 interested parties noted.

Maybe this afternoon, we'll see!
Title: CapsLOCK on ?
Post by: David Hall on August 12, 2005, 10:02:41 AM
Me too, Me too!
Title: CapsLOCK on ?
Post by: whdjr on August 12, 2005, 11:40:38 AM
InterestedParties.Add ("whdjr") ;


sorry MP,

the technique was so kool.
Title: CapsLOCK on ?
Post by: Bob Wahr on August 12, 2005, 11:48:35 AM
I'll make it easier for future people

Code: [Select]
Dim intP As Peeps
Dim strMe As Member
Set intP = TheSwamp.InterestedParties
strMe = TheSwamp.CurrentPost.MemberName
intP.Add(strMe)
Title: CapsLOCK on ?
Post by: daron on August 12, 2005, 11:51:35 AM
Now how do I run that, Bob? :lol:
Title: CapsLOCK on ?
Post by: Bob Wahr on August 12, 2005, 11:57:48 AM
I used my forum majic so it's active in this thread. All that is needed now is the intP.Add(strMe) bit.  If there is a widespread need for it on the board I could make it a funtion.  Maybe an Interested class.
Title: CapsLOCK on ?
Post by: daron on August 12, 2005, 12:22:47 PM
:D cool. For some reason, your explanation made your entire piece of code click for me.
Title: CapsLOCK on ?
Post by: MP on August 12, 2005, 01:22:18 PM
Quote from: Bob Wahr
Code: [Select]
Dim intP As Peeps
Dim strMe As Member
Set intP = TheSwamp.InterestedParties
strMe = TheSwamp.CurrentPost.MemberName
intP.Add(strMe)

Eek, too many errors.

If strMe is an object variable it needs to be set (data type Member is not an intrinsic type thus must be a UDC*; if it were a UDT the call would reference an element via dot delineation), so ...

Set strMe = TheSwamp.CurrentPost.MemberName

(even though it appears by inference to be a string type variable).

Also, you cannot invoke code like this:

intP.Add (strMe)

Either

intP.Add strMe

or

Call intP.Add (strMe)

However, since we want the addition of names to be persistant perhaps this would suffice --

With TheSwamp
    Call .Tutorials.Item("Tortoise/Subversion").InterestedParties.Add (.CurrentPost.MemberName)
End With


Forgive me, I'm such a geek I couldn't stop myself (ya I know, I'm a bstrd).

:oops: :oops: :oops:

* UDC = User Defined Class; UDT = User Defined Type
Title: CapsLOCK on ?
Post by: JohnK on August 12, 2005, 02:20:09 PM
^
...Stig, you do realize that you have competition for passing out headaches right?
Title: CapsLOCK on ?
Post by: Mark on August 12, 2005, 03:09:38 PM
Part I
[ http://www.theswamp.org/phpBB2/viewtopic.php?t=6290 ]
Title: CapsLOCK on ?
Post by: Bob Wahr on August 12, 2005, 03:44:59 PM
Oh crap!

I've been geek served.