From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.bugs Subject: bug#43830: keyboard layout handling incompatible with rest of the OS Date: Mon, 02 Nov 2020 05:41:06 +0100 Message-ID: References: <87h7r78a5y.fsf@mail.linkov.net> <87imbn2iwm.fsf@mail.linkov.net> <87y2kisawy.fsf@mail.linkov.net> <83362qa073.fsf@gnu.org> <87blhdrhww.fsf@mail.linkov.net> <83362p85l3.fsf@gnu.org> <83y2jqcrvn.fsf@gnu.org> <87blghbjpn.fsf@mail.linkov.net> <83blghf0rf.fsf@gnu.org> <83v9eoeuud.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18856"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43830@debbugs.gnu.org, Paul Pogonyshev , juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 02 05:42:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZRfY-0004ln-Gz for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Nov 2020 05:42:12 +0100 Original-Received: from localhost ([::1]:43200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZRfX-0005m0-FY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 23:42:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZRfP-0005ll-Bs for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 23:42:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZRfP-0004tC-1J for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 23:42:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kZRfN-0002ia-Tv for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 23:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Arthur Miller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2020 04:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43830 X-GNU-PR-Package: emacs Original-Received: via spool by 43830-submit@debbugs.gnu.org id=B43830.160429208110402 (code B ref 43830); Mon, 02 Nov 2020 04:42:01 +0000 Original-Received: (at 43830) by debbugs.gnu.org; 2 Nov 2020 04:41:21 +0000 Original-Received: from localhost ([127.0.0.1]:39224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZRej-0002hi-Cy for submit@debbugs.gnu.org; Sun, 01 Nov 2020 23:41:21 -0500 Original-Received: from mail-db8eur05olkn2082.outbound.protection.outlook.com ([40.92.89.82]:41616 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZRee-0002hS-Rz for 43830@debbugs.gnu.org; Sun, 01 Nov 2020 23:41:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eihOk3B4aqHIUprvFIoHy3yqVirFQrMKXIq1O/1qMVZbQkRqNtWOsNk/rJwHPfxmDXyznksh2GjdGh+tOC6xwzuPCBCvwRgm3lQO9UimH8Juk220I20Fi1zN2C0u329RvdC/qA/t008vCUEEE6/akrSVyNFoxtOHYB5Dr6jAJnVPcU+lMj8qUvSec6lQ8wlbyAP8gvqlthGOMB33TlCqen9t7V9cxiuA6t+B9f1+CsXe/6bxf1y9naOvQMA/7lNTGlFN7WBbZPQf3vHpsZsZWvQXu/jFvBfWWb27WCTxf7R7ur91geN9YUPqBgjobrIA/SvJYayin961m2kBxWHEFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eEyH7ivz7Cpcz/20f6ooflzKAnttBLtQp9Z1qF76GFg=; b=VA9gKy7DtMdUlUrd7rkyuHv/zhr1Kv+jKBuRCr/H+SVQW7q+RcfnsHsd5KOULqdWNK0Zo9Rie1Wq8mOSmtWoji3FTmkn5QW2DzTevnv1Sl6qEJ8hd5skx+0epNybzQkPTnaNlsEXRoW1MewE9jdjoHnl/d1KyQBcg+5R13uxAm+fHrMfxhjfy4aRmSwYN5bPIpAHATDET+OjWBvC1sHL9WsHXt1QRkRkRe+DTozJXNgivGX5kEv9xHHgfB8UeQ4cXtnPQ6Y1EZevDqMj1+SwouwVaK3+kh8BRqF172WqXONb0bI2zl9HQR/MTuQthqj5VoKZ+FnU69Qnvn+F46+56Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eEyH7ivz7Cpcz/20f6ooflzKAnttBLtQp9Z1qF76GFg=; b=umonql7nze+VU0Lpz0s/iT6P+vjXHMppXORYUaMj2nD4Vy4ew/+i8rl0MELp6dbPDZuKnBnwywbqh+OOtw1nk80Ud3gk3zMFhCGScjoHRXODGl2wEry0wZvCsuoawZnMR8bnt0Fjy1P6OzndSVNVb8VARczXMhZJ3bwiId3ax1VWo2JJsJk1gFURpR6SlUFgV4EtB1y00EX9L4amvmi0yV7jtoNCx8khuonmbpngHWsPatfMPwHVP3u+W9tD+uqRQ2CqXvxrGTr2eC7reQdF9rroOttyf2vsAhZoKby/QfsqitEhoKzxUljhH+PmKv1xMxT0ArL/+BQ55dX+Uajzkg== Original-Received: from DB8EUR05FT052.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::52) by DB8EUR05HT123.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::467) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15; Mon, 2 Nov 2020 04:41:10 +0000 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com (2a01:111:e400:fc0f::46) by DB8EUR05FT052.mail.protection.outlook.com (2a01:111:e400:fc0f::222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Mon, 2 Nov 2020 04:41:10 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:B9497FFC06798C0121466185A29FB40861E5F8DCE92D2ECDB5289955F99A9DBD; UpperCasedChecksum:D026C29A19E4B8C57F2B37F894C1F08F6C1571DDFEB44E6D016217E05230A6A8; SizeAsReceived:8305; Count:46 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::187b:196a:cb2d:adf1]) by VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::187b:196a:cb2d:adf1%5]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 04:41:10 +0000 In-Reply-To: <83v9eoeuud.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 01 Nov 2020 21:32:42 +0200") X-TMN: [PTPpP4bpa5nRtNwtispdk11ChcHQnSR1] X-ClientProxiedBy: AM6PR08CA0016.eurprd08.prod.outlook.com (2603:10a6:20b:b2::28) To VI1PR06MB4526.eurprd06.prod.outlook.com (2603:10a6:803:ac::17) X-Microsoft-Original-Message-ID: <87361sfk0t.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6PR08CA0016.eurprd08.prod.outlook.com (2603:10a6:20b:b2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Mon, 2 Nov 2020 04:41:07 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: bca3b7d9-8a08-4f77-a2d6-08d87ee98407 X-MS-TrafficTypeDiagnostic: DB8EUR05HT123: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FSiBtmetpvYsXRXLqbBEeuuE9mUJ2RV22WThkniE89y152IxhhEommvN+l0zMf9o8Pf1LWkg8Y5wNjCJ27jEfOShdqmhg9ASmLNRtDTB3fItDu57+bqzv4+zNHqhN6dfGRWSpq7CaS0jY50gNX8PIHezK35uWdKXkhXj1qxppLNEt7C0pHi2ztuIBUJA8GciM3yybuA4+qoaC7NLtLlI7g== X-MS-Exchange-AntiSpam-MessageData: 8yMVoHfpueuYQtl/xJjMIiWgccd5YgGVa0bUOKAWJ0Y0Ta5FVrD9kfkQd73gGM1FvUj52Tn28s6Tuia6wDyysV8cp6sKWjzIRadvKpFNdc4lZa8VPdBlA+Fh2f3nf6HBvigmDOLVKyTGzCYdFqHd/Q== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: bca3b7d9-8a08-4f77-a2d6-08d87ee98407 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2020 04:41:10.2595 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT052.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR05HT123 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192500 Archived-At: Eli Zaretskii writes: >> From: Paul Pogonyshev >> Date: Sun, 1 Nov 2020 19:56:09 +0100 >> Cc: Juri Linkov , 43830@debbugs.gnu.org >> >> > read-event will figure out by itself whether it should return the >> > ASCII character or a non-ASCII character, and return that. >> >> I'm not sure that is possible, because it doesn't really know how it >> is going to be processed. > > It knows the binding of the character, and it knows other things. > > Nothing else makes sense to me, because exposing this info to Lisp > means every Lisp program which deals with input will have to decide > what to do with such events. Couldn't Emacs just pack scancodes into some event structure similar as raw_input in windows does? But I don't think Elisp programs really would have use of scancodes anyway. Would it be possible to use scancodes for the shortcuts internally in the interpreter itself? Shortcuts could be specified by users and scripts as they are now (as keys/characters); but when Emacs starts, it could populate a lookup table based on the current layout with scancodes, and then translate shortcuts from keys to scancodes for internal usage. If user chagnes keyboard layout on the fly, new lookup table would be generated, because virtual keys would change but scancodes would stay same; so it wouldn't matter if some key jumps from one physical key to another. That wouldn't require to expose scancodes to Lisp either. But that would mean that routines for inserting text in buffers would have to work differently from shortcut handling routines, with regard to input; I don't know if that is case now or if it is possible. Is something like that possible to implement in current Emacs? Woukd it be too much work? I don't know if it is possible to automatically detect keyboard layout change in all cases. I know that Emacs automatically switches to different layout when I change keyboard with loadkeys or in vconsole.conf.