From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Ignoring keyboard modes for key chords Date: Sun, 16 Oct 2016 10:09:33 +0300 Message-ID: <8360os22j6.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1476601845 28232 195.159.176.226 (16 Oct 2016 07:10:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Oct 2016 07:10:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 16 09:10:41 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvfaG-0003F9-VA for ged-emacs-devel@m.gmane.org; Sun, 16 Oct 2016 09:10:13 +0200 Original-Received: from localhost ([::1]:55310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvfaJ-0003NO-2r for ged-emacs-devel@m.gmane.org; Sun, 16 Oct 2016 03:10:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvfZi-00031D-TV for emacs-devel@gnu.org; Sun, 16 Oct 2016 03:09:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvfZf-0007EL-KK for emacs-devel@gnu.org; Sun, 16 Oct 2016 03:09:38 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvfZf-0007EF-HD; Sun, 16 Oct 2016 03:09:35 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1867 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bvfZe-0006QE-Nt; Sun, 16 Oct 2016 03:09:35 -0400 In-reply-to: (message from Yuri Khan on Sun, 16 Oct 2016 12:45:52 +0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208321 Archived-At: > From: Yuri Khan > Date: Sun, 16 Oct 2016 12:45:52 +0600 > > On at least some platforms and toolkits (observed on > Gtk+/X11/GNU/Linux), pressing a key chord such as C-s while a > non-Latin keyboard layout is active produces an event with the correct > modifiers but the base character interpreted according to that layout. > For example: > > $ setxkbmap en,ru , grp:ctrl_shift_toggle > $ emacs -Q > Ctrl+Shift > Ctrl+s > ⇒ C-ы is undefined This problem doesn't exist on MS-Windows, FWIW. > ## Expected behavior > > The general expectation among users is that the base key in a chord > should be interpreted according to the installed Latin layout. In the > above example, Ctrl+s should produce C-s, even though the Russian > layout is active. Why is this expected to be solved by Emacs, and not by some option on the level of the OS keyboard driver? I'm guessing that doing this in Emacs would require messing with low-level keyboard interfaces, something Emacs is better off without, IMO. Moreover, the expected behavior, if implemented in Emacs, will have at least 2 disadvantages: . it will disallow keystrokes with modifiers that use non-ASCII characters, such as C-ы . it will not solve the case of multi-key sequences, such as "C-x ы" . it may not be possible at all on a TTY, or at least I expect the problems there to be more prominent, since on many terminals M-x is sent to Emacs as "ESC x", which are 2 keys So it could only be a partial solution at best. I would expect solutions for this to exist already for GNU/Linux and other free OSes, isn't that so? If such solutions exist, why not use them instead? > 2: It may not be possible to confidently detect layout-based > reinterpretation after the fact. For example, using the above en,ru > example, pressing C-/ while the Russian layout is active will generate > a C-. event. Isn't there an X event already that announces the keyboard layout change? There is such an event on Windows, and Emacs already includes support for it, albeit only in the Windows build.