wish: right alt/meta to switch keyboard layout while pressed

classic Classic list List threaded Threaded
43 messages Options
123
Reply | Threaded
Open this post in threaded view
|

wish: right alt/meta to switch keyboard layout while pressed

Paul Pogonyshev
Hi,

It is probably a bit too late now for wishes, but maybe it is trivial
to implement in Emacs, so I'll ask just in case.

There is a useful feature to switch keyboard layout temporary while
the right alt (meta) key is pressed.  In xkb you can turn it on with
`-option grp:switch'.  It is useful, because some characters are
absent from some non-English layouts and `normal' switching back and
forth is quite annoying for a mere character or two.  For instance,
you cannot type `[', `]', `{', `}', the apostrophe and some other
characters while using Russian layout.

So, if I want to type an apostrophe from Russian keyboard layout, I
have to type `C-\ ' C-\'.  If, however, the temporary-switching was
implemented, I could do with `press-right-alt ' release-right-alt',
which is obviously much easier.

As far as I can tell, Emacs currently just ignores the right Alt.

Can this be implemented easily?

Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Andreas Schwab
Paul Pogonyshev <[hidden email]> writes:

> As far as I can tell, Emacs currently just ignores the right Alt.

Depends on how you assign it.  On my keyboard I have bound it to
Multi_key, which is used to trigger the compose feature of the X server.
Ie, I can type R-Alt a e to get the æ character.  This feature is
completely transparent to the application.

Another option for the R-Alt key is to use it as the Level3 shift
("AltGr").

Andreas.

--
Andreas Schwab, SuSE Labs, [hidden email]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Richard Stallman
In reply to this post by Paul Pogonyshev
    As far as I can tell, Emacs currently just ignores the right Alt.

Why does Emacs ignore the right Alt key?  It seems to me that
(at least normally) it should be equivalent to the left Alt key.

I would not mind if some other feature were optionally added to it,
but we should not think about that now.


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Juri Linkov
In reply to this post by Paul Pogonyshev
> So, if I want to type an apostrophe from Russian keyboard layout, I
> have to type `C-\ ' C-\'.  If, however, the temporary-switching was
> implemented, I could do with `press-right-alt ' release-right-alt',
> which is obviously much easier.
>
> As far as I can tell, Emacs currently just ignores the right Alt.
>
> Can this be implemented easily?

I think the most natural way to do this in Emacs is to use C-q.
So to quote ' in an input method and not to translate it, you could
use C-q '.

However, this currently doesn't work.  C-q inserts a translated
character, and while C-q together with an input method read an input
sequence, the intermediate display in the echo area is quite messy.

It seems `quoted-insert' (C-q) attempts to do something with this
situation, and it let-binds `translation-table-for-input' to nil
before reading a quoted character, but this doesn't work for quoting
characters in input methods.  I propose the following patch to let-bind
`input-method-function' to nil as well.

Index: lisp/simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.769
diff -c -r1.769 simple.el
*** lisp/simple.el 20 Nov 2005 18:08:55 -0000 1.769
--- lisp/simple.el 23 Nov 2005 06:04:04 -0000
***************
*** 609,615 ****
  digits are interpreted as a character code.  This is intended to be
  useful for editing binary files."
    (interactive "*p")
