all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How can I make my caps lock key act like a control key?
@ 2008-07-15 16:09 emacs615
  2008-07-16  6:40 ` Csányi Pál
  0 siblings, 1 reply; 10+ messages in thread
From: emacs615 @ 2008-07-15 16:09 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi,
I am having trouble mapping my caps lock key to control key in my linux
shell(NOT X). I want both the control and caps lock keys to act like control
keys.  I've tried using loadkeys and I'm not getting errors, but I can't get
it to work.  I've used dumpkeys to get a keymap, edited the map to where
both the caps lock and control keys have the same key code (58 i think).  I
then load this map with loadkeys and there are no errors but nothing
happens.  I tried opening a new shell just in case and still no changes have
occurred.
Help on this issue would be appreciated.
Thanks,
-- 
View this message in context: http://www.nabble.com/How-can-I-make-my-caps-lock-key-act-like-a-control-key--tp18469011p18469011.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How can I make my caps lock key act like a control key?
       [not found] <mailman.14818.1216178279.18990.help-gnu-emacs@gnu.org>
@ 2008-07-16  3:40 ` Chris F.A. Johnson
  2008-07-16  6:26 ` Pascal J. Bourguignon
  1 sibling, 0 replies; 10+ messages in thread
From: Chris F.A. Johnson @ 2008-07-16  3:40 UTC (permalink / raw)
  To: help-gnu-emacs

On 2008-07-15, emacs615 wrote:
>
> Hi,
> I am having trouble mapping my caps lock key to control key in my linux
> shell(NOT X). I want both the control and caps lock keys to act like control
> keys.  I've tried using loadkeys and I'm not getting errors, but I can't get
> it to work.  I've used dumpkeys to get a keymap, edited the map to where
> both the caps lock and control keys have the same key code (58 i think).  I
> then load this map with loadkeys and there are no errors but nothing
> happens.  I tried opening a new shell just in case and still no changes have
> occurred.

$ cat ~/.xmodmaprc 

remove Lock = Caps_Lock
keysym Caps_Lock = Escape
keysym Caps_Lock = Control_L
add Control = Control_L

$ xmodmap ~/.xmodmaprc

-- 
   Chris F.A. Johnson, webmaster         <http://Woodbine-Gerrard.com>
   ===================================================================
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How can I make my caps lock key act like a control key?
       [not found] <mailman.14818.1216178279.18990.help-gnu-emacs@gnu.org>
  2008-07-16  3:40 ` How can I make my caps lock key act like a control key? Chris F.A. Johnson
@ 2008-07-16  6:26 ` Pascal J. Bourguignon
  2008-07-16 14:27   ` emacs615
  1 sibling, 1 reply; 10+ messages in thread
From: Pascal J. Bourguignon @ 2008-07-16  6:26 UTC (permalink / raw)
  To: help-gnu-emacs

emacs615 <benjaminbondtate@gmail.com> writes:

> Hi,
> I am having trouble mapping my caps lock key to control key in my linux
> shell(NOT X). I want both the control and caps lock keys to act like control
> keys.  I've tried using loadkeys and I'm not getting errors, but I can't get
> it to work.  I've used dumpkeys to get a keymap, edited the map to where
> both the caps lock and control keys have the same key code (58 i think).  I
> then load this map with loadkeys and there are no errors but nothing
> happens.  I tried opening a new shell just in case and still no changes have
> occurred.
> Help on this issue would be appreciated.

It's not the linux shell, it's the linux console virtual terminals.
As you know, you will have to use loadkeys (and not xmodmap).

Make a copy of your prefered map (dumpkeys is ok), and edit it.  My
capslock was near the 'a' key, so I replaced it with Control (keycode
29):

keycode  29 = Control
keycode  30 = a
keycode  31 = s
keycode  32 = d
keycode  33 = f
keycode  34 = g
keycode  35 = h
keycode  36 = j
keycode  37 = k
keycode  38 = l
keycode  39 = semicolon        colon
	alt	keycode  39 = Meta_semicolon

This maps the keys of the keyboard, each having a unique keycode,  on
the left, to the meaning of the key, on the right.


Unix shells are just programs like any other.  They're not terminals.
Keyboards are managed by terminals, be them real or virtual.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

ATTENTION: Despite any other listing of product contents found
herein, the consumer is advised that, in actuality, this product
consists of 99.9999999999% empty space.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How can I make my caps lock key act like a control key?
  2008-07-15 16:09 emacs615
