Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to turn off "Caps Lock" from Perl script.

Reply
Thread Tools

How to turn off "Caps Lock" from Perl script.

 
 
katera
Guest
Posts: n/a
 
      04-04-2007
How to turn off "Caps Lock" from Perl script.
Tnx.
Katera


 
Reply With Quote
 
 
 
 
Sisyphus
Guest
Posts: n/a
 
      04-04-2007

"katera" <(E-Mail Removed)> wrote in message
news:euvlkg$bh0$(E-Mail Removed)-com.hr...
> How to turn off "Caps Lock" from Perl script.


This is a problem close to my heart. (I only ever hit the "Caps Lock" by
mistake ... well ... to be honest, I have occasionally intentionally turned
"Caps Lock" on when typing in product keys - which always seem to use upper
case alpha chars).

A quick question to the perlmonks CB ascertained that (as far as was known)
there's no perl solution to the problem.

There are, however, bound to be software solutions (depending upon your OS).
On Win32, PowerToy is apparently one such solution.

However, acting on the judicious advice handed out on the perlmonks CB, I've
just taken the hardware solution of prizing off the "Caps Lock" key and
covering the hole with cellotape (to prevent foreign objects such as
dandruff and breadcrumbs from getting into the guts of the keyboard).

It's working really well, so far, and looks like being the permanent
solution to *my* woes wrt "Caps Lock".

Hth.

Cheers,
Rob

 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      04-04-2007
Sisyphus wrote:
> "katera" <(E-Mail Removed)> wrote in message
> news:euvlkg$bh0$(E-Mail Removed)-com.hr...
>> How to turn off "Caps Lock" from Perl script.

>
> This is a problem close to my heart. (I only ever hit the "Caps Lock"
> by mistake ... well ... to be honest, I have occasionally
> intentionally turned "Caps Lock" on when typing in product keys -
> which always seem to use upper case alpha chars).
>
> A quick question to the perlmonks CB ascertained that (as far as was
> known) there's no perl solution to the problem.
>
> There are, however, bound to be software solutions (depending upon
> your OS). On Win32, PowerToy is apparently one such solution.


If you are running Windows:
- Control Panel
- open Keyboard
- open tab Key Settings
- select "Caps Lock" and click "Edit"
- check "Disable the CAPS LOCK key

Works for me on a MS wireless keyboard. Other keyboards that come with other
drivers maybe don't have this option.

Of course this has nothing to do with the original question or Perl any
longer.

jue


 
Reply With Quote
 
Dan Mercer
Guest
Posts: n/a
 
      04-04-2007

"Jürgen Exner" <(E-Mail Removed)> wrote in message news:uKPQh.6181$iw5.5812@trndny06...
: Sisyphus wrote:
: > "katera" <(E-Mail Removed)> wrote in message
: > news:euvlkg$bh0$(E-Mail Removed)-com.hr...
: >> How to turn off "Caps Lock" from Perl script.
: >
: > This is a problem close to my heart. (I only ever hit the "Caps Lock"
: > by mistake ... well ... to be honest, I have occasionally
: > intentionally turned "Caps Lock" on when typing in product keys -
: > which always seem to use upper case alpha chars).
: >
: > A quick question to the perlmonks CB ascertained that (as far as was
: > known) there's no perl solution to the problem.
: >
: > There are, however, bound to be software solutions (depending upon
: > your OS). On Win32, PowerToy is apparently one such solution.
:
: If you are running Windows:
: - Control Panel
: - open Keyboard
: - open tab Key Settings
: - select "Caps Lock" and click "Edit"
: - check "Disable the CAPS LOCK key
:

On Windows ME you can reassign the CAPS LOCK key - I reassign to the
control key. On X11 you can use xmodmap and XKeyCaps is a nifty
GUI front end to xmodmap.

Dan Mercer

: Works for me on a MS wireless keyboard. Other keyboards that come with other
: drivers maybe don't have this option.
:
: Of course this has nothing to do with the original question or Perl any
: longer.
:
: jue
:
:


 
Reply With Quote
 
Uri Guttman
Guest
Posts: n/a
 
      04-04-2007
>>>>> "MD" == Michele Dondi <(E-Mail Removed)> writes:

MD> On Wed, 4 Apr 2007 21:11:05 +1000, "Sisyphus"
MD> <(E-Mail Removed)> wrote:

