Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Auto-case swap in the Chatter Box

by Theo (Priest)
on Jun 20, 2003 at 17:38 UTC ( [id://267664]=monkdiscuss: print w/replies, xml ) Need Help??

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Auto-case swap in the Chatter Box
by tedrek (Pilgrim) on Jun 20, 2003 at 18:39 UTC

    this is obviously a perl problem, you just have to write a little script that take whatever is in the clipboard/primary selection? and lowercases it, then you bind a key, say win+c to run this program. Then you can lowercase any selection any where with a ctrl+c win+c ctrl+v :) and in your specific case, shift+home ctrl+c win+c ctrl+v

    Under windows it should be pretty easy, there was a post just recently about binding a key to a action, and Win32::ClipBoard handles the rest. I'm not quite sure how to go about it in linux but I'm sure there is a module for X somewhere.... hmm this could actually be quite useful... might have to look into it further :)

Re: Auto-case swap in the Chatter Box
by The Mad Hatter (Priest) on Jun 20, 2003 at 17:48 UTC
    IMO, that feature would be somewhat redundant. Any decent editor will provide a way to switch case for you. Just pop into it (or use an already open window), select the line, and switch case.
    an app where it is best to stay in CAPSLOCK
    Like (G)AIM? ; )
      WHY? DO THEY shout THERE?
      Is that like pasting the text into another app, change the case & paste the text back into the CB?
      Would that overwrite the exitsing text?
      Seems like it would be a longer process, esp if I didn't happen to have that editor open already.

      -ted-

        Is that like pasting the text into another app, change the case & paste the text back into the CB?
        It isn't like it, it is it.
        Would that overwrite the exitsing text?
        No (unless you purposely overwrote the text).

        And yes, it might be a (slightly) longer process, but IMO, it isn't worth it to add such a feature to the CB. I suppose I might be biased...I usually have an editor already open to use...

Re: Auto-case swap in the Chatter Box
by artist (Parson) on Jun 20, 2003 at 18:18 UTC
    Make a practice to toggle Caps lock key when you go in and out of the chatterbox. The light indicator should give you the hint. Or modify your other application so that you can continue typing in lowercase and get the effect of uppercase You can also use some sort of macro program for the text.

    Your question brings an interesting point: Now that we just don't read and write lot in the browser, especially in the 'TEXTAREA' if we can integrate the browser with editor (only for the text area) that would be neat.

    Update: Imagine a 'check' button next to 'textarea' which can invoke a javascript which will take your typed text, open a seperate connection to some server, modify the text according your predefined configurable standards and put it back in the text area. Several advantages here, ranging from date,spell check, code check ..etc.. We can integrate with Preview section, so without having to put the load on the server, we can get the functionality desired.

    artist

      I often use Lynx because it does just that: Hit Ctrl-E twice while in a textarea, and lynx will spawn your favourite editor.

      PS: Javascript BAD!

      LAI

      __END__
Re: Auto-case swap in the Chatter Box
by waswas-fng (Curate) on Jun 20, 2003 at 19:44 UTC
    Just imagine how much typing you will save, 2 key strokes to turn caps off before chatting and tun it back on after or

    8 key strokes to have the text changed from upper to lower! ( you suggest: /cs YOUR TEXT /cs I assume spaces are needed pre and post). If we could expand your idea to save us keystrokes in other forms of the monastery that would rock.

    -Waswas
      Of course, that would be the Best Way(tm) to do it, but so often my mind is elsewhere and I don't remember that I'm in capslock.

      Feel free to expand the idea - maybe next, a way to have perl read my mind so I wouldn't even have to type! :)

Re: Auto-case swap in the Chatter Box
by chromatic (Archbishop) on Jun 21, 2003 at 17:33 UTC

    I'd write a bookmarklet to do this. Yeah, you have to have JavaScript enabled, but it's all handled on the client side. This really doesn't seem like a server problem.

      Here's a bookmarklet that does this. You'll probably have to squish it all together on one line..
      javascript:(function(windowOrLayer) { if (!windowOrLayer) { windowOrLayer=window; } for (var f=0;f<document.forms.length;f++) { for(var i=0;i<windowOrLayer.document.forms[f].elements.length;i++) { if (windowOrLayer.document.forms[f].elements[i].name == "true" && windowOrLayer.document.forms[f].elements[i].type == "text") { s=""; for(var c=0; c<windowOrLayer.document.forms[f].elements[i].value.length; c++) { ch=windowOrLayer.document.forms[f].elements[i].value.charAt( +c); if (ch >= 'a' && ch <= 'z') { ch = ch.toUpperCase() } else if (ch >= 'A' && ch <= 'Z') { ch = ch.toLowerCase() }; s = s + ch; } windowOrLayer.document.forms[f].elements[i].value=s; } } } })();
      Update: Fixed error in checking form element name.
Re: Auto-case swap in the Chatter Box
by greenFox (Vicar) on Jun 22, 2003 at 04:04 UTC

        app where it is best to stay in CAPSLOCK

    Your not working in Pick are you? My sympathies! :-)

    Personally I think key-boards should have the caps lock key removed and implemented in the OS with a 3 or 4 key combination to enable it -if you think about it it really is an overhang from mechanical type-writers. That way you can't get it by mistake, I am always hitting the CAPS lock key by mistake :)

    --
    Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Re: Auto-case swap in the Chatter Box
by TomDLux (Vicar) on Jun 20, 2003 at 19:29 UTC

    You mean the entry textarea doesn't have a full Perl interpreter embedded in it?

    --
    TTTATCGGTCGTTATATAGATGTTTGCA

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://267664]
Approved by particle
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-03-28 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found