Author Topic: <Solved>Disabling Caps Lock  (Read 2516 times)

Offline Ray2047

  • Hero Member
  • *****
  • Posts: 1503
<Solved>Disabling Caps Lock
« on: January 07, 2012, 08:43:42 AM »
I have found multiple sites that suggest caps lock can be disabled by
Code: [Select]
xmodmap -e "remove lock = Caps_Lock" but that doesn't work for me. Reassigning the key to Ctrl would work fine for me also. Any suggestions? Using KDE. Thanks in advance.
« Last Edit: January 07, 2012, 04:53:48 PM by Ray2047 »
KDE 64 bit.
CPU: AMD Athlon II X2 250 Processor.
Display:  nVidia C61 [GeForce 7025 / nForce 630a.
Memory: 3Gb

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Disabling Caps Lock
« Reply #1 on: January 07, 2012, 01:49:39 PM »
if it can be of some help, xmodmap manpage report:
Quote
       One of the more irritating differences between keyboards is the location of the Control and Shift Lock keys.  A common use of
       xmodmap is to swap these two keys as follows:
       !
       ! Swap Caps_Lock and Control_L
       !
       remove Lock = Caps_Lock
       remove Control = Control_L
       keysym Control_L = Caps_Lock
       keysym Caps_Lock = Control_L
       add Lock = Caps_Lock
       add Control = Control_L

       This example can be run again to swap the keys back to their previous assignments.

not tested here.  ;)

AS

Offline Ray2047

  • Hero Member
  • *****
  • Posts: 1503
Re: Disabling Caps Lock
« Reply #2 on: January 07, 2012, 02:20:13 PM »
Both "add" and "remove" are coming up Command not found. Was I misunderstanding. Was that to be added to a file? Xmodmap file?
Quote
[roj@localhost ~]$ remove Lock = Caps_Lock
bash: remove: command not found
[roj@localhost ~]$ remove Control = Control_L
bash: remove: command not found
[roj@localhost ~]$ keysym Control_L = Caps_Lock
bash: keysym: command not found
[roj@localhost ~]$ keysym Caps_Lock = Control_L
bash: keysym: command not found
[roj@localhost ~]$ add Lock = Caps_Lock
bash: add: command not found
[roj@localhost ~]$ add Control = Control_L
bash: add: command not found
[roj@localhost ~]$
Same result as root.

As I appreciate the effort but you seem to have run into the same problem when I searched. The solutions don't seem to work on PCLOS

P.S. Dang new keyboard. I have accidentally activated caps lock four times while trying to write this.
« Last Edit: January 07, 2012, 02:29:03 PM by Ray2047 »
KDE 64 bit.
CPU: AMD Athlon II X2 250 Processor.
Display:  nVidia C61 [GeForce 7025 / nForce 630a.
Memory: 3Gb

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Disabling Caps Lock
« Reply #3 on: January 07, 2012, 02:31:48 PM »
sorry, that was a manpage, not a shell script  ;)

that commands as reported from manpage probably should be added to /etc/X11/Xmodmap .... or some other config file ...

you may want to test something like that, from a terminal:
Code: [Select]
xmodmap -e   "remove Control = Caps_Lock"
xmodmap -e   "remove Lock = Control_L"
xmodmap -e   "keysym Caps_Lock = Control_L"
xmodmap -e   "keysym Control_L = Caps_Lock"
xmodmap -e   "add Lock = Caps_Lock"
xmodmap -e   "add Control = Control_L"

on my system it has successfully reassigned the Caps_Lock to Control_L key, but apparently doesn't reassign the Control_L key to Caps_Lock .... to some extent it should work ...

Offline Ray2047

  • Hero Member
  • *****
  • Posts: 1503
Re: Disabling Caps Lock
« Reply #4 on: January 07, 2012, 03:53:49 PM »
Quote
on my system it has successfully reassigned the Caps_Lock to Control_L key, but apparently doesn't reassign the Control_L key to Caps_Lock .... to some extent it should work ...
No, for me it just screws up the keyboard. Both Caps Lock key and Control-L become Caps lock. Really all I want to do is disable caps lock. Making it a Ctrl key was just an acceptable alternative.

