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: xwidget events Date: Sat, 06 Nov 2021 10:12:53 +0800 Message-ID: <87h7cq6nh6.fsf@yahoo.com> References: <877ddulkrt.fsf.ref@yahoo.com> <877ddulkrt.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21706"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Emacs developers To: Aiko Kyle Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 06 03:14:37 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 1mjBE5-0005Uq-0a for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Nov 2021 03:14:37 +0100 Original-Received: from localhost ([::1]:40644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjBE4-0007Bn-4a for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 22:14:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjBCb-0005uh-GW for emacs-devel@gnu.org; Fri, 05 Nov 2021 22:13:05 -0400 Original-Received: from sonic301-30.consmr.mail.ne1.yahoo.com ([66.163.184.199]:36170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjBCZ-000639-BI for emacs-devel@gnu.org; Fri, 05 Nov 2021 22:13:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1636164781; bh=xY/Olp0YKVJY0M4bEuq6gJyYYDV5875K4xf3wwH7g6o=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=IoWd0EZm6gzRfJ1Aj8IkRWjD4qMr9o3Qoi4Tf+n+Aj6hjDrRAElIzlEZLI9Zwbkpf0zPUDk9vwizQynR8Npkviild8Gsym9Y1zDHm75mP2AlgA1sTplkrC+jKVYdddxep53YYhBlQNzKj2flaJ9sh4FpqRstWSA7AIp/akaK1H+sDIuSR4oyWOcoxDNywLWAZR2x8nitigOiN78FzYeWJ7dUx1pc3BbI3/MEsXnC7+z5zSP48eBitiuIioeumBAG5TQ6dOn630wjq/kP0jiIdnrde8BGEWHdoYEs9GkDLJbUAnBgWk3P4bFPd0n3IlakllfeLQ7qXcEQkK8QvAjKvA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1636164781; bh=SdQeev9N4KURnMIi8w0kyCj4tBddLy7WK6e5OSDVx4F=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=INe6Ob6NozvNtSvtAZHWF6/xhUv2IvKzi8lJ1Voz+UuwaA3P5189eFKpWrMYA5Lx5UXHl6byYApM7yUt8zdec29gBwSnoO3V7Dk/irqMygHBQMvUcflImysnuqVfzuP+yHxRbP6ugcOqbZOzOGFLLyEIvSkwOr7ZdSJuBQBjTiKdRCU1KhuF+zA1+GsmcSShGBrJ+mFfUSzs6RDZ+0PQOge5mLjPtLWM+5uJx7HDnt7la3OCK/HMKmm12vf3TgbZR6whUrLKF2MmfJUb2QOhBQSwpNvJKgSAJweeLcCYJlYUeXsq4+rKpf6CZwwM042QvayyxakR+DgjWwvZzJhi8Q== X-YMail-OSG: evTAkO8VM1kXw03jmdftgZw5Xb6Sp6XsR9X637Kj7aQ8ezBBgvk.hSd6.paFqyW J9D5A4Ok1qvTFGSrHoQMINmYyF_P1iSd0egjAtT4XQZ2YIQHMfi1l2TIIhKa9zrfr9N4q_6x.Mgq 8c8nCC4lpiNctY2Z_fKdXGX9vEwTNAbFi_I9DOcQHHtB7SBhtoJeT82JrZBv_J0vtm1IMma7h8GM 5nFOa6s5B4mwdVahbaAVIJWwX1UbMiffaH2twm1.lA4cybtVh9RKaKQDJIbzbZ089_pf.TJlPZfw fOfeWHuhrd.g4wTsVWV1AbNfeTTuEWsLfn.eFs_bgNBWlJuy69lBN_bDR3zPmREQpIr6BAQPJChG IPr3B1vbLAbaiO_YAHuL1qMT7tP4pvbSGtvmetcn9TiBMac0kO5HgLF70kL_Wiu7jA3tmmewx4ay HZTP2o6OU1QQFWf5HcXg8klo8hAn4Spfff3R0mbUmiGUd9igFnD9oqgNg6Y6TXGT931p7A3sN0uq aeeKPTW3q0PV3LSefZUVrSIUUOJ2v7wDaVC08K9SQSj3AiM3X9vvIdtD.wm_B6e.iYOpqPHa1IAx YMW5P4421SJgeXuwRa7E2iFIa68o1Rwzt2syX4iV48B4cLoNUHKlvK5aBHw7Jf7QoeYnVjxjYAgf U339SPQpDhoMzk5IwcdON1qgQ.H5ML5ZvYlsl_EG3PC6xwJ2NZrKtTiAqDwfG1dxQNQ7KB7fq7qp u0snCVvomrq.UCjP8.kl1p24xVhUQfj6mQhOzFyZHw2pMeqhAHv66vx5j_VlisYBL_cmPC3o_FcN oJ2VT.tIv90VeYnsLb5RtDbAk6ncY12MFXNF7hoNRc X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Sat, 6 Nov 2021 02:13:01 +0000 Original-Received: by kubenode514.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 401b1c62895ebdd60ed3bd2a1c540160; Sat, 06 Nov 2021 02:12:57 +0000 (UTC) In-Reply-To: (Aiko Kyle's message of "Fri, 5 Nov 2021 19:47:50 -0600") X-Mailer: WebService/1.1.19266 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.184.199; envelope-from=luangruo@yahoo.com; helo=sonic301-30.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 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:278832 Archived-At: Aiko Kyle writes: > In emacs-webkit, I introduced an "insert" mode to allows one to pass > keyboard events directly to webkitgtk's widget. This is done by > focusing the webkitgtk widget so gtk passes input events directly to > it and emacs does not receive them. I did this since I thought it was > very bad UI to see one's cursor on a web text field, try to interact > with it, and have nothing happen. I know xwidgets has this injected JS > workaround that allows one to type in the emacs minibuffer and send > the text to the html field. However this won't work to, say, tab > between form fields or use arrow keys to make selections. I'm not sure > how you'd extend the JS solution to handle all these cases generally. BTW, I have already implemented something similar: a function `xwidget-perform-lispy-event' to send Lisp events to an xwidget, and an `xwidget-webkit-edit-mode' that sends self inserting characters and arrow keys to xwidgets-webkit. You can find a recent version of my changes somewhere in the discussion around bug#51473. > On keyboard events, there will always be a tension between the CUA > keys that webkit is hardcoded to use and emac's keys. Someone could > write the appropriate translation layer, but it'll be a nontrivial, > likely manual, task and will require constant upkeep as these things > evolve in webkitgtk. Personally as an evil and former exwm user, > making keyboard focus a modal distinction is natural. Yes, but in the meantime I added some items to the menu bar that could help with tasks such as saving the selection. > On mouse events, I'm not sure what you will gain by exposing such > events to lisp first then passing them to webkit. Is there some use > case this would enable? I can't imagine it being very helpful without > lisp also knowing what DOM element the mouse event is associated with. > I would also be worried about latency with the additional redirection. I'm not particularly worried about input latency, but it would be a bad thing to enable this for every xwidget. WDYT about the ability to set input event masks for individual xwidgets, so people who write Lisp code can decide which events get passed through right after handling the X event, and which events get passed through Lisp code first? > Additionally, until emacs learns to handle xinput 2 type events, you > might risk losing all the multitouch gestures that webkit supports > including smooth two-finger scrolling. Unfortunately, it's impossible to support XInput 2 devices in any GTK widget running inside an Emacs process at present: it's disabled so GTK doesn't set an XI2 event mask that prevents Emacs from handling Core Input events. I do have a patch that enables XInput 2 support in Emacs, but I don't have time to work on it right now. Thanks.