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: Stylus drawing input? Date: Tue, 24 Jan 2023 07:48:45 +0800 Message-ID: <0C19A13B-EEFF-486B-BED3-36A4AEF629D8@yahoo.com> References: <87pmbhpjkc.fsf@web.de> <87cz7eq5uh.fsf@web.de> 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="16187"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org, Dov Grobgeld , tomas@tuxteam.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 24 00:48:54 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 1pK6YX-0003zT-33 for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Jan 2023 00:48:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pK6Xf-0002yb-9P; Mon, 23 Jan 2023 18:47:59 -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 1pK6XN-0002wA-PG for emacs-devel@gnu.org; Mon, 23 Jan 2023 18:47:57 -0500 Original-Received: from sonic309-21.consmr.mail.ne1.yahoo.com ([66.163.184.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pK6XL-00084i-Qw for emacs-devel@gnu.org; Mon, 23 Jan 2023 18:47:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1674517655; bh=RiJASMsWnF74y2suBI7L5QNh+SKbxOEURoj8JJdtMes=; h=Date:From:To:Subject:In-Reply-To:References:From:Subject:Reply-To; b=rAu4Wsa3B9uZqBX1hi+Ow2oVmlZCZBydKYXYITldHdxurm7rcocmLqYFOtQhBsgEBrX2R2g9cGb1COEZtHaDLEXsrxO9HQxbVgEUiWJCks/hO8mzduTd43pgsEVkv1FMlcT78EVgDNUOrQc0zKHBtc8+105vBMNNIS8j+nvWYfUBeIRCuh2ZAyzlSlFWJFGMPiRp5SUodw0iVDvwipFfpo29sII2XaITzdbWT+c8m/yXyfy1HpPONPCRsz5yET9hJO8sOqibcWEDqh+YCT8NNX3KXjQbRG1nOKws3pT6StRwyuTtYpVuIGAdXyjeeed+bReOJJdkEX9TAq5+ADxAtg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1674517655; bh=Vpxwr5TLc4VKWN++ei7m8uM6MTc6CdGb88WqwpXgqtx=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=Eoes7Uzw7Q5iba2h6/bhx2fRhrYIO5YFM0mI0SUvFxYEAlqfolRmIU14DcpEGN8M8Wfa6s3/iLvts7OEntTmF5cRvg6zjfQEiwgAAhp0n1Bsr/5Z9z52kx/PK8IIv6z+POWZqPUfKhQzGb6O4bQDsjt4ukSgT6UK3hAsrPpvGUQTpDXRVFf/7idX033YrntHN+C/MCbRROS0SEREECcBJFt9YjiIS02C5RJk/tgmjLKeyubW+/PSTutBLBG7gWvB0pZRE7hJbfpX2/ZO5T7wBGopWysMnO+aQdGmDjRuZj+uqnGNUSrwB2+XB/EAqSOpV50dK5zDd5toPAxEwx03wA== X-YMail-OSG: NpTkhXIVM1lI1BMKEkKAae.lfNVobOgAxgifj77tzeCVzAMtL8na8H9btlD85Es Z49GxiKz7a.ucRZH9uj0lCsu1qdWbuMSAWQ6Eo2a4hUj2xZMdLDdfxi9kAVWsTeDDd.mF.WjJFzM mksqTJhjC9rfUf42ygualip1Vs2pU2ZGmdFQD1SX7OCjJr1LvOGS.RWvJqSHCe0imi7SLSst8UwM fJ_77F84TfSFL87x.6gGi4vSJGSdiKrPeXQk.SsvCvyIMYHUiNo4ufbCBPsAU.mSH_PTS.0IsAX2 4wu2LtrPG2xSZ8bkWTkN_gyuAuGlRyoSgmNbSELctDrwV.JirZ4Fsl3Hj9HmiT3kCZi2s3ZfdXLI ZLpfvUAFJDVI2J2W3fjxSER4WKpTKpfMiqHoBD_ZmmVsI6V36cgpibTmgbmJmxWYYwSINwSGa.vx 5JgZIszCA9EkmF9zu3vV04CyKTOpNloPBba2ELEqzHMxL8F7bqFlXFZYlnVlMgoEqWoXg3RvaIiZ rsJMOFEAI3poTul4hg5ScMksIVmTQgIVQNUPeBgOTFXbTFNPafpoeg0dJVlpDvlzvVYz7t6yh9Hr oBqsuKG67TOOwXT.Ma5EsQ0YV7O_hGngPm4pKiOdDyUeaNS1Tr7HaePv69bjHw7h9lAjEEUlvGhL stqBY_hW9laN9Nh_23oUXo2KIYtFYs4HIBCti0IWndwL4r424M8GqmfknL5ZulEIwmxD6PFkZmpJ vkL93QIxIo27yn4_RP8Ij9dcydrktKY.da_PW4SHXROLTyJj.GBfwAZ2A5B0RxtY5.wkfJtUJry9 o8rdSOa2b9PjVQBrXVLa.QUgoX9LNlaEqHVl7vSwlf X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Mon, 23 Jan 2023 23:47:35 +0000 Original-Received: by hermes--production-sg3-84766d64d7-hm7xz (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 6fb6d7a32265779b77fdee5c723ad16b; Mon, 23 Jan 2023 23:47:31 +0000 (UTC) In-Reply-To: X-Mailer: WebService/1.1.21096 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.184.147; envelope-from=luangruo@yahoo.com; helo=sonic309-21.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, 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302628 Archived-At: Emacs 29 already has native support for version 2 of the the X Input extens= ion and its various input devices=2E See the node Touchscreen Events in the Emacs Lisp reference manual=2E Thi= s is not yet supported on the PGTK build=2E On January 24, 2023 5:15:58 AM GMT+08:00, Dov Grobgeld wrote: >On X11, to read stylus input, we need to use XInput extension=2E > >Gdk, used in gtk, has a good abstraction to it that allows doing code >like the following to distinguish between mouse and stylus input in >its motion notify callback, and in this case extract the pressure=2E > > int on_motion_notify_event(GdkEventMotion *event) > { > // The pressure value is: > // found=3Dfalse for mouse motion > // 0 for proximity stylus motion > // >0 for the pen touching the pad > double pressure=3D-1; > int found =3D gdk_event_get_axis((GdkEvent*)event, >GDK_AXIS_PRESSURE, &pressure); > GdkDeviceTool *tool =3D gdk_event_get_device_tool((GdkEvent*)event); > > // For mouse the tool isn't defined, so we set a default -1 > GdkDeviceToolType tool_type =3D (GdkDeviceToolType)(-1); > if (tool) > // true for stylus only > tool_type =3D gdk_device_tool_get_tool_type (tool); > > printf("motion_notify: tool_type=3D%d, >x=3D%=2E3f},y=3D%=2E3f},found_stylus=3D%d,pressure=3D%=2E3f\n", > (int)tool_type, > event->x, event->y, found, pressure); > return TRUE; > } > >To support styluses (i=2Ee=2E to distinguish them from mouse events) we >need something similar in emacs=2E > >Regards, > > >On Mon, Jan 16, 2023 at 10:27 AM wrote: >> >> On Mon, Jan 16, 2023 at 08:45:55AM +0100, Dr=2E Arne Babenhauserheide w= rote: >> > PS: Here is a website with a description that does not rely on unfree >> > platforms: https://misohena=2Ejp/blog/2021-09-21-emacs-easy-draw= =2Ehtml >> > >> > The clearest description is a gif, though: >> > https://misohena=2Ejp/blog/wp-content/uploads/2021-09-21-edraw-exampl= e=2Egif >> >> Thanks for the non-github link! >> >> Cheers >> -- >> t >