@ 2008-07-16  6:40 ` Csányi Pál
  0 siblings, 0 replies; 10+ messages in thread
From: Csányi Pál @ 2008-07-16  6:40 UTC (permalink / raw)
  To: help-gnu-emacs

emacs615 <benjaminbondtate@gmail.com> writes:

> Hi,
> I am having trouble mapping my caps lock key to control key in my linux
> shell(NOT X). I want both the control and caps lock keys to act like control
> keys.  I've tried using loadkeys and I'm not getting errors, but I can't get
> it to work.  I've used dumpkeys to get a keymap, edited the map to where
> both the caps lock and control keys have the same key code (58 i think).  I
> then load this map with loadkeys and there are no errors but nothing
> happens.  I tried opening a new shell just in case and still no changes have
> occurred.

Copy your kmap (my is hu.kmap.gz) to a file, say .my_console_keymap:

cp /usr/share/keymaps/i386/qwertz/hu.kmap.gz ~/.my_console_keymap

edit this file:

mcedit ~/.my_console_keymap

keycode 58 = Control
control keycode 58 = Control

Caps Lock came the Control key.

keycode 29 = Last_Console

The Left Control came the Last Console.

Last Console switch to the last visited console.


At console Login this load my console keymap:

mcedit ~/.bash_profile

sudo loadkeys ~/.my_console_keymap

I hope this helps!

-- 
Regards, Paul Csanyi
http://www.freewebs.com/csanyi-pal/index.htm





^ permalink raw reply	[flat|nested] 10+ messages in thread

* How can I make my caps lock key act like a control key?
@ 2008-07-16  6:53 ken
  0 siblings, 0 replies; 10+ messages in thread
From: ken @ 2008-07-16  6:53 UTC (permalink / raw)
  To: Help-gnu-emacs


This is more a Linux systems question than an emacs problem.  But 
hopefully no one here will be too offended.

As with most things unix and, more, linux, there's a number of ways. 
What I've done is swapped Control and CapsLock in the system file where 
they are initially defined, in /usr/share/kbd/keymaps/i386/qwerty/. 
Depending upon your machine (uname -m) and how it's set up, the file you 
want to look at might be in a different directory.  On some Linuxes you 
can find the file with "cat /etc/defkeymap.name".  If this works for 
you, then you should just be able to hand edit /etc/defkeymap.map... it 
should be obvious what editing needs to be done.  If I'm remembering 
correctly, you'd just want to change the line beginning

keycode  58 =

to read "Control" instead of "Caps_Lock".

Alternatively, you could make a copy of your preferred keyboard map in 
or around /usr/share/kbd/keymaps/i386/qwerty/ (naming it, say, 
nocapslock.map), edit that file in the same sort of way as above, and 
then write in nocapslock.map into /etc/defkeymap.map.


Because these are a system files, the key(s) are swapped for anyone 
using this machine without X (which, for all practical purposes on my 
system, is just myself).

There's other ways to do what you want... query a search engine for them 
if you're interested in alternative, probably more doctrinaire methods.

hth.




Hi,
I am having trouble mapping my caps lock key to control key in my linux
shell(NOT X). I want both the control and caps lock keys to act like control
keys.  I've tried using loadkeys and I'm not getting errors, but I can't get
it to work.  I've used dumpkeys to get a keymap, edited the map to where
both the caps lock and control keys have the same key code (58 i think).  I
then load this map with loadkeys and there are no errors but nothing
happens.  I tried opening a new shell just in case and still no changes have
occurred.
Help on this issue would be appreciated.
Thanks,
-- 
View this message in context: 
http://www.nabble.com/How-can-I-make-my-caps-lock-key-act-like-a-control-key--tp18469011p18469011.html
Sent from the Emacs - Help mailing list archive at Nabble.com.







^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How can I make my caps lock key act like a control key?
  2008-07-16  6:26 ` Pascal J. Bourguignon
@ 2008-07-16 14:27   ` emacs615
  2008-07-16 15:52     ` Csányi Pál
  2008-07-16 21:17     ` Nikolaj Schumacher
  0 siblings, 2 replies; 10+ messages in thread
From: emacs615 @ 2008-07-16 14:27 UTC (permalink / raw)
  To: Help-gnu-emacs




emacs615 <benjaminbondtate@gmail.com> writes:

> Hi,
> I am having trouble mapping my caps lock key to control key in my linux
> shell(NOT X). I want both the control and caps lock keys to act like
> control
> keys.  I've tried using loadkeys and I'm not getting errors, but I can't
> get
> it to work.  I've used dumpkeys to get a keymap, edited the map to where
> both the caps lock and control keys have the same key code (58 i think). 
> I
> then load this map with loadkeys and there are no errors but nothing
> happens.  I tried opening a new shell just in case and still no changes
> have
> occurred.
> Help on this issue would be appreciated.


>>Make a copy of your prefered map (dumpkeys is ok), and edit it.  My
>>capslock was near the 'a' key, so I replaced it with Control (keycode
>>29):
>>keycode  29 = Control
>>This maps the keys of the keyboard, each having a unique keycode,  on
>>the left, to the meaning of the key, on the right.

I followed your advice and I made a copy of the current keymap for editing
with this command:
`dumpkeys > trialmap`
`emacs trialmap`
   in emacs:   `keycode 29 = Control`       //This WAS originally Caps_Lock
                   `keycode 58 = Control`
`loadkeys trialmap`  //outputs "loading keys" -- then finished w/ no errors
BUT still no effect, so I tried for good measure:
`gzip trialmap`
`loadkeys trialmap.gz`  //no effect either I can see the changes in the file
are correct and get no errors but no changes take effect.

-- 
View this message in context: http://www.nabble.com/How-can-I-make-my-caps-lock-key-act-like-a-control-key--tp18469011p18488707.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How can I make my caps lock key act like a control key?
  2008-07-16 14:27   ` emacs615
