geekhack

geekhack Community => Keyboards => Topic started by: Fragil1ty on Sun, 20 April 2014, 13:47:30

Title: Program or script to change ctrl and caps lock?
Post by: Fragil1ty on Sun, 20 April 2014, 13:47:30
Hey guys,


I've gone ahead and ordered a new keyboard, the Razer Blackwidow tournament edition (stealth) /w the new orange key-switches.


And because I use a noppoo choc mini, I use the switch option which basically makes the caps lock the ctrl key and vice versa.


So I'm just wondering if there is a application or maybe a AHK script that does this?


Thanks.
Title: Re: Program or script to change ctrl and caps lock?
Post by: Daniel Beardsmore on Sun, 20 April 2014, 17:51:30
You're running Windows Vista or higher, I presume?

AHK code is simply this:

Ctrl::CapsLock
CapsLock::Ctrl

(Key swapping in AHK in XP is defective. I can't speak for Vista but it works OK in 7 and 8.)

This won't work for ctrl+alt+delete, and it won't work inside any high integrity processes (including elevated processes) unless you use Task Scheduler to start the script on login with maximum privileges. It will also be ignored by any processes that read the keyboard directly or programs that override global hotkeys.

One solution is to reprogram the keys directly in the Registry.
Title: Re: Program or script to change ctrl and caps lock?
Post by: tuffy on Mon, 21 April 2014, 08:59:35
Microsoft has a ctrl/caps lock swapping program on their site:

http://technet.microsoft.com/en-us/sysinternals/bb897578.aspx

Mac OS X users can swap the two in the keyboard system preferences under "Modifier Keys..."

Linux users can swap them in the keyboard preferences under Gnome, or by using the xmodmap program.
Title: Re: Program or script to change ctrl and caps lock?
Post by: Skull_Angel on Mon, 21 April 2014, 09:53:13
If  you run Windows and are able to/don't have issue with modifying the registry;

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00


Copy the above text to a word document, save the document and rename it from "whatever.txt" to "whatever.REG". When you run the file it will swap Ctrl with Caps Lock. If you want to change back to default simply go to the specified location in the windows registry editor [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] and remove "Scancode Map".

Had to do some digging to find this kind of stuff for myself, but I edited it so that my Caps Lock registered as Shift because I get a bit clumsy with my pinky when gaming (it also makes it easier to hit shift+5/6).
Title: Re: Program or script to change ctrl and caps lock?
Post by: tricheboars on Mon, 21 April 2014, 10:46:49
its **** like this that keeps me using fully programmable hardware as my daily input.  **** everything about caps lock. what a waste of quality finger real estate.  it has no place on any of my boards. **** it isnt even programmed into another layer on my dox. i have and want nothing to do with caps. 
Title: Re: Program or script to change ctrl and caps lock?
Post by: Photekq on Mon, 21 April 2014, 10:48:31
its **** like this that keeps me using fully programmable hardware as my daily input.  **** everything about caps lock. what a waste of quality finger real estate.  it has no place on any of my boards. **** it isnt even programmed into another layer on my dox. i have and want nothing to do with caps.
Some people still love caps.
Title: Re: Program or script to change ctrl and caps lock?
Post by: tricheboars on Mon, 21 April 2014, 10:51:24
its **** like this that keeps me using fully programmable hardware as my daily input.  **** everything about caps lock. what a waste of quality finger real estate.  it has no place on any of my boards. **** it isnt even programmed into another layer on my dox. i have and want nothing to do with caps.
Some people still love caps.

(http://i0.kym-cdn.com/photos/images/newsfeed/000/549/306/165.gif)
Title: Re: Program or script to change ctrl and caps lock?
Post by: Photekq on Mon, 21 April 2014, 10:53:10
Show Image
(http://i0.kym-cdn.com/photos/images/newsfeed/000/549/306/165.gif)

Really... I use caps lock instead of shift for capital letters. I'm not kidding. I know other people do this aswell.
Title: Re: Program or script to change ctrl and caps lock?
Post by: p3lim on Mon, 21 April 2014, 11:09:54
SharpKeys is the tool to remap keys in windows, but since it changes them on a software level (registry), any software that polls hardware events ignores it (like games).

I use it myself to rebind caps to ctrl, tilde to escape and some other small things temporarily until I do a custom keyboard firmware.

Download here: http://www.randyrants.com/2011/12/sharpkeys_35.html
Title: Re: Program or script to change ctrl and caps lock?
Post by: p3lim on Mon, 21 April 2014, 11:12:17
Show Image
(http://i0.kym-cdn.com/photos/images/newsfeed/000/549/306/165.gif)

Really... I use caps lock instead of shift for capital letters. I'm not kidding. I know other people do this aswell.

If you're not doing something really special where you'd need to use uppercase combined with numbers a lot (software license keys come to mind), there is no real benefit to using caps over shift, especially for capitalizing.
Title: Re: Program or script to change ctrl and caps lock?
Post by: Photekq on Mon, 21 April 2014, 11:17:56
If you're not doing something really special where you'd need to use uppercase combined with numbers a lot (software license keys come to mind), there is no real benefit to using caps over shift, especially for capitalizing.
There is not real disadvantage either. I just find caps lock more comfortable.
Title: Re: Program or script to change ctrl and caps lock?
Post by: Frenir on Mon, 21 April 2014, 11:18:38
Show Image
(http://i0.kym-cdn.com/photos/images/newsfeed/000/549/306/165.gif)

Really... I use caps lock instead of shift for capital letters. I'm not kidding. I know other people do this aswell.
Oh god, one of my classmates does this as well it makes me cringe every time I notice it.
Title: Re: Program or script to change ctrl and caps lock?
Post by: tricheboars on Mon, 21 April 2014, 14:04:57
if i had a time machine i would go back to when IBM was designing the Model M keyboard and swap caps and control. then all of us would be happy.  except Photekq apparently, and his disgusting avatar. 

i am the hero we all deserve.
Title: Re: Program or script to change ctrl and caps lock?
Post by: Fragil1ty on Thu, 24 April 2014, 04:58:29
Thanks everyone, this has been a major help and has suffered me from going insane, I don't even know how I managed to use the bottom left ctrl for so long and not switch to this layout sooner.
Thanks! :)