!   (let* ((char (let (translation-table-for-input)
  (if (or (not overwrite-mode)
  (eq overwrite-mode 'overwrite-mode-binary))
      (read-quoted-char)
--- 610,616 ----
  digits are interpreted as a character code.  This is intended to be
  useful for editing binary files."
    (interactive "*p")
!   (let* ((char (let (translation-table-for-input input-method-function)
  (if (or (not overwrite-mode)
  (eq overwrite-mode 'overwrite-mode-binary))
      (read-quoted-char)

--
Juri Linkov
http://www.jurta.org/emacs/



_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Paul Pogonyshev
In reply to this post by Richard Stallman
Richard M. Stallman wrote:
>     As far as I can tell, Emacs currently just ignores the right Alt.
>
> Why does Emacs ignore the right Alt key?  It seems to me that
> (at least normally) it should be equivalent to the left Alt key.

Probably because X distinguishes between the two Alts (I don't know
the details) and Emacs only considers the left Alt as Meta key.  It
may also depend on how X is configured.

> I would not mind if some other feature were optionally added to it,
> but we should not think about that now.

OK.

Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Stefan Monnier
In reply to this post by Paul Pogonyshev
> As far as I can tell, Emacs currently just ignores the right Alt.

>From your description you seem to say that your right Alt key is already
configured for other apps to do some kind of keyboard switch.  So it seems
that it's an X11 feature, in which case the problem may simply be a bug in
Emacs which doesn't handle this feature correctly.  Can you check with `xev'
to see what events your right Alt key generates?


        Stefan


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Paul Pogonyshev
Stefan Monnier wrote:
> > As far as I can tell, Emacs currently just ignores the right Alt.
>
> From your description you seem to say that your right Alt key is already
> configured for other apps to do some kind of keyboard switch.  So it seems
> that it's an X11 feature, in which case the problem may simply be a bug in
> Emacs which doesn't handle this feature correctly.

Emacs has no way of handling it correctly out-of-the-box, since it uses
internal input methods, which are a completely separate from `xkb'.

> Can you check with `xev' to see what events your right Alt key generates?

It shows up as `Super_R', while the left Alt is `Alt_L'.

Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Stefan Monnier
> Emacs has no way of handling it correctly out-of-the-box, since it uses
> internal input methods, which are a completely separate from `xkb'.

You mean you use Emacs's internal input methods.  I occasionally use them as
well, but I mostly use XIM input methods and they work just fine with Emacs.

>> Can you check with `xev' to see what events your right Alt key generates?
> It shows up as `Super_R', while the left Alt is `Alt_L'.

So maybe the physical key is located on the right side of the space bar and
it has a little bit of text on it that says "alt", so *you* think of it as
a "right alt key".
But as far as X clients are concerned this is not a "right alt key".

        Stefan



> Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Richard Stallman
In reply to this post by Paul Pogonyshev
    Probably because X distinguishes between the two Alts (I don't know
    the details) and Emacs only considers the left Alt as Meta key.  It
    may also depend on how X is configured.

Is there an Xpert on the list who could discuss how--and whether--to
make left Alt work like right Alt, in usual X configurations?


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Andreas Schwab
"Richard M. Stallman" <[hidden email]> writes:

> Is there an Xpert on the list who could discuss how--and whether--to
> make left Alt work like right Alt, in usual X configurations?

I don't think Emacs should override the User's choice of key mapping, even
if it is some system default.

Andreas.

--
Andreas Schwab, SuSE Labs, [hidden email]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Paul Pogonyshev
In reply to this post by Stefan Monnier
Stefan Monnier wrote:
> > Emacs has no way of handling it correctly out-of-the-box, since it uses
> > internal input methods, which are a completely separate from `xkb'.
>
> You mean you use Emacs's internal input methods.  I occasionally use them as
> well, but I mostly use XIM input methods and they work just fine with Emacs.

You could put it that way, yes.  However, with Russian layout, it is almost
impossible to do otherwise.  If I switch my `global' layout (handled by KDE,
which AFAIK falls back to `xkb'), I get this on response to `M-d':

  M-в is undefined

Working with Emacs with essentially all commands except `self-insert-command'
disabled is not something I like.  I guess your second layout also works with
Latin alphabet, so it's not a problem for you.

> >> Can you check with `xev' to see what events your right Alt key generates?
> > It shows up as `Super_R', while the left Alt is `Alt_L'.
>
> So maybe the physical key is located on the right side of the space bar and
> it has a little bit of text on it that says "alt", so *you* think of it as
> a "right alt key".
> But as far as X clients are concerned this is not a "right alt key".

Uh, I just checked again, it is actually `Mode_switch' for X, I must have
pressed the right key with the Windows logo the previous time.

So yes, let me rephrase.  I wish `Mode_switch' would deactivate the current
input method while pressed in Emacs.  Or so that I could turn such feature
on with something as simple as `setq ... t'.

Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Stefan Monnier
>> > Emacs has no way of handling it correctly out-of-the-box, since it uses
>> > internal input methods, which are a completely separate from `xkb'.
>> You mean you use Emacs's internal input methods.  I occasionally use them as
>> well, but I mostly use XIM input methods and they work just fine with Emacs.
> You could put it that way, yes.  However, with Russian layout, it is almost
> impossible to do otherwise.  If I switch my `global' layout (handled by KDE,
> which AFAIK falls back to `xkb'), I get this on response to `M-d':

>   M-в is undefined

Interesting.  I guess that could be considered as a bug.
How do other X apps handle this problem?

> Working with Emacs with essentially all commands except `self-insert-command'
> disabled is not something I like.  I guess your second layout also works with
> Latin alphabet, so it's not a problem for you.

It's not a second layout: the XIM method just provides some key-combos to
enter accented chars.  So, yes, I don't see any of those problems.

>> >> Can you check with `xev' to see what events your right Alt key generates?
>> > It shows up as `Super_R', while the left Alt is `Alt_L'.
>> So maybe the physical key is located on the right side of the space bar and
>> it has a little bit of text on it that says "alt", so *you* think of it as
>> a "right alt key".
>> But as far as X clients are concerned this is not a "right alt key".

> Uh, I just checked again, it is actually `Mode_switch' for X, I must have
> pressed the right key with the Windows logo the previous time.

That makes more sense.  xterm.c recognizes the Mode_switch key as something
special.

> So yes, let me rephrase.  I wish `Mode_switch' would deactivate the current
> input method while pressed in Emacs.  Or so that I could turn such feature
> on with something as simple as `setq ... t'.

Is that what the Mode_switch key does in other X apps?  I.e. what does the
Mode_switch key do, "normally"?
The question is mostly to figure out whether it's a bug in our X event
handling or whether you're asking for an Emacs-only feature (the
implementation would most likely be different).


        Stefan


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Paul Pogonyshev
Stefan Monnier wrote:

> >> > Emacs has no way of handling it correctly out-of-the-box, since it uses
> >> > internal input methods, which are a completely separate from `xkb'.
> >> You mean you use Emacs's internal input methods.  I occasionally use them as
> >> well, but I mostly use XIM input methods and they work just fine with Emacs.
> > You could put it that way, yes.  However, with Russian layout, it is almost
> > impossible to do otherwise.  If I switch my `global' layout (handled by KDE,
> > which AFAIK falls back to `xkb'), I get this on response to `M-d':
>
> >   M-в is undefined
>
> Interesting.  I guess that could be considered as a bug.
> How do other X apps handle this problem?

I use KDE.  There I have the Russian (winkeys) layout added with "Include latin
layout" option turned on.  This gives this command line:

        setxkbmap -model pc104 -layout us,ru -variant ,winkeys

After this, most applications handle, say `Сtrl-Ц' just like `Ctrl-W' (`Ц' and
`W' are on the same key.)  However, Firefox doesn't, for some reason (which pisses
me off a lot, BTW) and so doesn't Emacs...  No idea why.

> > So yes, let me rephrase.  I wish `Mode_switch' would deactivate the current
> > input method while pressed in Emacs.  Or so that I could turn such feature
> > on with something as simple as `setq ... t'.
>
> Is that what the Mode_switch key does in other X apps?  I.e. what does the
> Mode_switch key do, "normally"?

Yes, if you use `setxkbmap -option grp:switch'.  In KDE Control Center this
option is called ``Right Alt key switches group while pressed.''  There is a
lot of similar options, though.  Somehow, I think this one is `standard' in
some way (I vaguelly recall some old DOS drivers behaving this way), but I may
be wrong.

> The question is mostly to figure out whether it's a bug in our X event
> handling or whether you're asking for an Emacs-only feature (the
> implementation would most likely be different).

Maybe if you could make it behave like most other apps do (and unlike Firefox),
that is enough.  Than I would be able to just use global layout switching and
not internal Emacs input methods.  However, making it work with internal methods
would be even better for me, since I like separate input methods for each buffer
etc., which is impossible with global layout switching.  (Well, there are some
horrible hacks I was privately given links to, but I'm not diving into something
as complicated as that.)

Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Aidan Kehoe

 Ar an séú lá is fiche de mí na Samhain, scríobh Paul Pogonyshev:

 > I use KDE. There I have the Russian (winkeys) layout added with "Include
 > latin layout" option turned on. This gives this command line:
 >
 > setxkbmap -model pc104 -layout us,ru -variant ,winkeys
 >
 > After this, most applications handle, say `Сtrl-Ц' just like `Ctrl-W'
 > (`Ц' and `W' are on the same key.) However, Firefox doesn't, for some
 > reason (which pisses me off a lot, BTW) and so doesn't Emacs... No idea
 > why.

Recent betas of XEmacs do. Not to do it is expected behaviour, when you
think of it; it would be reasonable to bind M-Cyrillic_tse to something
different to M-x, if both were available on the keyboard.

--
I AM IN JAIL AND ALLOWED SEND ONLY ONE CABLE SINCE WAS ARRESTED WHILE
MEASURING FIFTEEN FOOT WALL OUTSIDE PALACE AND HAVE JUST FINISHED COUNTING
THIRTY EIGHT THOUSAND FIVE HUNDERED TWENTY TWO NAMES WHOS WHO IN MIDEAST.


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Richard Stallman
In reply to this post by Stefan Monnier
    > It shows up as `Super_R', while the left Alt is `Alt_L'.

Is that a common way for the default X configuration to be set up
by default?

If so, we might want to include something in etc/PROBLEMS to advise
users what they should do if they have this kind of configuration
and they want left-Alt to "work" as Meta.




_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Eugene Vlasov
In reply to this post by Paul Pogonyshev
On Sat, Nov 26, 2005 at 12:33:23AM +0200 Paul Pogonyshev wrote:

> After this, most applications handle, say `Сtrl-Ц' just like `Ctrl-W' (`Ц' and
> `W' are on the same key.)  However, Firefox doesn't, for some reason (which pisses
> me off a lot, BTW) and so doesn't Emacs...  No idea why.

With this patch from ALTLinux distribution keybindings with Ctrl and
Meta works for me in russian keyboard map:

diff -Naur emacs/src/xterm.c emacs.build/src/xterm.c
--- emacs/src/xterm.c   2005-11-16 23:44:07 +0500
+++ emacs.build/src/xterm.c     2005-11-26 12:50:23 +0500
@@ -6141,11 +6141,20 @@
 
           /* make_lispy_event turns chars into control chars.
              Don't do it here because XLookupString is too eager.  */
-          event.xkey.state &= ~ControlMask;
-          event.xkey.state &= ~(dpyinfo->meta_mod_mask
-                                | dpyinfo->super_mod_mask
-                                | dpyinfo->hyper_mod_mask
-                                | dpyinfo->alt_mod_mask);
+          /* make CMsHA behave the same no matter what the rest of the
+             state is (particularly important for multilingual XKBmaps
+             when we still want the latin letters appear in the "control"
+             sequences; would be nice if we also could choose an independent
+             map for each buffer like xxkb does for windows: the the problem with
+             smth like C-h f in Russian mode would be solved); discard
+             all mods save shift. ([hidden email], 2002 Nov 8,
+             fixing #852 at bugs.altlinux.ru) */
+          if (event.xkey.state & ( ControlMask
+                                  | dpyinfo->meta_mod_mask
+                                  | dpyinfo->super_mod_mask
+                                  | dpyinfo->hyper_mod_mask
+                                  | dpyinfo->alt_mod_mask))
+            event.xkey.state &= (ShiftMask | dpyinfo->shift_lock_mask);
 
           /* In case Meta is ComposeCharacter,
              clear its status.  According to Markus Ehrnsperger



--
WBR, Eugene Vlasov        mailto:eugvv at altlinux.ru
                          JID: [hidden email]


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Stefan Monnier
In reply to this post by Paul Pogonyshev
>> Interesting.  I guess that could be considered as a bug.
>> How do other X apps handle this problem?

> I use KDE.  There I have the Russian (winkeys) layout added with "Include
> latin layout" option turned on.  This gives this command line:

> setxkbmap -model pc104 -layout us,ru -variant ,winkeys

> After this, most applications handle, say `Сtrl-Ц' just like `Ctrl-W' (`Ц'
> and `W' are on the same key.)  However, Firefox doesn't, for some reason
> (which pisses me off a lot, BTW) and so doesn't Emacs...  No idea why.

When you say "most applications" does that only include KDE (Qt) apps,
or does it also include apps that use completely different toolkits?
I guess it also includes other apps, right?

If so, I think this behavior of Emacs should be considered as a bug.

>> > So yes, let me rephrase.  I wish `Mode_switch' would deactivate the current
>> > input method while pressed in Emacs.  Or so that I could turn such feature
>> > on with something as simple as `setq ... t'.
>> Is that what the Mode_switch key does in other X apps?  I.e. what does the
>> Mode_switch key do, "normally"?
> Yes, if you use `setxkbmap -option grp:switch'.

Then Emacs should do the same.  I suspect it's the same bug.

> Maybe if you could make it behave like most other apps do (and unlike
> Firefox), that is enough.  Than I would be able to just use global layout
> switching and not internal Emacs input methods.  However, making it work
> with internal methods would be even better for me, since I like separate
> input methods for each buffer etc., which is impossible with global layout
> switching.  (Well, there are some horrible hacks I was privately given
> links to, but I'm not diving into something as complicated as that.)

Yes, that makes sense as well.
So you'd want hitting Mode_switch to toggle the LEIM input method or would
you want pressing to turn it off and releasing to turn it back on?


        Stefan


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Paul Pogonyshev
In reply to this post by Aidan Kehoe
Aidan Kehoe wrote:

>
>  Ar an séú lá is fiche de mí na Samhain, scríobh Paul Pogonyshev:
>
>  > I use KDE. There I have the Russian (winkeys) layout added with "Include
>  > latin layout" option turned on. This gives this command line:
>  >
>  > setxkbmap -model pc104 -layout us,ru -variant ,winkeys
>  >
>  > After this, most applications handle, say `Сtrl-Ц' just like `Ctrl-W'
>  > (`Ц' and `W' are on the same key.) However, Firefox doesn't, for some
>  > reason (which pisses me off a lot, BTW) and so doesn't Emacs... No idea
>  > why.
>
> Recent betas of XEmacs do. Not to do it is expected behaviour, when you
> think of it; it would be reasonable to bind M-Cyrillic_tse to something
> different to M-x, if both were available on the keyboard.

Yeah, and then I'd have to remember if I'm typing in Russian or in English
and press different key combos in different layouts to say delete a word.

I don't mind if they are configurable in different layouts even if I consider
it an overkill.  But Emacs has some hundreds of actively used key combinations,
do you suggest I rebind all of them separately for Russian layout too?  Should
I do this in every single one application I use besides Emacs (and which
probably doesn't even have the facility to rebind keys.)

Non-self-inserting keys _absolutely_ must work independently of the layout,
at least by default.

Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Paul Pogonyshev
In reply to this post by Stefan Monnier
Stefan Monnier wrote:

> >> Interesting.  I guess that could be considered as a bug.
> >> How do other X apps handle this problem?
>
> > I use KDE.  There I have the Russian (winkeys) layout added with "Include
> > latin layout" option turned on.  This gives this command line:
>
> > setxkbmap -model pc104 -layout us,ru -variant ,winkeys
>
> > After this, most applications handle, say `Сtrl-Ц' just like `Ctrl-W' (`Ц'
> > and `W' are on the same key.)  However, Firefox doesn't, for some reason
> > (which pisses me off a lot, BTW) and so doesn't Emacs...  No idea why.
>
> When you say "most applications" does that only include KDE (Qt) apps,
> or does it also include apps that use completely different toolkits?
> I guess it also includes other apps, right?
>
> If so, I think this behavior of Emacs should be considered as a bug.

Not only KDE applications, no.  For instance, it works in Gaim (pure GTK+,
AFAIK) and Galeon (GNOME.)

> >> > So yes, let me rephrase.  I wish `Mode_switch' would deactivate the current
> >> > input method while pressed in Emacs.  Or so that I could turn such feature
> >> > on with something as simple as `setq ... t'.
> >> Is that what the Mode_switch key does in other X apps?  I.e. what does the
> >> Mode_switch key do, "normally"?
> > Yes, if you use `setxkbmap -option grp:switch'.
>
> Then Emacs should do the same.  I suspect it's the same bug.

Yes, if not for internal input methods, it at least must honor my global settings
for `xkb' behavior.

> > Maybe if you could make it behave like most other apps do (and unlike
> > Firefox), that is enough.  Than I would be able to just use global layout
> > switching and not internal Emacs input methods.  However, making it work
> > with internal methods would be even better for me, since I like separate
> > input methods for each buffer etc., which is impossible with global layout
> > switching.  (Well, there are some horrible hacks I was privately given
> > links to, but I'm not diving into something as complicated as that.)
>
> Yes, that makes sense as well.
> So you'd want hitting Mode_switch to toggle the LEIM input method or would
> you want pressing to turn it off and releasing to turn it back on?

It seems in `xkb' Mode_switch disables alternative groups only, i.e. it won't
start typing in Russian if I hold Mode_switch while using the English layout.
So, if you manage to implement something similar in Emacs, it should probably
behave like this (i.e. deactivate any non-default input method) for consistency.

Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
Reply | Threaded
Open this post in threaded view
|

Re: wish: right alt/meta to switch keyboard layout while pressed

Paul Pogonyshev
In reply to this post by Eugene Vlasov
Eugene Vlasov wrote:

> On Sat, Nov 26, 2005 at 12:33:23AM +0200 Paul Pogonyshev wrote:
>
> > After this, most applications handle, say `Сtrl-Ц' just like `Ctrl-W' (`Ц' and
> > `W' are on the same key.)  However, Firefox doesn't, for some reason (which pisses
> > me off a lot, BTW) and so doesn't Emacs...  No idea why.
>
> With this patch from ALTLinux distribution keybindings with Ctrl and
> Meta works for me in russian keyboard map:
>
> [patch]

Works here.  I'm not qualified to say if it is correct, but I think something
like this should be installed in the trunk.

Paul


_______________________________________________
Emacs-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/emacs-devel
123