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

Discussion in 'Perl Misc' started by katera, Apr 4, 2007.

  1. katera

    katera Guest

    How to turn off "Caps Lock" from Perl script.
    Tnx.
    Katera
     
    katera, Apr 4, 2007
    #1
    1. Advertising

  2. katera

    Sisyphus Guest

    "katera" <> wrote in message
    news:euvlkg$bh0$-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
     
    Sisyphus, Apr 4, 2007
    #2
    1. Advertising

  3. OT: How to turn off "Caps Lock" from Perl script.

    Sisyphus wrote:
    > "katera" <> wrote in message
    > news:euvlkg$bh0$-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
     
    Jürgen Exner, Apr 4, 2007
    #3
  4. katera

    Dan Mercer Guest

    "Jürgen Exner" <> wrote in message news:uKPQh.6181$iw5.5812@trndny06...
    : Sisyphus wrote:
    : > "katera" <> wrote in message
    : > news:euvlkg$bh0$-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
    :
    :
     
    Dan Mercer, Apr 4, 2007
    #4
  5. katera

    Uri Guttman Guest

    >>>>> "MD" == Michele Dondi <> writes:

    MD> On Wed, 4 Apr 2007 21:11:05 +1000, "Sisyphus"
    MD> <> 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.stemsystems.com
    --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
    Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
     
    Uri Guttman, Apr 4, 2007
    #5
  6. katera

    Uri Guttman Guest

    >>>>> "MD" == Michele Dondi <> 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 ------ -------- http://www.stemsystems.com
    --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
    Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
     
    Uri Guttman, Apr 4, 2007
    #6
  7. katera

    Lambik Guest

    "katera" <> wrote in message
    news:euvlkg$bh0$-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;
    }
     
    Lambik, Apr 4, 2007
    #7
  8. On 2007-04-04 16:03, Uri Guttman <> 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
    | | | | the circumlocutions of bureaucrats.
    __/ | http://www.hjp.at/ | -- Charlton Wilbur in clpm
     
    Peter J. Holzer, Apr 5, 2007
    #8
  9. katera

    Uri Guttman Guest

    >>>>> "PJH" == Peter J Holzer <> 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 ------ -------- http://www.stemsystems.com
    --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
    Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
     
    Uri Guttman, Apr 5, 2007
    #9
  10. Peter J. Holzer wrote:
    > On 2007-04-04 16:03, Uri Guttman <> 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
     
    John W. Kennedy, Apr 9, 2007
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,861
  2. robert112
    Replies:
    1
    Views:
    474
    Juan T. Llibre
    Apr 26, 2007
  3. N3wCr4Zy

    Caps Lock State on Windows

    N3wCr4Zy, Dec 11, 2009, in forum: Python
    Replies:
    2
    Views:
    1,420
    Gabriel Genellina
    Dec 12, 2009
  4. PJ6
    Replies:
    0
    Views:
    530
  5. Robert

    Determining caps lock state

    Robert, Oct 27, 2005, in forum: Javascript
    Replies:
    17
    Views:
    480
Loading...

Share This Page