Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 10, 2016, 02:30:05 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: re-map capslock function  (Read 6438 times)

hgondalf

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 15
    • View Profile
    • Donate to Member
re-map capslock function
« on: July 05, 2013, 07:38:42 AM »
I’m a thumb-fingered typist, so I keep hitting capslock by mistake, and sometimes +capslock.  I tried CapShift, but because of the accidental pressing of +capslock, I still get lines of ALL CAPS. I don’t need a beep or popup window. 

What I would like to do is:

  • Map Capslock to Shift. Make it a shift key. When I use the remapping suggestions in the Autohotkey help, pressing and holding Capslock and typing aaaaaa gives me Aaaaa, not AAAAA as I would get by pressing and holding Shift.
     
  • Toggle the capslock function on and off with ^Capslock.

Many thanks...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,435
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: re-map capslock function
« Reply #1 on: July 05, 2013, 07:44:57 AM »
To do pure remapping I can recommend SharpKeys: http://www.donationc...dex.php?topic=9930.0

hgondalf

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 15
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #2 on: July 05, 2013, 08:52:20 AM »
Thanks Mouser.

In another post I found a link for remapkey.exe, which apparently does the same thing as sharpkeys.

The limitation for these programs is that they use a registry tweak to set the function of a single key.  Neither allows one to map shifted keys (e.g., Ctrl+Alt+Windows F1) to a new function.  I’d be dead in the water without autohotkey’s ability to map shift-key functions.

Using remapkey.exe, I mapped Capslock to Shift, and the right whatever-it-is (the list button next to RWin) to Caplock.

I use rwin as the hotkey trigger for for RunAndHide, so that other weird windows key was the last unused key on my keyboard.

But I would still rather use Ctrl-Capslock to toggle the capslock function.


tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,341
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #3 on: July 05, 2013, 09:59:15 AM »
I may well be misunderstanding, (and my grasp of AHK is minimal), but if Caplocks key becomes Shift, wouldnt your second request be the same as asking for Control+Shift to toggle Capslock?
(if so, I wonder would that mess up some Ctrl+Shift+____ hotkeys?)

