On Feb 29, 2004, at 6:30 AM, John wrote:
That's a nice method but i would prefer to activate the CAPS-LOCK and user
write in capitals in my text entry widget
I would prefer you didn't. ;)
The keyboard takes commands from me, not the computer. If a program started monkeying with my control of such a device, it would find my trash can, mighty quick.
I second that. John, for your program it doesn't matter how the string looks like when the user writes it, but only how it looks in your variable, and that's exactly why the uc and lc operators are for. For the user it doesn't matter how the string in your variable looks like but it matters how it looks like on the screen.
To be honest, if I saw that I am suddenly writing all in caps, I would turn the caps-lock off thinking that I accidentally pressed it.
If you somehow manage how to turn the caps-lock on (if it is possible) then you have this problems to solve:
1. What if the user manually turns it off?
2. What if the user copies and pastes a lowercase text?
3. What if the user use shift with caps-lock on and write in lowercase?
4. How do you remember the previous state of caps-lock and restore it as soon as you stop messing with it? (which still would confuse users of course)
The short answer to how to turn caps-lock on is: don't. Use uc.
-- ZSDC
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>