>> However, acting on the judicious advice handed out on the perlmonks CB, I've
>> just taken the hardware solution of prizing off the "Caps Lock" key and
>> covering the hole with cellotape (to prevent foreign objects such as
>> dandruff and breadcrumbs from getting into the guts of the keyboard).


MD> Actually, judging from similar such discussions, I'm appearently the
MD> only one to use it on purpose, although on a sparse basis. Oh, and
MD> when I do, I *do* happen to forget it on, too, which is the problem
MD> many people see in it. Whatever, I'm not removing it. No way!!

anyone ever heard of xmodmap? easy way to redfine keys so capslock
becomes control like it was before ibm ruined the keyboard. know why
they did that? capslock was a useful key on manual typewriters since you
had to really push hard on shift to lift up the key carriage. when
electric typewriters came out they kept that evn though it wasn't hard
to push shift anymore (especially with the selectric golf ball where
keys were all electronic). so when ibm created the pc they wanted to
keep it just like the office typewriter to ease conversions. well, they
kept capslock but needed a control key so they put that in a lousy
place. now no one in their right mind needs capslock on a computer
(other than spammers or aolers). but it has remained there wasting space
which should rightfully be control. i swap capslock and control when i
can with xmodmap. and i use sun keyboards when i can which are much
better than any pc/mac keyboard and has control and escape where they
belong.

uri

--
Uri Guttman ------ http://www.velocityreviews.com/forums/(E-Mail Removed) -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
 
Reply With Quote
 
Uri Guttman
Guest
Posts: n/a
 
      04-04-2007
>>>>> "MD" == Michele Dondi <(E-Mail Removed)> writes:


MD> No, no one *needs* it. And I understand your, and all those other
MD> people's concerns. But I find it convenient whenever I have to type
MD> more than say three consecutive uppercase letters. For example it
MD> certainly *faster* for me to press caps lock, write "BEGIN" and press
MD> caps lock again than keeping shift pressed and also press the
MD> individual keys corresponding to the letters of "BEGIN". To each
MD> his/her own...

holding shift down for 5 letters is easy enough. also in emacs it is
trivial to change casing of a word or paragraph.

MD> I know I am annoying and you won't answer anyway, but... by any chance
MD> did you remap the shift keys as well?

no. i do use shift for symbols and when writing documentation and code
and other writings. i just don't use it as much when doing email and
usenet. just an old habit.

uri

--
Uri Guttman ------ (E-Mail Removed) -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
 
Reply With Quote
 
Lambik
Guest
Posts: n/a
 
      04-04-2007
"katera" <(E-Mail Removed)> wrote in message
news:euvlkg$bh0$(E-Mail Removed)-com.hr...
> How to turn off "Caps Lock" from Perl script.


No idea how to do it in perl but given your newsreader here is some windows
code (98 and above) to toggle the caps lock key.

#include <stdio.h>
#include <windows.h>

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
INT nCmdShow)
{
INPUT input[2];
ZeroMemory(input, sizeof(input));
input[0].type = input[1].type = INPUT_KEYBOARD;
input[0].ki.wVk = input[1].ki.wVk = VK_CAPITAL;
input[1].ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(2, input, sizeof(INPUT));

return 0;
}


 
Reply With Quote
 
Peter J. Holzer
Guest
Posts: n/a
 
      04-05-2007
On 2007-04-04 16:03, Uri Guttman <(E-Mail Removed)> wrote:
> easy way to redfine keys so capslock becomes control like it was
> before ibm ruined the keyboard. know why they did that? capslock was a
> useful key on manual typewriters since you had to really push hard on
> shift to lift up the key carriage. when electric typewriters came out
> they kept that evn though it wasn't hard to push shift anymore
> (especially with the selectric golf ball where keys were all
> electronic). so when ibm created the pc they wanted to keep it just
> like the office typewriter to ease conversions. well, they kept
> capslock but needed a control key so they put that in a lousy place.


Historically that can't be right. The first IBM keyboards did have the
control key where caps lock is now and caps lock in the lower right
corner[1][2]. The caps-lock key only moved to its current position in
1986. IBM may have considered catering to former typewriter users more
important than catering to existing computer users, but they had to make
a conscious decision to *change* the layout - they didn't just keep
the typewriter layout.

(BTW, the story I heard at that time was that IBM had to change it to
conform to existing standards: The layout for typewriters was
standardized and the keyboards of "text processing systems" had to be
the same as for typewriters, so if they wanted to sell their computers
for that purpose they had to supply conforming keyboards).