My solution for the problem is in some obscure Windows dialogue (I think it's languages in Win7) you're allowed to make the Shift key disable Capslock. Provided you start a sentence with a capital using Shift key, Capslock is immediately disabled. CAPSLOCK STILL WORKS SO LONG AS I avoid the shift key - which is very difficult I find :D but I never use it anyways, so fine for me...
Tom

AfterLemon

  • Participant
  • Joined in 2013
  • *
  • Posts: 2
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #4 on: December 10, 2013, 09:50:41 AM »
Probably what you're looking for hgondalf:

*$Capslock::
SetStoreCapslockMode,On
If !GetKeyState("Control","P"){
Send,{Shift down}
KeyWait,CapsLock
Send,{Shift up}
}else If GetKeyState("CapsLock","T")
SetCapsLockState,Off
else SetCapsLockState,On
return

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 72
  • Are you a good witch or a bad witch?
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #5 on: December 26, 2013, 01:47:20 PM »
Probably what you're looking for hgondalf:

*$Capslock::
SetStoreCapslockMode,On
If !GetKeyState("Control","P"){
Send,{Shift down}
KeyWait,CapsLock
Send,{Shift up}
}else If GetKeyState("CapsLock","T")
SetCapsLockState,Off
else SetCapsLockState,On
return

I too remap the Capslock key. This works great, AfterLemon, except for one thing, which i find happens every time i attempt to remap this key on my win7 x64 laptop, that the first press of the remapped key takes windows' focus off the active window for a significant period of time, perhaps as much as 4 seconds, during which any keypresses are eaten. with your script running, i started typing, and kept typing while i held down the capslock key, the next 7 keystrokes were eaten. the point for me to remap the key is so clumsily pressing the wrong key doesn't stop me from continuing to type. can this be fixed?

AfterLemon

  • Participant
  • Joined in 2013
  • *
  • Posts: 2
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #6 on: December 26, 2013, 07:32:27 PM »
I'm not sure if this is something to do with your Windows setup or your Laptop manufacturer's setup. If your laptop is an HP (likely) then you might have to look on their site (or contact them).

The script works perfectly for me.

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,550
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #7 on: December 26, 2013, 07:45:54 PM »

Just a random comment - I just disabled mine. Most of my shifts tend to be pinky on right shift. So I'm happy to have a mis-hit of Caps Lock simply do nothing at all.


IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,143
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #8 on: December 26, 2013, 10:28:43 PM »
As a possible solution to ALL CAPS accidents...
...
Tip - dispatching the CapsLock gremlin with Microsoft's remapkey.exe http://tips4laptopus...ck-gremlin-with.html
It refers to the Microsoft remapkey.exe utility.
...
Other keyboard mapping fixes are useful, but redundant if you use remapkey.exe, which works fine in Windows 2000, Windows XP, Windows Server 2003, Windows Vista, and Win7-64 Home Premium.

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 72
  • Are you a good witch or a bad witch?
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #9 on: December 29, 2013, 01:28:31 AM »
It's a Dell with Intel graphics, and i think the focus goes off the active window for an On-Screen Notifier, a little lock on/off symbol that pops up in the lower right corner of the screen, for both Caps Lock and Num Lock. it stays on for 4 seconds, then vanishes, returning focus to the active window. i'm now searching for a way to turn that infernal thing off, but so far, it's controls have not been anywhere i'd expect it to be.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,290
    • View Profile
    • Miles Ahead Software
    • Donate to Member
Re: re-map capslock function
« Reply #10 on: December 29, 2013, 07:07:12 AM »
I found this suggested fix on this link

Quote
Try This:

Find HKEY_LOCAL_MACHINE\SOFTWARE\Dell Computer Corporation\QuickSet\QuickSetControl and set it to 1 and reboot.

From Dell
http://en.community....ort.../19311373.aspx

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 72
  • Are you a good witch or a bad witch?
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #11 on: December 29, 2013, 05:58:44 PM »
Try This:

Find HKEY_LOCAL_MACHINE\SOFTWARE\Dell Computer Corporation\QuickSet\QuickSetControl and set it to 1 and reboot.

From Dell
http://en.community....3526/t/19311373.aspx

Thanx, Miles, i'll try that. in fact, i disabled Dell's Caps Lock indicator (i think) then turned around and installed Keyboard LEDs that puts a Caps Lock indicator in the tray  ;D  with AfterLemon's remap.

i love that Groucho quote, i use it all the time!
« Last Edit: December 29, 2013, 06:07:08 PM by DyNama »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,290
    • View Profile
    • Miles Ahead Software
    • Donate to Member
Re: re-map capslock function
« Reply #12 on: December 29, 2013, 08:34:17 PM »
Quote
i love that Groucho quote, i use it all the time!

When I was a kid he had a game show, You Bet Your Life. I was too young to appreciate it.  But now and then a cable channel that does the old 50s shows would put that show on for a bit.  I would get a kick out of contestants who really didn't know what Groucho was about.  One guy was a salesman and he mentioned his membership in a country club.  So Groucho does the line.  The guy tries to impress on Groucho that what he said didn't make sense.  So Groucho looks at the audience like "where'd they dig up this guy?" and says something to the effect "I've been using that line for 30 years.  I think I know what's in it."

Needless to say the Wink Martindales of the game show universe can't hold a candle to the first guys like Groucho and Carson.  :)




dr_andus

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 810
    • View Profile
    • Dr Andus's toolbox
    • Donate to Member
Re: re-map capslock function
« Reply #13 on: December 30, 2013, 09:18:20 AM »
Not sure if this is what you're looking for, but I've remapped (well, not me, just adapted from "I can no longer remember where") Capslock to CTRL, and then use ALT+Capslock to activate All Caps, when necessary. So maybe this can be modified to what you're after.

;-----------------------------------------
; ALT+ALL CAPS; ALL CAPS turned to CTRL  |
;-----------------------------------------
!Capslock::Capslock
Capslock::Control

P.S. This is an AutoHotkey script.
« Last Edit: December 30, 2013, 09:33:46 AM by dr_andus »

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 72
  • Are you a good witch or a bad witch?
    • View Profile
    • Donate to Member
Re: re-map capslock function
« Reply #14 on: December 31, 2013, 11:57:30 AM »
Not sure if this is what you're looking for, but I've remapped (well, not me, just adapted from "I can no longer remember where") Capslock to CTRL, and then use ALT+Capslock to activate All Caps, when necessary. So maybe this can be modified to what you're after.

;-----------------------------------------
; ALT+ALL CAPS; ALL CAPS turned to CTRL  |
;-----------------------------------------
!Capslock::Capslock
Capslock::Control

P.S. This is an AutoHotkey script.

Thanx, Dr. I tried that one first myself, but it too was sabotaged by my Dell's on-screen 4-second caps lock status display. Not knowing that is why i was attracted to this thread in the first place. I liked the premises stated by OP hgondalf, making CapsLock key act like a shift key and toggling CapsLock state with Ctrl+CapsLock, and i liked the AHK script by AfterLemon that fullfilled that in his very first post in this forum―Welcome! i'm learning AHK by examining other people's programs so i enjoyed figuring out that script. i especially appreciated MilesAhead's suggestion of a solution to my Dell keyboard dilemma. So your AHK remapping would have been satisfactory if i'd already turned off Dell's display…but then i'd have never read this thread.
 :D