From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: New key binding syntax Date: Fri, 5 Nov 2021 15:56:26 +0700 Message-ID: References: <20211004081724.6281.11798@vcs0.savannah.gnu.org> <1763939.ehZidYVhZF@galex-713.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11572"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Richard Stallman , Emacs developers To: Alexandre Garreau Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 05 09:57:43 2021 Return-path: Envelope-to: ged-emacs-devel@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 1miv2d-0002lh-8F for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 09:57:43 +0100 Original-Received: from localhost ([::1]:39564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miv2b-0007v1-Ot for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 04:57:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miv1d-0007EB-JH for emacs-devel@gnu.org; Fri, 05 Nov 2021 04:56:41 -0400 Original-Received: from mail-ua1-x92f.google.com ([2607:f8b0:4864:20::92f]:45895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1miv1b-0007qG-Uh; Fri, 05 Nov 2021 04:56:41 -0400 Original-Received: by mail-ua1-x92f.google.com with SMTP id ay21so15750688uab.12; Fri, 05 Nov 2021 01:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=K/nze4U4TzvX59fxd08QNJ7JaOqFbrrZSkRSII1UAwU=; b=XUIVbHUR6vi3GInj7f09K9xZ03taBdLw8BFRYO0XmQfWOOjls0Yk3Rfa8uvZneoDnb 5qvNt3W+Ow7RrVXsGHxGetkrWSwNlyuKWc3RFrKExMm6ZLKmgiuL8TW0xRtt8WpyjfSb 4F+J/buWxFYWLQogOnpAp/QQ6LPrLa+GyTin2myYHr8N3vCmyWrSO47KAne7P7Nk1AHY P/7aQqqyK9mRx5VWIwEfv1RT1Y7jkjbprXolecQj7cTiedsnIUgPgDgUqJ70Bp6j6ARV ZJuv0q+oNFLiT2tazApyuK3Y6UTZqaGXiA/3yP88yeRAfk4CYi2H/uluKQLS32x9ZVIu nJHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=K/nze4U4TzvX59fxd08QNJ7JaOqFbrrZSkRSII1UAwU=; b=YAcjVmQ40ipbP3wXUCQmhjEmykgzY5+1ghZStDI/hWv2DEH997gfHVlTndijUg3uSo nky623k8vxv19BVmCoF6Y/emNIcw1oQJAMjgjW7BCfvrNRvjcJShjAvPMy7tMCrp6pCv EJfYgiiGs2dldnEtRcLLzEjdwJyXvfVtxT0kBnIfDGL6YKdjuvjW+G3aOv3WY97EaFR5 3EqpZQgNJN6oPI3dKA4nz/HHayk6I5iaU75kH5TKg3VrYo6L7fmUyVqzhInV/a0Z3D4W V3/IDRFF8lpu8SoV1z5nB+8awsBTwRTajrgotOm9RqxbnmwEjCksT3rERmReOYEp6oxn xh5w== X-Gm-Message-State: AOAM533DQLcSut8b1KPmhqkX8jw0R05MsWQhoqAlmxlDrf+8R/kQseKV NN+OB6jP1zfRijSeMtjqc8apX9AYIaC55oqoQV9QukBUHS/N0g== X-Google-Smtp-Source: ABdhPJwMWK7Xh21UvI1XS5k/VKNI48q3l+7BZz5zd9s5exnQ0mftuuTKQWWbH0a0Fp0LTJsqEzNYtgxJDTfQuDh9W0Q= X-Received: by 2002:a67:c310:: with SMTP id r16mr53057216vsj.31.1636102598500; Fri, 05 Nov 2021 01:56:38 -0700 (PDT) In-Reply-To: <1763939.ehZidYVhZF@galex-713.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::92f; envelope-from=yurivkhan@gmail.com; helo=mail-ua1-x92f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278751 Archived-At: On Fri, 5 Nov 2021 at 13:08, Alexandre Garreau wro= te: > > The rollover behavior works entirely on the application side, where > > the OS and the GUI toolkit send events like =E2=80=9Cthe key at positio= n AB02 > > was pressed while the left Alt is down; by the way, the character for > > this key in the current layout is x=E2=80=9D. If the application reacts= to key > > press and autorepeat events and takes the character and modifiers from > > them immediately, the =E2=80=9CAC01 down (char a), AB05 down (char b), = AC01 up > > (char a), AB05 up (char b)=E2=80=9D sequence results in an =E2=80=9Ca t= hen b=E2=80=9D text > > input. But some applications (notably games) just track the whole bit > > array of keys. > > But what happens after 7 consecutive down on a typical keyboard then? Technically what happens in that highly theoretical example depends on the firmware implementation; in the USB protocol, there is provision for the keyboard reporting =E2=80=9Cthe user held down so many keys I can= =E2=80=99t accurately report them all=E2=80=9D. > why this limitation since each key succeeds the previous one? Each key does not =E2=80=9Csucceed=E2=80=9D the previous one. Keyboards are= not only used for text input but also for gaming and (rarely, with advanced users) chord input, and they must be able to report at least a few keys held down simultaneously, and the exact moment they are released. In a game, it=E2=80=99s not an unusual situation that you hold down one key= to crouch, another to keep moving (crawling?) forward, and a third one to turn left or right, while periodically pressing a fourth key to fire. If the keyboard reports the release too early, you stand back up, and your enemies notice you. The limitation is about the keyboard state report having a manageable size. With this particular format, the 8 modifiers are reported as a bit mask in a single byte, then there is a mostly reserved byte, then 6 bytes contain the codes of keys currently held down.