* swap CapsLock and Ctrl only in Emacs
@ 2006-06-12 8:13 tury.peter
2006-06-12 10:37 ` Tim X
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: tury.peter @ 2006-06-12 8:13 UTC (permalink / raw)
Hi,
according to http://www.emacswiki.org/cgi-bin/wiki/MovingTheCtrlKey and to http://www.gnu.org/software/emacs/windows/faq3.html#capscontrol this is not possible in Emacs. Is this still impossible in Emacs 22? And what about EmacsW32?
Thanks,
P
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
2006-06-12 8:13 swap CapsLock and Ctrl only in Emacs tury.peter
@ 2006-06-12 10:37 ` Tim X
2006-06-13 3:35 ` Eli Zaretskii
[not found] ` <mailman.2846.1150169750.9609.help-gnu-emacs@gnu.org>
2006-06-12 14:51 ` B. T. Raven
2006-06-13 7:48 ` tury.peter
2 siblings, 2 replies; 11+ messages in thread
From: Tim X @ 2006-06-12 10:37 UTC (permalink / raw)
tury.peter@gmail.com writes:
> Hi,
>
> according to http://www.emacswiki.org/cgi-bin/wiki/MovingTheCtrlKey and to http://www.gnu.org/software/emacs/windows/faq3.html#capscontrol this is not possible in Emacs. Is this still impossible in Emacs 22? And what about EmacsW32?
>
> Thanks,
> P
I don't believe you are likely to ever be able to do this from within
emacs (via elisp) as you need to somehow intercept every keystroke
prior to it being interpreted by emacs and modify the definitions for
the keys you want to re-map. It would also involve an additional level
of mapping and I'm not sure how you would do this reliably and
efficiently on a multi-user system.
Under X the solution is easy - you re-map the keys at the X level
using utilities like modmap. For Windows, its a lot trickier as you
either have to install a new driver or hack the registry. Either
option has considerable risk. I would go for the keyboard driver
solution as it is likely to be more consistent and reliable than a
registry hack. Of course, you have to be confident the keyboard driver
has been well written and behaves nicely with other keyboard drivers
which have/may also be loaded and that can be a little tricky under windows.
Tim
--
tcross (at) rapttech dot com dot au
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
2006-06-12 8:13 swap CapsLock and Ctrl only in Emacs tury.peter
2006-06-12 10:37 ` Tim X
@ 2006-06-12 14:51 ` B. T. Raven
2006-06-12 14:59 ` Chris McMahan
2006-06-13 7:48 ` tury.peter
2 siblings, 1 reply; 11+ messages in thread
From: B. T. Raven @ 2006-06-12 14:51 UTC (permalink / raw)
<tury.peter@gmail.com> wrote in message
news:719148673.11150100023147.JavaMail.nntpgw@xnews001...
> Hi,
>
> according to http://www.emacswiki.org/cgi-bin/wiki/MovingTheCtrlKey and
to http://www.gnu.org/software/emacs/windows/faq3.html#capscontrol this is
not possible in Emacs. Is this still impossible in Emacs 22? And what
about EmacsW32?
>
> Thanks,
> P
Sysinternals has 2 free drivers that do this for msw os'es, an NT version
and a 9X one:
http://www.sysinternals.com/Utilities/Ctrl2Cap.html
I don't know if it works in dos shell or emacs terminal mode; I think it
does.
Ed.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
2006-06-12 14:51 ` B. T. Raven
@ 2006-06-12 14:59 ` Chris McMahan
0 siblings, 0 replies; 11+ messages in thread
From: Chris McMahan @ 2006-06-12 14:59 UTC (permalink / raw)
It should work for any application (including console) running in NT/XP.
I've been successfully using a very basic registry hack to provide the
same functionality. If you're interested, I can post this as well.
- Chris
"B. T. Raven" <ecinmn@alcisp.com> writes:
> <tury.peter@gmail.com> wrote in message
> news:719148673.11150100023147.JavaMail.nntpgw@xnews001...
>> Hi,
>>
>> according to http://www.emacswiki.org/cgi-bin/wiki/MovingTheCtrlKey and
> to http://www.gnu.org/software/emacs/windows/faq3.html#capscontrol this is
> not possible in Emacs. Is this still impossible in Emacs 22? And what
> about EmacsW32?
>>
>> Thanks,
>> P
>
> Sysinternals has 2 free drivers that do this for msw os'es, an NT version
> and a 9X one:
>
> http://www.sysinternals.com/Utilities/Ctrl2Cap.html
>
> I don't know if it works in dos shell or emacs terminal mode; I think it
> does.
>
> Ed.
>
--
(. .)
=ooO=(_)=Ooo=====================================
Chris McMahan | first_initiallastname@one.dot.net
=================================================
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
2006-06-12 10:37 ` Tim X
@ 2006-06-13 3:35 ` Eli Zaretskii
[not found] ` <mailman.2846.1150169750.9609.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2006-06-13 3:35 UTC (permalink / raw)
> From: Tim X <timx@nospam.dev.null>
> Date: Mon, 12 Jun 2006 20:37:41 +1000
>
> Under X the solution is easy - you re-map the keys at the X level
> using utilities like modmap.
Which will swap the keys in all X applications--contrary to what the
OP wanted.
> For Windows, its a lot trickier as you either have to install a new
> driver or hack the registry.
Which isn't harder than using xmodmap: Google will find gazillions of
articles on how to do the registry ``hack'' easy way.
> Either option has considerable risk.
There's absolutely no risk with the registry method. Even Microsoft
explains in MSDN how to do that.
Anyway, none of these solutions are limited to Emacs alone, which is
what the OP wanted.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
[not found] ` <mailman.2846.1150169750.9609.help-gnu-emacs@gnu.org>
@ 2006-06-13 4:12 ` B. T. Raven
2006-06-13 9:24 ` Stein Arild Strømme
2006-06-13 8:09 ` Mathias Dahl
1 sibling, 1 reply; 11+ messages in thread
From: B. T. Raven @ 2006-06-13 4:12 UTC (permalink / raw)
"Eli Zaretskii" <eliz@gnu.org> wrote in message
news:mailman.2846.1150169750.9609.help-gnu-emacs@gnu.org...
> > From: Tim X <timx@nospam.dev.null>
> > Date: Mon, 12 Jun 2006 20:37:41 +1000
> >
> > Under X the solution is easy - you re-map the keys at the X level
> > using utilities like modmap.
>
> Which will swap the keys in all X applications--contrary to what the
> OP wanted.
>
> > For Windows, its a lot trickier as you either have to install a new
> > driver or hack the registry.
>
> Which isn't harder than using xmodmap: Google will find gazillions of
> articles on how to do the registry ``hack'' easy way.
>
> > Either option has considerable risk.
>
> There's absolutely no risk with the registry method. Even Microsoft
> explains in MSDN how to do that.
>
> Anyway, none of these solutions are limited to Emacs alone, which is
> what the OP wanted.
>
>
He did say that but it would have made more sense if he had said "...only
CapsLock and [Left] Control key in Emacs." I can't imagine a scenario in
which, for instance, the same person would want to use a qwerty keyboard
for one application and a dvorak for another. It tends to short-circuit
procedural memory. If more than one person are using the machine, it
should be possible to toggle between two keyboard layouts. For qwerty and
dvorak it's a matter of two mouse clicks or keystrokes (dos needs "keyb
dv,,c:\dos\keyboard.sys"
and "keyb us,,c:\dos\keyboard.sys" in the batch files am.bat and ma.bat,
respectively or versa vice. Doesn't require rebooting).
Ed
Ed.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
2006-06-12 8:13 swap CapsLock and Ctrl only in Emacs tury.peter
2006-06-12 10:37 ` Tim X
2006-06-12 14:51 ` B. T. Raven
@ 2006-06-13 7:48 ` tury.peter
2006-06-13 8:21 ` Mathias Dahl
2006-06-21 2:14 ` sean.ohalpin
2 siblings, 2 replies; 11+ messages in thread
From: tury.peter @ 2006-06-13 7:48 UTC (permalink / raw)
Hi,
thanks!
Yes I indeed wanted to swap _left_ Ctrl and CapsLock _only in Emacs_ and none of the solutions shown does this -> now, according to your answers, I believe there isn't a known easy solution -- and if it were, it might short-circuit my memory? ;-)
So now I think the best would be to replace CapsLock with left Ctrl: all keys would work as normally, except only(!) CapsLock what would work as left ctrl -> so I would have two left ctrl-s and none CapsLock in whole MS Windows (XP).
Is this possible?
Thanks again in advance!!
P
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
[not found] ` <mailman.2846.1150169750.9609.help-gnu-emacs@gnu.org>
2006-06-13 4:12 ` B. T. Raven
@ 2006-06-13 8:09 ` Mathias Dahl
1 sibling, 0 replies; 11+ messages in thread
From: Mathias Dahl @ 2006-06-13 8:09 UTC (permalink / raw)
Eli Zaretskii <eliz@gnu.org> writes:
>> Under X the solution is easy - you re-map the keys at the X level
>> using utilities like modmap.
>
> Which will swap the keys in all X applications--contrary to what the
> OP wanted.
Really? I can use xmodmap with certain bindings that affects just the
program I start right there. Something like this:
$ xmodmap modmapfile | emacs
(Unsure about the syntax)
>> For Windows, its a lot trickier as you either have to install a new
>> driver or hack the registry.
>
> Which isn't harder than using xmodmap: Google will find gazillions of
> articles on how to do the registry ``hack'' easy way.
It is "harder" because you have to restart (log out is not enough).
> Anyway, none of these solutions are limited to Emacs alone, which is
> what the OP wanted.
True.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
2006-06-13 7:48 ` tury.peter
@ 2006-06-13 8:21 ` Mathias Dahl
2006-06-21 2:14 ` sean.ohalpin
1 sibling, 0 replies; 11+ messages in thread
From: Mathias Dahl @ 2006-06-13 8:21 UTC (permalink / raw)
tury.peter@gmail.com writes:
> So now I think the best would be to replace CapsLock with left Ctrl:
> all keys would work as normally, except only(!) CapsLock what would
> work as left ctrl -> so I would have two left ctrl-s and none CapsLock
> in whole MS Windows (XP).
>
> Is this possible?
Yes, it is possible. I use a program called "keytweak" for things like
that. Try that one. Hmm, not sure if you can NOT swap (you want Ctrl
on both keys) though...
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
2006-06-13 4:12 ` B. T. Raven
@ 2006-06-13 9:24 ` Stein Arild Strømme
0 siblings, 0 replies; 11+ messages in thread
From: Stein Arild Strømme @ 2006-06-13 9:24 UTC (permalink / raw)
[B. T. Raven]
| .... I can't imagine a scenario in which, for instance, the same
| person would want to use a qwerty keyboard for one application and a
| dvorak for another.
Not exactly the example that you mention, and not really relevant to
the thread, but I for one prefer a standard (that is, US :-) qwerty
layout when in emacs and in bash, but a Norwegian key layout when in
some other applications. In fact, I have posted questions on several
forums and usenet groups on how to achieve this automatically under
Mac OS X.
For the question of the thread, is not keyboard-translate (an emacs
function) a possibility?
keyboard-translate is a compiled Lisp function in `subr.el'.
(keyboard-translate from to)
Translate character from to to at a low level.
This function creates a `keyboard-translate-table' if necessary
and then modifies one entry in it.
SA
--
Stein Arild Strømme +47 55584825, +47 95801887
Universitetet i Bergen Fax: +47 55589672
Matematisk institutt www.mi.uib.no/stromme/
Johs Brunsg 12, N-5008 BERGEN stromme@mi.uib.no
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: swap CapsLock and Ctrl only in Emacs
2006-06-13 7:48 ` tury.peter
2006-06-13 8:21 ` Mathias Dahl
@ 2006-06-21 2:14 ` sean.ohalpin
1 sibling, 0 replies; 11+ messages in thread
From: sean.ohalpin @ 2006-06-21 2:14 UTC (permalink / raw)
tury.peter@gmail.com wrote:
[snip]
> So now I think the best would be to replace CapsLock with left Ctrl: all keys would work as normally, except only(!) CapsLock what would work as left ctrl -> so I would have two left ctrl-s and none CapsLock in whole MS Windows (XP).
>
> Is this possible?
Yup - I just did it myself.
1. Save the following to a .reg file
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,02,00,00,00,1d,00,3a,00,00,00,00,00
("Scancode Map"=... should all be on one line)
2. Double click in explorer to install
3. Reboot computer
4. Voila - two left control keys
Have fun!
Sean
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-06-21 2:14 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-12 8:13 swap CapsLock and Ctrl only in Emacs tury.peter
2006-06-12 10:37 ` Tim X
2006-06-13 3:35 ` Eli Zaretskii
[not found] ` <mailman.2846.1150169750.9609.help-gnu-emacs@gnu.org>
2006-06-13 4:12 ` B. T. Raven
2006-06-13 9:24 ` Stein Arild Strømme
2006-06-13 8:09 ` Mathias Dahl
2006-06-12 14:51 ` B. T. Raven
2006-06-12 14:59 ` Chris McMahan
2006-06-13 7:48 ` tury.peter
2006-06-13 8:21 ` Mathias Dahl
2006-06-21 2:14 ` sean.ohalpin
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.