From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Android port of Emacs Date: Fri, 07 Jul 2023 10:46:50 +0800 Message-ID: <87a5w8igkl.fsf@yahoo.com> References: 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="19375"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Ant Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 07 04:48:12 2023 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 1qHbW0-0004vm-Lg for ged-emacs-devel@m.gmane-mx.org; Fri, 07 Jul 2023 04:48:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHbUx-0000yW-Ag; Thu, 06 Jul 2023 22:47:07 -0400 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 1qHbUt-0000y6-UR for emacs-devel@gnu.org; Thu, 06 Jul 2023 22:47:04 -0400 Original-Received: from sonic317-33.consmr.mail.ne1.yahoo.com ([66.163.184.44]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHbUr-00042G-KX for emacs-devel@gnu.org; Thu, 06 Jul 2023 22:47:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1688698019; bh=sx5ITvK9Xv9S2J19Cuusst1BCMplx+xSnbEfIkLWZF4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=H9boeR5MmiUVzU5ly188RVmZ0YYQDPvScqPjYhC5OrvlgrJkzk3MrYSzuZ2pGPs9weHkP+//PqNlJ0VVo7ppoh56SKo6yisuccC0EWr76CxAcl/QJL+rii4WyWkRx3pjaAM1bElD4YxaEbikthBUuFzb/8vTLYELT2viFPAQlVW1hIiLN5iRJZLD2z7shMNNZlD0YkMCOGEc7IE15LPXxKDd2UkuXO2OMqU7hzhPcj3B4zKBedSRexgj7hIX10GIiMDWdGMYhFVf1HabNz9bE4iziYf+TLqKh/1d9PciBM5SkuLew2jTbWPbT67eRpnWo7enKrzba9z3DDnKriIozQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1688698019; bh=dVANHDzwJE8Webe8NXC/5z9Q2+98JzVVNzdpRVEa+u2=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=YRo8ha4+GwPeh0BvH8oTMemJtgV5c0/e2LXNr5y1WudtG3erwVvBIMr9MC24wuJkA5Q574hunAvojQ2Mm+AF8RCOqY4mkV80mD/tERlx0k+YLR07DVAI/ygqXtktjvakxTQ7L07t/FkVC+F79LuySt4YDyJJWVOXh441lJ4989IfcKJGuRI40mw3k+e/BmQrknPf9op3KkL40fSU/+psBbfDv7BrvM25TZhxZ+8UUy86yigOiVdlDgrF1mBvoXapTeSq/c52VFB5hx73GmgRLfx9BoDA4SuuibZ0vNjOzGpJjoVrCxQUByWPkho80pNisvv+vQn5NfYa8WWWg/BkQg== X-YMail-OSG: Dv7TfnwVM1l10HZpKZqa10jHghKQA7HbfSv8AUPVQRW3zl9HyE8QoH5kaCAcmWl S0y1GAqKwkRbg5bK4bSOcbeouMYzDi2AX1a1DeM7FNjdNmxo4FdI1A3UWB3ZQftIFkTs.SJ4MAml UZ_NWpWbWLb6CVtuJgGNr6vF1VpgMNh7VNxyHduoaiG5JgwROPjzRTWOMGaUfscOZeGnnE2jNdBE _.mJ4Zeip9WJLq_THInTqFv7vj8RYmyjmmZylS8aNFjOndX8Pk19l.6.5pp2cZWeLf771NQk3X2r _62wUpYrDWX2SLTBMI7HZI8kLwMq5isz83QOcGJoOXSL51lGCBwPyTYnRE0KcY3yxzwZa7Ox.QTq UG4GKHsvFBbUiflQXq9nFGrD3QQDfsRI0vJNn6hHm4N4qDZIsHCp10CIzpzMZI5ilbsJO1t2EV_t vpA_PHTjkcDigDMHsXiIJgduJcPQyM7p.qI6Ac96ms9NxmafodiuBxPVeFvX4Fe5AjqxoDIOJ4eB ACjAwt3YsdkkjsgC2HaTSq2sVq7704acPGhd6zYIkDXPZFlYZf.C0cV3TDt0bbFNkBrijnSqIccH 4aXYYnKPaKE.js0e6j3SzwpW6quE4B.4actdWe6ZxfjuSoH3ZnpGRJf2TcKTW_vDUkRVCypZWxm0 e.th.mr5RPwCYvGoh2phhSmAuOEy9pJpG5lBbunXQW8yw8MhciDNUMsJAXXam9ZZFZ1MXr8PJ3U. 3D87yTwe2DthoOUhQM8zucI.P2NyHSonWUDKRoMwbE2Wd2v48JXSkjJBzxNXNz_ZHOR_.tZNPUZ5 w8F9PGy55GDXuXHhDc7Yh09J5wS8BcYkD6HAyKHU8Z X-Sonic-MF: X-Sonic-ID: c560c0d7-3f3b-4e62-966f-aa448c2ef274 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Fri, 7 Jul 2023 02:46:59 +0000 Original-Received: by hermes--production-sg3-67fd64777-txbf9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 9d3bcce9cb4871f839bab544309d7538; Fri, 07 Jul 2023 02:46:54 +0000 (UTC) In-Reply-To: (Ant's message of "Thu, 6 Jul 2023 17:48:01 +0200") X-Mailer: WebService/1.1.21638 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.184.44; envelope-from=luangruo@yahoo.com; helo=sonic317-33.consmr.mail.ne1.yahoo.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307541 Archived-At: Ant writes: > * Po Lu: > >> I think I will look into providing modifier keys using the tool bar. > > > Thank you for the addition. They for sure make Emacs for Android (or > handheld devices in general) much more comfortable to use. > > The fact that having a modifier on temporarily overrides the text > conversion style is very handy. I'd like to have modifiers on physical > keys too, so I chose to re-use some of your functions: > > (define-key local-function-key-map (kbd "") > #'tool-bar-event-apply-meta-modifier) > > (define-key local-function-key-map (kbd "") > #'tool-bar-event-apply-control-modifier) > > And it works good, except when I want both modifiers on: pressing > and then is recognized as M-.=C2=A0 > The tool-bar-apply-modifiers function does address this issue and in > fact it is possible to activate multiple modifiers through the new > tool bar feature, but I'm unable to dig further and try to make it fit > with physical keys. > > I just wanted to address this for everyone who wants to insert > modifiers on Emacs for Android. And also, thank you again Po Lu for > the addition. The key to applying multiple modifier keys simultaneously is this part of the function `modifier-bar-buttons': (let* ((modifiers init-modifier-list) event1 (overriding-text-conversion-style nil) (event (read-event))) ;; Combine any more modifier key presses. (while (eq event 'tool-bar) (setq event1 (event-basic-type (read-event))) ;; Reject unknown tool bar events. (unless (memq event1 '(alt super hyper shift control meta)) (user-error "Unknown tool-bar event %s" event1)) ;; If `event' is the name of a modifier key, apply that ;; modifier key as well. (unless (memq event1 modifiers) (push event1 modifiers) ;; This list is used to check which tool bar buttons ;; need to be enabled. (push event1 modifier-bar-modifier-list)) ;; Update the tool bar to disable the modifier button ;; that was read. (force-mode-line-update) (redisplay) ;; Read another event. (setq event (read-event))) To allow applying multiple modifier keys, you must also check if the basic type of the event read is either `volume-up' or `volume-down', and push the appropriate modifier key to `modifiers' and `modifier-bar-modifier-list' if that is so. You might want to include your own version of this function in your customizations, since it's not exactly relevant to the modifier bar. Thanks.