hp

[1] http://www.pcguide.com/ref/kb/layout/stdXT83-c.html
[2] http://www.pcguide.com/ref/kb/layout/stdAT84-c.html


--
_ | Peter J. Holzer | Blaming Perl for the inability of programmers
|_|_) | Sysadmin WSR | to write clearly is like blaming English for
| | | (E-Mail Removed) | the circumlocutions of bureaucrats.
__/ | http://www.hjp.at/ | -- Charlton Wilbur in clpm
 
Reply With Quote
 
Uri Guttman
Guest
Posts: n/a
 
      04-05-2007
>>>>> "PJH" == Peter J Holzer <(E-Mail Removed)> writes:

PJH> Historically that can't be right. The first IBM keyboards did have the
PJH> control key where caps lock is now and caps lock in the lower right
PJH> corner[1][2]. The caps-lock key only moved to its current position in
PJH> 1986. IBM may have considered catering to former typewriter users more
PJH> important than catering to existing computer users, but they had to make
PJH> a conscious decision to *change* the layout - they didn't just keep
PJH> the typewriter layout.

PJH> (BTW, the story I heard at that time was that IBM had to change it to
PJH> conform to existing standards: The layout for typewriters was
PJH> standardized and the keyboards of "text processing systems" had to be
PJH> the same as for typewriters, so if they wanted to sell their computers
PJH> for that purpose they had to supply conforming keyboards).

that may be the correct story but it isn't far from what i tell. the
typewriter market did decide to put the almost never needed anymore
capslock in control's spot. as if anyone would care if it really was put
in the lower right corner. you press it once and later again. it doesn't
need to be an easy spot. control is used so much more in computers but
they kowtowed to the marketers who always know best.

uri

--
Uri Guttman ------ (E-Mail Removed) -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
 
Reply With Quote
 
John W. Kennedy
Guest
Posts: n/a
 
      04-09-2007
Peter J. Holzer wrote:
> On 2007-04-04 16:03, Uri Guttman <(E-Mail Removed)> wrote:
>> easy way to redfine keys so capslock becomes control like it was
>> before ibm ruined the keyboard. know why they did that? capslock was a
>> useful key on manual typewriters since you had to really push hard on
>> shift to lift up the key carriage. when electric typewriters came out
>> they kept that evn though it wasn't hard to push shift anymore
>> (especially with the selectric golf ball where keys were all
>> electronic). so when ibm created the pc they wanted to keep it just
>> like the office typewriter to ease conversions. well, they kept
>> capslock but needed a control key so they put that in a lousy place.

>
> Historically that can't be right. The first IBM keyboards did have the
> control key where caps lock is now and caps lock in the lower right
> corner[1][2]. The caps-lock key only moved to its current position in
> 1986. IBM may have considered catering to former typewriter users more
> important than catering to existing computer users, but they had to make
> a conscious decision to *change* the layout - they didn't just keep
> the typewriter layout.
>
> (BTW, the story I heard at that time was that IBM had to change it to
> conform to existing standards: The layout for typewriters was
> standardized and the keyboards of "text processing systems" had to be
> the same as for typewriters, so if they wanted to sell their computers
> for that purpose they had to supply conforming keyboards).


The 3270 series of dumb terminals for mainframes and the 5250 series of
dumb terminals for mid-size systems also had to be considered. (And they
had multiple keyboards, too. The 3270 series had general-purpose,
data-entry, mainframe-operator-console, APL, and text keyboards, not
counting the special 3270-emulation PCs, which had keyboards of their
very own.) IBM was making something like twenty basically different
keyboard layouts for the US alone, and something had to be done.

--
John W. Kennedy
"...if you had to fall in love with someone who was evil, I can see why
it was her."
-- "Alias"
* TagZilla 0.066 * http://tagzilla.mozdev.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Viewstate wont turn off even after setting it to off ! robert112 ASP .Net 1 04-26-2007 01:51 AM
How to give users rights to turn their wireless cards on and off =?Utf-8?B?RGVhbg==?= Wireless Networking 1 10-17-2005 10:04 PM
Turn off notification of connection to wireless network =?Utf-8?B?TWljaGFlbA==?= Wireless Networking 1 04-17-2005 11:51 PM
Possible to turn off flowed text? : : b r i a n : : Firefox 2 12-21-2003 07:53 PM



Advertisments