@ 2008-07-16 15:52     ` Csányi Pál
  2008-07-16 16:38       ` emacs615
  2008-07-16 21:17     ` Nikolaj Schumacher
  1 sibling, 1 reply; 10+ messages in thread
From: Csányi Pál @ 2008-07-16 15:52 UTC (permalink / raw)
  To: help-gnu-emacs

emacs615 <benjaminbondtate@gmail.com> writes:

> emacs615 <benjaminbondtate@gmail.com> writes:
> `loadkeys trialmap.gz`  //no effect either I can see the changes in the file
> are correct and get no errors but no changes take effect.

Have you tried run this command as root?

I would try:

sudo loadkeys trialmap.gz

-- 
Regards, Paul Csanyi
http://www.freewebs.com/csanyi-pal/index.htm





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How can I make my caps lock key act like a control key?
  2008-07-16 15:52     ` Csányi Pál
@ 2008-07-16 16:38       ` emacs615
  2008-07-17  9:39         ` Csányi Pál
  0 siblings, 1 reply; 10+ messages in thread
From: emacs615 @ 2008-07-16 16:38 UTC (permalink / raw)
  To: Help-gnu-emacs


Yes, I am running these commands as the root user.  Still -- no luck.  
>>>Have you tried run this command as root?

Paul Csanyi wrote:
> 
> emacs615 <benjaminbondtate@gmail.com> writes:
> 
>> emacs615 <benjaminbondtate@gmail.com> writes:
>> `loadkeys trialmap.gz`  //no effect either I can see the changes in the
>> file
>> are correct and get no errors but no changes take effect.
> 
> Have you tried run this command as root?
> 
> I would try:
> 
> sudo loadkeys trialmap.gz
> 
> -- 
> Regards, Paul Csanyi
> http://www.freewebs.com/csanyi-pal/index.htm
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-I-make-my-caps-lock-key-act-like-a-control-key--tp18469011p18491600.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How can I make my caps lock key act like a control key?
  2008-07-16 14:27   ` emacs615
  2008-07-16 15:52     ` Csányi Pál
@ 2008-07-16 21:17     ` Nikolaj Schumacher
  1 sibling, 0 replies; 10+ messages in thread
From: Nikolaj Schumacher @ 2008-07-16 21:17 UTC (permalink / raw)
  To: emacs615; +Cc: Help-gnu-emacs

emacs615 <benjaminbondtate@gmail.com> wrote:

> I followed your advice and I made a copy of the current keymap for editing
> with this command:

Okay,

I honestly didn't parse all the letter salad in this thread :)
but I thought I'd chime in with what I used to do years ago.  There's no
need to copy and edit keymaps, just do:

loadkeys <<EOF
keymaps 0-2,4-6,8-9,12
keycode 58 = Control
keycode 29 = nul
EOF



regards,
Nikolaj Schumacher




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How can I make my caps lock key act like a control key?
  2008-07-16 16:38       ` emacs615
@ 2008-07-17  9:39         ` Csányi Pál
  0 siblings, 0 replies; 10+ messages in thread
From: Csányi Pál @ 2008-07-17  9:39 UTC (permalink / raw)
  To: help-gnu-emacs

emacs615 <benjaminbondtate@gmail.com> writes:

> Yes, I am running these commands as the root user.  Still -- no luck.  
>>>>Have you tried run this command as root?

OK

I find a solution for myself!

I used showkey to get keycodes of the relevant keys.
I get these in hexadecimal form, so I used Emacs calculator 
M-x calculator and converted these numbers in to decimal form (H or D
in calculator show the number in hexad. or decim. form.).

I used 

dumpkeys > ConsoleKeymap

to get recent keymap and with 

M-x ediff

I compared ConsoleKeymap with copied keymap.
It was OK so I go further.

Then I edited the copied keymap, swap the keys, and load it:

sudo loadkeys ~/keymap.gz

I get the keys on the Console as I whish! :D

-- 
Regards, Paul Csanyi
http://www.freewebs.com/csanyi-pal/index.htm





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-07-17  9:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.14818.1216178279.18990.help-gnu-emacs@gnu.org>
2008-07-16  3:40 ` How can I make my caps lock key act like a control key? Chris F.A. Johnson
2008-07-16  6:26 ` Pascal J. Bourguignon
2008-07-16 14:27   ` emacs615
2008-07-16 15:52     ` Csányi Pál
2008-07-16 16:38       ` emacs615
2008-07-17  9:39         ` Csányi Pál
2008-07-16 21:17     ` Nikolaj Schumacher
2008-07-16  6:53 ken
  -- strict thread matches above, loose matches on Subject: below --
2008-07-15 16:09 emacs615
2008-07-16  6:40 ` Csányi Pál

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.