iDRY Vacuum Kilns

Don't Shout!

Started by Jeff, December 28, 2008, 05:43:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jeff

TESTINg typing with my cap locks on...
Just call me the midget doctor.
Forestry Forum Founder and Chief Cook and Bottle Washer.

Commercial circle sawmill sawyer in a past life for 25yrs.
Ezekiel 22:30

SwampDonkey

Yeah, earlier I noticed a popup when I started a new sentence with a capital. Too many peops on CAPS mode?
"No amount of belief makes something a fact." James Randi

1 Thessalonians 5:21

2020 Polaris Ranger 570 to forward firewood, Husqvarna 555 XT Pro, Stihl FS560 clearing saw and continuously thinning my ground, on the side. Grow them trees. (((o)))

Jeff

Did you start with a capital using the shift key or with cap lock?  You shouldn't get an alert using shift.
Just call me the midget doctor.
Forestry Forum Founder and Chief Cook and Bottle Washer.

Commercial circle sawmill sawyer in a past life for 25yrs.
Ezekiel 22:30

beenthere

GOING TO TRY THIS (CAPS LOCK ON)


No warning....??
But sounds like a good plan.
south central Wisconsin
It may be that my sole purpose in life is simply to serve as a warning to others

Tom

IT SURE TELLS ME when I do it.  It doesn't always show up on the same number of characters.  I don't know he measures it, but it works.  If you click the OK on the popup, it lets you type in caps anyway.

It worked for me with caps lock and when I pressed the shift key.... both ways

Dave Shepard

Hey, that's cool. 8) Only does it with the Caps lock for me. 8)
Wood-Mizer LT40HDD51-WR Wireless, Kubota L48, Honda Rincon 650, TJ208 G-S, and a 60"LogRite!

sawguy21

old age and treachery will always overcome youth and enthusiasm

Dan_Shade

IT DID IT WITH THE SHIFT KEY THE FIRST TIME I TRIED IT!
Woodmizer LT40HDG25 / Stihl 066 alaskan
lots of dull bands and chains

There's a fine line between turning firewood into beautiful things and beautiful things into firewood.

Dan_Shade

the second time I tried it, it didn't fuss. 

Jeff, can you fix up one of these sorts of things for use on my mother?
Woodmizer LT40HDG25 / Stihl 066 alaskan
lots of dull bands and chains

There's a fine line between turning firewood into beautiful things and beautiful things into firewood.

Warbird

Interesting.  How is this being done?

Jeff

With Javascript you can use what are called event handlers to form an action. You can set events for certain key strokes. For Example the textarea that you type your posts into have several things taking place. The code looks as below.

<textarea class="editor" name="message" rows="12" cols="60" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onkeypress="captureKeys(event, 'It appears that you may be inadvertently typing with ALL CAPS.\n\nPlease check your cap lock key.\n\nWriting in all caps on the Forestry Forum is considered SHOUTING');" onchange="storeCaret(this);" tabindex="2"></textarea>

The new part that is taking care of cap lock warning is the onkeypress event plus an associated javascript. There isnt a way to know if you have the cap lock on, but once you type, using the javascript, the browser sees the input characters as ASCII code and then know what to do if it sees certain strings. If it identifies the ASCII code range that indicates uppercase letters formed using the cap lock, which is different then the code for uppercase letters formed by the shift button, the handler part of the script returns the alert.


The script looks like this:
var count = 0;
var shown = false;

function captureKeys (e, errorMsg) {
    var ev = e ? e : window.event;
    if (!ev) {
      return;
    }
    var targ = ev.target ? ev.target : ev.srcElement;
    // get key pressed
    var which = -1;
    if (ev.which) {
      which = ev.which;
    } else if (ev.keyCode) {
      which = ev.keyCode;
    }

    if (which >= 65 && which <=  90) {
count++;
if (count == 6 && shown == false){
// uppercase
alert(errorMsg);
shown = true;
}
} else {
count = 0;
    };
return;
};





Just call me the midget doctor.
Forestry Forum Founder and Chief Cook and Bottle Washer.

Commercial circle sawmill sawyer in a past life for 25yrs.
Ezekiel 22:30

Jeff

The other events you see within that textarea code are used for inserting things like the smilies by clicking on them, the BBC tags, and inserting the code from the gallery on click, and things of that nature.
Just call me the midget doctor.
Forestry Forum Founder and Chief Cook and Bottle Washer.

Commercial circle sawmill sawyer in a past life for 25yrs.
Ezekiel 22:30

pigman

NOW YOU HAVE ME CONFUSed with all that Greek. I took the caps lock off when it warned me.
Things turn out best for people who make the best of how things turn out.

Jeff

One more thing,  YOUR BROWSER MAY VARY!  :D  These code snippets can be very browser dependent and many times what works in one doesnt work in another. Or worse.
Just call me the midget doctor.
Forestry Forum Founder and Chief Cook and Bottle Washer.

Commercial circle sawmill sawyer in a past life for 25yrs.
Ezekiel 22:30

Warbird

That is pretty cool.  You could do some fairly interesting things with that.

isawlogs


  SO IT MIGHT WORK FOR SOME BUT NOT SO FOR OTHERS , I GUESS I AM ONE OF THOSE THAT IT DONT WORK FOR  :-\ :'( 

  I got a question for you computer gurru ....  Ya know how the pop up for an instant message is supose to pop up when ya get a message ... and open in another window when ya click it ... why dont it do that for me pop up in an another window ... it pops up  TO TELL ME i GOT A MESSAGE ...

   Marvel , challenged at times
Well actually often , but who is keeping track .  :-\
A man does not always grow wise as he grows old , but he always grows old as he grows wise .

   Marcel