I guess next step is to make a copy of /etc/X11/Xmodmap  and see if I can make a change in it.
KDE 64 bit.
CPU: AMD Athlon II X2 250 Processor.
Display:  nVidia C61 [GeForce 7025 / nForce 630a.
Memory: 3Gb

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Disabling Caps Lock
« Reply #5 on: January 07, 2012, 04:06:12 PM »
Will this work?
Add in /etc/X11/Xmodmap clear Lock ...

Offline Ray2047

  • Hero Member
  • *****
  • Posts: 1503
Re: Disabling Caps Lock
« Reply #6 on: January 07, 2012, 04:21:14 PM »
Will this work?
Add in /etc/X11/Xmodmap clear Lock ...

No, doesn't work. neither does remove lock = Caps_Lock or
remove Lock = Caps_Loc  
add Control = Caps_Loc

KDE 64 bit.
CPU: AMD Athlon II X2 250 Processor.
Display:  nVidia C61 [GeForce 7025 / nForce 630a.
Memory: 3Gb

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Disabling Caps Lock
« Reply #7 on: January 07, 2012, 04:22:44 PM »
Same result here... ???
All tips goes on this, but nothing work in PCLinuxOS  ::)

Offline Ray2047

  • Hero Member
  • *****
  • Posts: 1503
Re: Disabling Caps Lock
« Reply #8 on: January 07, 2012, 04:24:58 PM »
Same result here... ???
All tips goes on this, but nothing work in PCLinuxOS  ::)
Then it must be something Tex did.{LOL}
KDE 64 bit.
CPU: AMD Athlon II X2 250 Processor.
Display:  nVidia C61 [GeForce 7025 / nForce 630a.
Memory: 3Gb

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Disabling Caps Lock
« Reply #9 on: January 07, 2012, 04:33:13 PM »
Here comes the trick,
Try this in a terminal
Code: [Select]
xmodmap -pke > Xmodmap-mythen open it this kwrite under /home/<you>/Xmodmap-my
search for keycode  66 = Caps_Lock NoSymbol Caps_Lock
remove only Caps_Lock NoSymbol Caps_Lock
should look keycode  66 =
Save it, and try in terminal
Code: [Select]
xmodmap Xmodmap-my
Here works, and by you?

« Last Edit: January 07, 2012, 04:34:58 PM by Leiche »

Offline Ray2047

  • Hero Member
  • *****
  • Posts: 1503
Re: Disabling Caps Lock
« Reply #10 on: January 07, 2012, 04:51:40 PM »
Bingo! Yes,  Leiche that worked. Thank you very much.

Quote
Here comes the trick,
Try this in a terminal...
KDE 64 bit.
CPU: AMD Athlon II X2 250 Processor.
Display:  nVidia C61 [GeForce 7025 / nForce 630a.
Memory: 3Gb

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Disabling Caps Lock
« Reply #11 on: January 07, 2012, 04:54:06 PM »
Good to hear, that it work...

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: <Solved>Disabling Caps Lock
« Reply #12 on: January 08, 2012, 02:52:40 AM »
to get it work by start up your session, add
Code: [Select]
xmodmap Xmodmap-my &it in a script on your autostart folder.

LXDE users can have it simpler, open lxautostart from lxdecc, or start>More Applications>Configuration>...

Click on Advanced button, OK button, and paste the follow command in the entry line.
Code: [Select]
xmodmap Xmodmap-my &Click on Ok, log out/in that's all  ;)

Offline Ray2047

  • Hero Member
  • *****
  • Posts: 1503
Re: <Solved>Disabling Caps Lock
« Reply #13 on: January 08, 2012, 07:03:28 AM »
to get it work by start up your session, add
Code: [Select]
xmodmap Xmodmap-my &it in a script on your autostart folder.
I may not understand correctly because it doesn't seem to work for me. I pasted
Code: [Select]
xmodmap Xmodmap-my & into a text editor and saved it as CapsLock_Disable.sh. Then I made it executable and added it to Auto start Up in KCC
« Last Edit: January 08, 2012, 07:05:57 AM by Ray2047 »
KDE 64 bit.
CPU: AMD Athlon II X2 250 Processor.
Display:  nVidia C61 [GeForce 7025 / nForce 630a.
Memory: 3Gb

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: <Solved>Disabling Caps Lock
« Reply #14 on: January 08, 2012, 07:11:38 AM »
Quote
Code:

xmodmap Xmodmap-my &

into a text editor and saved it as CapsLock_Disable.sh. Then I made it executable and added it to Auto start Up in KCC

this is, what i mean with

Quote
to get it work by start up your session, add
Code:

xmodmap Xmodmap-my &

it in a script on your autostart folder.

 ;)