From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.bugs Subject: bug#74423: Low level key events Date: Mon, 18 Nov 2024 21:35:40 +0100 Message-ID: References: <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------NfVipp8PWcB7slQ6v5g6HUD0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13871"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 74423@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 18 21:36:29 2024 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 1tD8Tz-0003QT-W5 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Nov 2024 21:36:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tD8Te-0000JI-5v; Mon, 18 Nov 2024 15:36:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tD8Tb-0000J8-Cc for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 15:36:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tD8Tb-0001FE-4G for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 15:36:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=a1a8QH0o8R6oAjpRU4KC9Knoz2uh0QUfrNSZmZd1Rkw=; b=kbtgQBocDJE6wDEIkYTh3rpzIuao9gMFH0//myuGppgBpecFLfsGxepi6+5nXQEbnCYRRHAuXq+0DykqokOvzY459LT8lpJQS3+VozC5P/CKZQeX4J1FEUPEz1HiXRqExHd4MA8uRXqcSKPPCgFRIoA5oFSNLokQ9NtKmBFsw8rwY3B6H8lQXhz/9mTCt2r3zKiCocFcUAme4epwZ1oOCpB6HYfbCf9lSn3lZmJvYm7udd1/AG6bGCZNFqdptPCk8UnpTBxli2QT9VQ14pIadJf5pFqkmvok2hsk2J5MZx1PIBeAFPk6Wj25AgCprQPRKTLaN4qrXXEEY0Uo3/se9w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tD8Ta-0001GD-QS for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 15:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Cecilio Pardo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Nov 2024 20:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74423 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17319621564831 (code B ref -1); Mon, 18 Nov 2024 20:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Nov 2024 20:35:56 +0000 Original-Received: from localhost ([127.0.0.1]:39370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tD8TS-0001Fn-Lk for submit@debbugs.gnu.org; Mon, 18 Nov 2024 15:35:56 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:48072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tD8TP-0001Fe-96 for submit@debbugs.gnu.org; Mon, 18 Nov 2024 15:35:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tD8TP-0000IX-2a for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 15:35:51 -0500 Original-Received: from mail.imayhem.com ([82.223.54.191] helo=zealous-pike.82-223-54-191.plesk.page) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tD8TJ-0001EA-CS for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 15:35:50 -0500 Original-Received: from [192.168.68.104] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id 43ACD800CD for ; Mon, 18 Nov 2024 20:35:41 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.104] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: Received-SPF: pass client-ip=82.223.54.191; envelope-from=cpardo@imayhem.com; helo=zealous-pike.82-223-54-191.plesk.page X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295610 Archived-At: This is a multi-part message in MIME format. --------------NfVipp8PWcB7slQ6v5g6HUD0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Here is a still incomplete patch for this, renamed from "physical keyboard events", following up to https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00085.html It provides events for press/release of keys, independently of the normal keyboard events. These events are bound int the special-event-map. Some lisp is included to implement detection of multiple tapping on keys, and running commands or simulating modifiers. Currently, only modifier keys are available, because other keys would send their own normal event. This could change when an use case for other keys appears. To provide events for 'logical' modifiers Ctrl, Meta, etc., now there is a new event low-level-modifier, in addition to low-level-key. If you press Shift_L, two events will be generated, one for 'shift as low-level-modifier, and one for 'lshift as low-level-key. The lisp part handles those events separately. I added a variable that enables/disables everything, enable-low-level-key-events. This are some of Po Lu's notes on the previous patch: > [...] Emacs must not depend on XKB for such a basic feature. Fixed. > Please find some means of generating such events by saving them into the > keyboard event buffer defined in handle_ome_xevent. As we may generate two events, that is not possible. > x_filter_events is not the proper location for this call. It is only > invoked to filter an event through the active GTK or X input method > context, and it is not invoked if Emacs is configured not to open input > method contexts, or they are unavailable by happenstance. Done. If XINPUT is enabled, the XI_KeyPress event used, over the gtk one. If not, the gtk event is used unless there is no input method. In this case KeyPress event is used. The pgtk version is not updated. --------------NfVipp8PWcB7slQ6v5g6HUD0 Content-Type: text/plain; charset=UTF-8; name="0001-Add-events-for-key-press-and-key-release-on-gui-syst.patch" Content-Disposition: attachment; filename*0="0001-Add-events-for-key-press-and-key-release-on-gui-syst.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBkMjQw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ndGt1dGlsLmMgICAgICAgICB8IDEzMyArKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKwogc3JjL2tleWJvYXJkLmMgICAgICAgIHwgIDM4ICsr KysrKysrKysrCiBzcmMvcGd0a3Rlcm0uYyAgICAgICAgfCAgMzcgKysrKysrKysrKysKIHNy Yy90ZXJtaG9va3MuaCAgICAgICB8ICAgMiArCiBzcmMvdzMyZm5zLmMgICAgICAgICAgfCAg MTEgKysrKwogc3JjL3czMnRlcm0uYyAgICAgICAgIHwgIDY5ICsrKysrKysrKysrKysrKysr KysrCiBzcmMvdzMydGVybS5oICAgICAgICAgfCAgIDMgKy0KIHNyYy94dGVybS5jICAgICAg ICAgICB8IDE0NCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysK IDkgZmlsZXMgY2hhbmdlZCwgNTc3IGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkKIGNy ZWF0ZSBtb2RlIDEwMDY0NCBsaXNwL2xvdy1sZXZlbC1rZXkuZWwKCmRpZmYgLS1naXQgYS9s aXNwL2xvdy1sZXZlbC1rZXkuZWwgYi9saXNwL2xvdy1sZXZlbC1rZXkuZWwKbmV3IGZpbGUg bW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMDAwMDAuLjYzOWMwODJkYTE1Ci0tLSAvZGV2L251 bGwKKysrIGIvbGlzcC9sb3ctbGV2ZWwta2V5LmVsCkBAIC0wLDAgKzEsMTQxIEBACis7Ozsg LSotIGxleGljYWwtYmluZGluZzogdCAtKi0KKyhyZXF1aXJlICdjbC1saWIpCisKKzs7IFVz ZXIgb3B0aW9ucworKGRlZnZhciBsbGstdGFwLXRpbWVvdXQgMTAwMCkKKyhkZWZ2YXIgbGxr LXRhcC1jb3VudCAyKQorKGRlZnZhciBsbGstdGFwLWtleXMKKyAgJyhsc2hpZnQgcnNoaWZ0 IGxjdHJsIHJjdHJsIGxhbHQgcmFsdCBzaGlmdCBjdHJsIGFsdCkpCiso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m91dCBsYXN0IDJ4TiBldmVudHMKKyAg ICAgIChudGFrZSAoKiAyIG4pIGxsay1ldmVudHMpCisgICAgICA7OyBJZiB3ZSBoYXZlOgor ICAgICAgOzsgLSBFeGFjdGx5IDIgKiBuIGV2ZW50cy4KKyAgICAgIDs7IC0gZG93biwgdXAs IGRvd24sIHVwLCAuLi4KKyAgICAgIDs7IC0gbm90IHR3byBtdWNoIHRpbWUgYmV0d2VlbiBm aXJzdCBhbmQgbGFzdAorICAgICAgKGFuZCAoZXEgKCogMiBuKSAobGVuZ3RoIGxsay1ldmVu dHMpKQorICAgICAgICAgICAoY2wtZXZlcnkgJ2VxCisgICAgICAgICAgICAgICAgICAgICAo bnRha2UgKCogMiBuKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsaXN0IG5pbCB0 IG5pbCB0IG5pbCB0IG5pbCB0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bmlsIHQgbmlsIHQgbmlsIHQgbmlsIHQpKQorICAgICAgICAgICAgICAgICAgICAgKG1hcGNh ciAnY2wtc2Vjb25kIGxsay1ldmVudHMpKQorICAgICAgICAgICAoPCAoLSAoY2wtZm91cnRo IChjbC1maXJzdCBsbGstZXZlbnRzKSkKKyAgICAgICAgICAgICAgICAgKGNsLWZvdXJ0aCAo Y2FyIChsYXN0IGxsay1ldmVudHMpKSkpCisgICAgICAgICAgICAgIHRpbWVvdXQpCisgICAg ICAgICAgIChwcm9nbgorICAgICAgICAgICAgIChzZXRxIGxsay1ldmVudHMgbmlsKQorICAg ICAgICAgICAgIGtleSkpKSkpCisKKworOzsgdGhpcyBmdW5jdGlvbiBpcyBhIGNvcHkgb2Yg bGxrLWRldGVjdC1uLXRhcCwgYnV0IGZvciBsbG0tZXZlbnRzCisoZGVmdW4gbGxtLWRldGVj dC1uLXRhcCAobiB0aW1lb3V0KQorICAobGV0ICgoa2V5IChjbC10aGlyZCBsYXN0LWlucHV0 LWV2ZW50KSkpCisgICAgKGlmIChub3QgKG1lbWJlciBrZXkgbGxrLXRhcC1rZXlzKSkKKyAg ICAgICAgKHNldHEgbGxtLWV2ZW50cyBuaWwpCisgICAgICAoYW5kIGxsbS1ldmVudHMKKyAg ICAgICAgICAgKG5vdCAoZXF1YWwgKGNsLXRoaXJkIChjYXIgbGxtLWV2ZW50cykpIGtleSkp CisgICAgICAgICAgIChzZXRxIGxsbS1ldmVudHMgbmlsKSkKKyAgICAgIChwdXNoIGxhc3Qt aW5wdXQtZXZlbnQgbGxtLWV2ZW50cykKKyAgICAgIChudGFrZSAoKiAyIG4pIGxsbS1ldmVu dHMpCisgICAgICAoYW5kIChlcSAoKiAyIG4pIChsZW5ndGggbGxtLWV2ZW50cykpCisgICAg ICAgICAgIChjbC1ldmVyeSAnZXEKKyAgICAgICAgICAgICAgICAgICAgIChudGFrZSAoKiAy IG4pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxpc3QgbmlsIHQgbmlsIHQgbmls IHQgbmlsIHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuaWwgdCBuaWwg dCBuaWwgdCBuaWwgdCkpCisgICAgICAgICAgICAgICAgICAgICAobWFwY2FyICdjbC1zZWNv bmQgbGxtLWV2ZW50cykpCisgICAgICAgICAgICg8ICgtIChjbC1mb3VydGggKGNsLWZpcnN0 IGxsbS1ldmVudHMpKQorICAgICAgICAgICAgICAgICAoY2wtZm91cnRoIChjYXIgKGxhc3Qg bGxtLWV2ZW50cykpKSkKKyAgICAgICAgICAgICAgdGltZW91dCkKKyAgICAgICAgICAgKHBy b2duCisgICAgICAgICAgICAgKHNldHEgbGxtLWV2ZW50cyBuaWwpCisgICAgICAgICAgICAg a2V5KSkpKSkKKworKGRlZnVuIGxsay1oYW5kbGUgKCkKKyAgKGludGVyYWN0aXZlKQorCisg IChsZXQgKCh0YXAta2V5IChsbGstZGV0ZWN0LW4tdGFwCisgICAgICAgICAgICAgICAgICBs bGstdGFwLWNvdW50CisgICAgICAgICAgICAgICAgICBsbGstdGFwLXRpbWVvdXQpKSkKKyAg ICAod2hlbiB0YXAta2V5CisgICAgICAobGV0ICgoZnVuYyAoY2wtdGhpcmQKKyAgICAgICAg ICAgICAgICAgICAoc2VxLWZpbmQKKyAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoYikK KyAgICAgICAgICAgICAgICAgICAgICAoYW5kIChlcSAoY2wtZmlyc3QgYikgJ3RhcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIChlcSAoY2wtc2Vjb25kIGIpIHRhcC1rZXkpKSkK KyAgICAgICAgICAgICAgICAgICAgbGxrLWJpbmRpbmdzKSkpKQorICAgICAgICAoY29uZAor ICAgICAgICAgKChjb21tYW5kcCBmdW5jKSAoY2FsbC1pbnRlcmFjdGl2ZWx5IGZ1bmMpKQor ICAgICAgICAgKChmdW5jdGlvbnAgZnVuYykgKGZ1bmNhbGwgZnVuYykpCisgICAgICAgICAo KGVxICdoeXBlciBmdW5jKQorICAgICAgICAgIChtZXNzYWdlICJILS4uLiIpCisgICAgICAg ICAgKGxldCAoKHIgKHJlYWQtZXZlbnQpKSkKKyAgICAgICAgICAgIChzZXRxIHVucmVhZC1j b21tYW5kLWV2ZW50cworICAgICAgICAgICAgICAgICAgKGxpc3QgKGV2ZW50LWFwcGx5LW1v ZGlmaWVyCisgICAgICAgICAgICAgICAgICAgICAgICAgciAnaHlwZXIgMjQgIkgtIikpKSkp KSkpKSkKKworKGRlZnVuIGxsbS1oYW5kbGUoKQorICAoaW50ZXJhY3RpdmUpCisKKyAgKGxl dCAoKHRhcC1rZXkgKGxsbS1kZXRlY3Qtbi10YXAKKyAgICAgICAgICAgICAgICAgIGxsay10 YXAtY291bnQKKyAgICAgICAgICAgICAgICAgIGxsay10YXAtdGltZW91dCkpKQorICAgICh3 aGVuIHRhcC1rZXkKKyAgICAgIChsZXQgKChmdW5jIChjbC10aGlyZAorICAgICAgICAgICAg ICAgICAgIChzZXEtZmluZAorICAgICAgICAgICAgICAgICAgICAobGFtYmRhIChiKQorICAg ICAgICAgICAgICAgICAgICAgIChhbmQgKGVxIChjbC1maXJzdCBiKSAndGFwKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGVxIChjbC1zZWNvbmQgYikgdGFwLWtleSkpKQorICAg ICAgICAgICAgICAgICAgICBsbG0tYmluZGluZ3MpKSkpCisgICAgICAgIChjb25kCisgICAg ICAgICAoKGNvbW1hbmRwIGZ1bmMpIChjYWxsLWludGVyYWN0aXZlbHkgZnVuYykpCisgICAg ICAgICAoKGZ1bmN0aW9ucCBmdW5jKSAoZnVuY2FsbCBmdW5jKSkKKyAgICAgICAgICgoZXEg J2h5cGVyIGZ1bmMpCisgICAgICAgICAgKG1lc3NhZ2UgIkgtLi4uIikKKyAgICAgICAgICAo bGV0ICgociAocmVhZC1ldmVudCkpKQorICAgICAgICAgICAgKHNldHEgdW5yZWFkLWNvbW1h bmQtZXZlbnRzCisgICAgICAgICAgICAgICAgICAobGlzdCAoZXZlbnQtYXBwbHktbW9kaWZp ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICByICdoeXBlciAyNCAiSC0iKSkpKSkpKSkp KQpkaWZmIC0tZ2l0IGEvc3JjL2d0a3V0aWwuYyBiL3NyYy9ndGt1dGlsLmMKaW5kZXggZDU3 NjI3ZjE1MmYuLjZjYTRlMzEzOTI5IDEwMDY0NAotLS0gYS9zcmMvZ3RrdXRpbC5jCisrKyBi L3NyYy9ndGt1dGlsLmMKQEAgLTk4LDYgKzk4LDcgQEAgR19ERUZJTkVfVFlQRSAoRW1hY3NN ZW51QmFyLCBlbWFjc19tZW51X2JhciwgR1RLX1RZUEVfTUVOVV9CQVIpCiBzdGF0aWMgdm9p ZCB4Z19pbV9jb250ZXh0X3ByZWVkaXRfY2hhbmdlZCAoR3RrSU1Db250ZXh0ICosIGdwb2lu dGVyKTsKIHN0YXRpYyB2b2lkIHhnX2ltX2NvbnRleHRfcHJlZWRpdF9lbmQgKEd0a0lNQ29u dGV4dCAqLCBncG9pbnRl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Bpc19wcmVzczsKKyAgaW50IGtleXN5bTsKKyAgTGlzcF9PYmplY3Qga2V5 LCBtb2RpZmllcjsKKyAgdW5pb24gYnVmZmVyZWRfaW5wdXRfZXZlbnQgaW5ldjsKKworICBp ZiAoIVZlbmFibGVfbG93X2xldmVsX2tleV9ldmVudHMpCisgICAgcmV0dXJuOworICBzd2l0 Y2ggKHhldi0+dHlwZSkKKyAgICB7CisgICAgY2FzZSBHREtfS0VZX1BSRVNTOgorICAgICAg aXNfcHJlc3MgPSB0cnVlOworICAgICAgYnJlYWs7CisgICAgY2FzZSBHREtfS0VZX1JFTEVB U0U6CisgICAgICBpc19wcmVzcyA9IGZhbHNlOworICAgICAgYnJlYWs7CisgICAgZGVmYXVs dDoKKyAgICAgIHJldHVybjsKKyAgICB9CisKKyAga2V5c3ltID0geGtleS5rZXl2YWw7CisK KyAgc3dpdGNoIChrZXlzeW0pCisgICAgeworICAgIGNhc2UgR0RLX0tFWV9TaGlmdF9MOiBr ZXkgPSBRbHNoaWZ0OyBicmVhazsKKyAgICBjYXNlIEdES19LRVlfU2hpZnRfUjoga2V5ID0g UXJzaGlmdDsgYnJlYWs7CisgICAgY2FzZSBHREtfS0VZX0NvbnRyb2xfTDoga2V5ID0gUWxj dHJsOyBicmVhazsKKyAgICBjYXNlIEdES19LRVlfQ29udHJvbF9SOiBrZXkgPSBRcmN0cmw7 IGJyZWFrOworICAgIGNhc2UgR0RLX0tFWV9BbHRfTDoga2V5ID0gUWxhbHQ7IGJyZWFrOwor ICAgIGNhc2UgR0RLX0tFWV9BbHRfUjoga2V5ID0gUXJhbHQ7IGJyZWFrOworICAgIGRlZmF1 bHQ6CisgICAgICBrZXkgPSBRbmlsOworICAgIH0KKworICAgc3dpdGNoIChrZXlzeW0pCisg ICAgeworICAgIGNhc2UgR0RLX0tFWV9TaGlmdF9MOgorICAgIGNhc2UgR0RLX0tFWV9TaGlm dF9SOgorICAgICAgbW9kaWZpZXIgPSBRc2hpZnQ7CisgICAgICBicmVhazsKKyAgICBjYXNl IEdES19LRVlfQ29udHJvbF9MOgorICAgIGNhc2UgR0RLX0tFWV9Db250cm9sX1I6CisgICAg ICBtb2RpZmllciA9IFZ4X2N0cmxfa2V5c3ltOworICAgICAgaWYgKE5JTFAgKG1vZGlmaWVy KSkKKwltb2RpZmllciA9IFFjdHJsOworICAgICAgYnJlYWs7CisgICAgY2FzZSBHREtfS0VZ X0FsdF9MOgorICAgIGNhc2UgR0RLX0tFWV9BbHRfUjoKKyAgICAgIG1vZGlmaWVyID0gVnhf bWV0YV9rZXlzeW07CisgICAgICBpZiAoTklMUCAobW9kaWZpZXIpKQorCW1vZGlmaWVyID0g UWFsdDsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0RLX0tFWV9NZXRhX0w6CisgICAgY2Fz ZSBHREtfS0VZX01ldGFfUjoKKyAgICAgIG1vZGlmaWVyID0gVnhfbWV0YV9rZXlzeW07Cisg ICAgICBpZiAoTklMUCAobW9kaWZpZXIpKQorCW1vZGlmaWVyID0gUW1ldGE7CisgICAgICBi cmVhazsKKyAgICBjYXNlIEdES19LRVlfSHlwZXJfTDoKKyAgICBjYXNlIEdES19LRVlfSHlw ZXJfUjoKKyAgICAgIG1vZGlmaWVyID0gVnhfaHlwZXJfa2V5c3ltOworICAgICAgaWYgKE5J TFAgKG1vZGlmaWVyKSkKKwltb2RpZmllciA9IFFoeXBlcjsKKyAgICAgIGJyZWFrOworICAg IGNhc2UgR0RLX0tFWV9TdXBlcl9MOgorICAgIGNhc2UgR0RLX0tFWV9TdXBlcl9SOgorICAg ICAgbW9kaWZpZXIgPSBWeF9zdXBlcl9rZXlzeW07CisgICAgICBpZiAoTklMUCAobW9kaWZp ZXIpKQorCW1vZGlmaWVyID0gUXN1cGVyOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoK KyAgICAgIG1vZGlmaWVyID0gUW5pbDsKKyAgICB9CisKKyAgaWYgKCFOSUxQIChrZXkpKQor ICAgIHsKKyAgICAgIEVWRU5U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gYnJlYWs7CisJCWNhc2Ug VktfUk1FTlU6IGtleSA9IFFyYWx0OyBicmVhazsKKwkJfQorCisJICAgICAgc3dpdGNoICh2 aykKKwkJeworCQljYXNlIFZLX0xTSElGVDoKKwkJY2FzZSBWS19SU0hJRlQ6CisJCSAgbW9k aWZpZXIgPSBRc2hpZnQ7CisJCSAgYnJlYWs7CisJCWNhc2UgVktfTENPTlRST0w6CisJCWNh c2UgVktfUkNPTlRST0w6CisJCSAgbW9kaWZpZXIgPSBRY3RybDsKKwkJICBicmVhazsKKwkJ Y2FzZSBWS19MTUVOVToKKwkJY2FzZSBWS19STUVOVToKKwkJICBtb2RpZmllciA9IFFtZXRh OworCQkgIGJyZWFrOworCQl9CisKKwkgICAgICBpZiAoIU5JTFAgKGtleSkpCisJCXsKKwkJ ICBmID0gdzMyX3dpbmRvd190b19mcmFtZSAoZHB5aW5mbywgbXNnLm1zZy5od25kKTsKKwkJ ICBpbmV2LmtpbmQgPSBMT1dfTEVWRUxfS0VZX0VWRU5UOworCQkgIFhTRVRGUkFNRSAoaW5l di5mcmFtZV9vcl93aW5kb3csIGYpOworCQkgIGluZXYudGltZXN0YW1wID0gbXNnLm1zZy50 aW1lOworCQkgIGluZXYuYXJnID0gbGlzdDIgKGlzX3dtX2tleXVwID8gUW5pbCA6IFF0LCBr ZXkpOworCQkgIGtiZF9idWZmZXJfc3RvcmVfZXZlbnRfaG9sZCAoJmluZXYsIGhvbGRfcXVp dCk7CisKKwkJfQorCisJICAgICAgaWYgKCFOSUxQIChtb2RpZmllcikpCisJCXsKKwkJICBm ID0gdzMyX3dpbmRvd190b19mcmFtZSAoZHB5aW5mbywgbXNnLm1zZy5od25kKTsKKwkJICBp bmV2LmtpbmQgPSBMT1dfTEVWRUxfTU9ESUZJRVJfS0VZX0VWRU5UOworCQkgIFhTRVRGUkFN RSAoaW5ldi5mcmFtZV9vcl93aW5kb3csIGYpOworCQkgIGluZXYudGltZXN0YW1wID0gbXNn Lm1zZy50aW1lOworCQ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AgICAgIFhJRGV2aWNlRXZlbnQgKnhp ZXYgPSB4ZXYtPnhjb29raWUuZGF0YTsKKyAgICAgIHN3aXRjaCAoeGV2LT54Z2VuZXJpYy5l dnR5cGUpCisJeworCWNhc2UgWElfS2V5UHJlc3M6CisJICBpc19wcmVzcyA9IHRydWU7CisJ ICBicmVhazsKKwljYXNlIFhJX0tleVJlbGVhc2U6CisJICBpc19wcmVzcyA9IGZhbHNlOwor CSAgYnJlYWs7CisJZGVmYXVsdDoKKwkgIHJldHVybjsKKwl9CisKKyAgICAgIHhrZXkuc2Vy aWFsID0geGlldi0+c2VyaWFsOworICAgICAgeGtleS5zZW5kX2V2ZW50ID0geGlldi0+c2Vu ZF9ldmVudDsKKyAgICAgIHhrZXkuZGlzcGxheSA9IHhpZXYtPmRpc3BsYXk7CisgICAgICB4 a2V5LndpbmRvdyA9IHhpZXYtPmV2ZW50OworICAgICAgeGtleS5yb290ID0geGlldi0+cm9v dDsKKyAgICAgIHhrZXkuc3Vid2luZG93ID0geGlldi0+Y2hpbGQ7CisgICAgICB4a2V5LnRp bWUgPSB4aWV2LT50aW1lOworICAgICAgeGtleS54ID0geGlldi0+ZXZlbnRfeDsKKyAgICAg IHhrZXkueSA9IHhpZXYtPmV2ZW50X3k7CisgICAgICB4a2V5Lnhfcm9vdCA9IHhpZXYtPnJv b3RfeDsKKyAgICAgIHhrZXkueV9yb290ID0geGlldi0+cm9vdF95OworICAgICAgeGtleS5z dGF0ZSA9IHhpZXYtPm1vZHMuZWZmZWN0aXZlOworICAgICAgeGtleS5rZXljb2RlID0geGll di0+ZGV0YWlsOworICAgICAgeGtleS5zYW1lX3NjcmVlbiA9IDE7CisgICAgICBicmVhazsK KyNlbmRpZgorICAgIGRlZmF1bHQ6CisgICAgICByZXR1cm47CisgICAgfQorCisgIHN0cnVj dCBmcmFtZSAqZiA9IHhfYW55X3dpbmRvd190b19mcmFtZSAoZHB5aW5mbywgeGtleS53aW5k b3cpOworICBpZiAoIWYpCisgICAgcmV0dXJuOworCisgIFhMb29rdXBTdHJpbmcgKCZ4a2V5 LCBOVUxMLCAwLCAma2V5c3ltLCBOVUxMKTsKKworICBzd2l0Y2ggKGtleXN5bSkKKyAgICB7 CisgICAgY2FzZSBYS19TaGlmdF9MOiBrZXkgPSBRbHNoaWZ0OyBicmVhazsKKyAgICBjYXNl IFhLX1NoaWZ0X1I6IGtleSA9IFFyc2hpZnQ7IGJyZWFrOworICAgIGNhc2UgWEtfQ29udHJv bF9MOiBrZXkgPSBRbGN0cmw7IGJyZWFrOworICAgIGNhc2UgWEtfQ29udHJvbF9SOiBrZXkg PSBRcmN0cmw7IGJyZWFrOworICAgIGNhc2UgWEtfQWx0X0w6IGtleSA9IFFsYWx0OyBicmVh azsKKyAgICBjYXNlIFhLX0FsdF9SOiBrZXkgPSBRcmFsdDsgYnJlYWs7CisgICAgZGVmYXVs dDoKKyAgICAgIGtleSA9IFFuaWw7CisgICAgfQorCisgICBzd2l0Y2ggKGtleXN5bSkKKyAg ICB7CisgICAgY2FzZSBYS19TaGlmdF9MOgorICAgIGNhc2UgWEtfU2hpZnRfUjoKKyAgICAg IG1vZGlmaWVyID0gUXNoaWZ0OworICAgICAgYnJlYWs7CisgICAgY2FzZSBYS19Db250cm9s X0w6CisgICAgY2FzZSBYS19Db250cm9sX1I6CisgICAgICBtb2RpZmllciA9IFZ4X2N0cmxf a2V5c3ltOworICAgICAgaWYgKE5JTFAgKG1vZGlmaWVyKSkKKwltb2RpZmllciA9IFFjdHJs OworICAgICAgYnJlYWs7CisgICAgY2FzZSBYS19BbHRfTDoKKyAgICBjYXNlIFhLX0FsdF9S OgorICAgICAgbW9kaWZpZXIgPSBWeF9tZXRhX2tleXN5bTsKKyAgICAgIGlmIChOSUxQICht b2RpZmllcikpCisJbW9kaWZpZXIgPSBRYWx0OworICAgICAgYnJlYWs7CisgICAgY2FzZSBY S19NZXRhX0w6CisgICAgY2FzZSBYS19NZXRhX1I6CisgICAgICBtb2RpZmllciA9IFZ4X21l dGFfa2V5c3ltOworICAgICAgaWYgKE5JTFAgKG1vZGlmaWVyKSkKKwltb2RpZmllciA9IFFt ZXRhOworICAgICAgYnJlYWs7CisgICAgY2FzZSBYS19IeXBlcl9MOgorICAgIGNhc2UgWEtf SHlwZXJfUjoKKyAgICAgIG1vZGlmaWVyID0gVnhfaHlwZXJfa2V5c3ltOworICAgICAgaWYg KE5JTFAgKG1vZGlmaWVyKSkKKwltb2RpZmllciA9IFFoeXBlcjsKKyAgICAgIGJyZWFrOwor ICAgIGNhc2UgWEtfU3VwZXJfTDoKKyAgICBjYXNlIFhLX1N1cGVyX1I6CisgICAgICBtb2Rp ZmllciA9IFZ4X3N1cGVyX2tleXN5bTsKKyAgICAgIGlmIChOSUxQIChtb2RpZmllcikpCisJ bW9kaWZpZXIgPSBRc3VwZXI7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAg bW9kaWZpZXIgPSBRbmlsOworICAgIH0KKworICBpZiAoIU5JTFAgKGtleSkpCisgICAgewor ICAgICAgRVZFTlRfSU5JVCAoaWUpOworICAgICAgWFNFVEZSQU1FIChpZS5mcmFtZV9vcl93 aW5kb3csIGYpOworICAgICAgaWUua2luZCA9IExPV19MRVZFTF9LRVlfRVZFTlQ7CisgICAg ICBpZS50aW1lc3RhbXAgPSB4a2V5LnRpbWU7CisgICAgICBpZS5hcmcgPSBsaXN0MiAoaXNf cHJlc3MgPyBRdCA6IFFuaWwsIGtleSk7CisgICAgICBrYmRfYnVmZmVyX3N0b3JlX2V2ZW50 ICgmaWUpOworICAgIH0KKworICBpZiAoIU5JTFAgKG1vZGlmaWVyKSkKKyAgICB7CisgICAg ICBFVkVOVF9JTklUIChpZSk7CisgICAgICBYU0VURlJBTUUgKGllLmZyYW1lX29yX3dpbmRv dywgZik7CisgICAgICBpZS5raW5kID0gTE9XX0xFVkVMX01PRElGSUVSX0tFWV9FVkVOVDsK KyAgICAgIGllLnRpbWVzdGFtcCA9IHhrZXkudGltZTsKKyAgICAgI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