From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.devel Subject: Re: Touch events Date: Mon, 26 Jun 2017 12:08:12 +0200 Message-ID: References: <20170624085335.GA10629@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c091f1e01ad310552da21cc" X-Trace: blaine.gmane.org 1498471717 31070 195.159.176.226 (26 Jun 2017 10:08:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Jun 2017 10:08:37 +0000 (UTC) Cc: Emacs-Devel devel To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 26 12:08:33 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPQwY-0007me-T0 for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2017 12:08:31 +0200 Original-Received: from localhost ([::1]:45677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPQwe-0000Pe-47 for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2017 06:08:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPQwL-0000Gi-CP for emacs-devel@gnu.org; Mon, 26 Jun 2017 06:08:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPQwJ-0007mm-Th for emacs-devel@gnu.org; Mon, 26 Jun 2017 06:08:17 -0400 Original-Received: from mail-vk0-x22e.google.com ([2607:f8b0:400c:c05::22e]:34788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dPQwJ-0007jH-P7 for emacs-devel@gnu.org; Mon, 26 Jun 2017 06:08:15 -0400 Original-Received: by mail-vk0-x22e.google.com with SMTP id r125so37477410vkf.1 for ; Mon, 26 Jun 2017 03:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=I64NjtOjP2fqI1QmIHHOEMIe5E4N1PNR+M5X3rnLvcI=; b=VmdaVwVG566PdFKswqJ15NCOw46hJ6AB7sQRMIRSm7FFQyXQbtEPBuYaXGAsQw24Yk Eb/v005UdQwEhxCbuALZa/fW0poyb1hlAoEbD4T72i8/mcWgVgWUgqivDThagxKI2MW4 9+RVsDW6NAGfVxPcDOgMwntAzdSCYIHlVfHRPjFaHc2u5uPpKr2QolaaiTaVHVp/LzL9 MV4A7YzwOwUzf01oUMSpqlCXGkJ54SqAQ3qbPoyf1VJEY3/CjVseSyb/osawZKVSl9mM 7buKJOKv/DOcnTGBS3gNpwT0j/y/rD907R07ZVHBnWGpoScakYPL/GpNZfzoYLflpxOC fJ2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=I64NjtOjP2fqI1QmIHHOEMIe5E4N1PNR+M5X3rnLvcI=; b=oIfH+xehLJT3VBhH6DAsdAbrKygcuvuG/iM2JFvKYqZF5T6SouzVCejP85eF7+IziT tp9Emk81IIdF1Tophmd2vSmm3EWZ/+k9UgPZCPeWlEiTs1Hi73hOz/BWjocWOoDJ4dsm AJd7gX+nYMSLiolgdQpxB7cxhtLC5MdxYqhQJZZHJSGj9H3pXEI3ANDgF2wJUNGa0gap agRCwciYjijJc1lumFzK8NmrMoRdjKwf4McG9lm9wxze74+3Nu+JtR29qYoJkXq4tpsM Dv/w2XiiP7V1rtTSo8hOdLsBS4gwj0Wyv923h6mrwXrjZJ6ZEDZfPMXJw0JUvldDrhik vCOQ== X-Gm-Message-State: AKS2vOz0QOl9Qk7m9aSmcdtxfimk/d20cbjyDHhoH5nVTJhE51Q2zARB wc02g47/Uc/G33KL91XEKyMT8hUVv7H5 X-Received: by 10.31.237.193 with SMTP id l184mr3050299vkh.147.1498471693658; Mon, 26 Jun 2017 03:08:13 -0700 (PDT) Original-Received: by 10.31.155.67 with HTTP; Mon, 26 Jun 2017 03:08:12 -0700 (PDT) In-Reply-To: <20170624085335.GA10629@breton.holly.idiocy.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c05::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215994 Archived-At: --94eb2c091f1e01ad310552da21cc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi! This looks great, I just can't wait to start using it! I can imagine a number of uses for it already -- I would like to bind zoom and pinch to show and hide documentation. Anyway, the "mac" port, maintained by YAMAMOTO Mitsuharu have had support for this for some time. It uses the names `swipe-left/right/up/down', `magnify-up/down', and `rotate-left/right' -- I guess it would be a good idea for us to use the same names and conventions, to avoid confusing users= . -- Anders On Sat, Jun 24, 2017 at 10:53 AM, Alan Third wrote: > I=E2=80=99ve created a small patch that adds some touch event handling to > Emacs. Currently it only works on macOS, but the same functionality is > available on GTK3, MS Windows and vanilla Xorg. > > I wanted to know if I=E2=80=99m going about this the right way, or if it= =E2=80=99s > even worth my while continuing. > > I=E2=80=99ve created a number of new events: touch-scroll, touch-pinch, e= tc., > that can be bound to functions. I=E2=80=99ve attached a simple script tha= t > binds touch-pinch to the text-scale-increase/decrease functions. > > BTW, how do you create a lisp float from C? I tried something like > > Lisp_Object delta; > XSETFLOAT (delta, [event magnification]); > > but it just complains that [event magnification] returns a double and > not void *. > > NOTE: If you install this patch, scrolling with the touchpad will no > longer work on macOS (a real mousewheel will be fine, though). It > needs some effort to get it working, and my elisp skills aren=E2=80=99t u= p to > much. It either needs a compatibility function in lisp, or a way to > disable it and use the existing mousewheel code. It could be worth > trying to tie it into the new pixel scroll mode. > -- > Alan Third > --94eb2c091f1e01ad310552da21cc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!

This looks great, I just can't = wait to start using it! I can imagine a number of uses for it already -- I = would like to bind zoom and pinch to show and hide documentation.

Anyway, the "mac" port, maintained by=C2=A0YAMAMO= TO Mitsuharu have had support for this for some time. It uses the names `sw= ipe-left/right/up/down', `magnify-up/down', and `rotate-left/right&= #39; -- I guess it would be a good idea for us to use the same names and co= nventions, to avoid confusing users.

=C2=A0 =C2=A0= -- Anders

On Sat, Jun 24, 2017 at 10:53 AM, Alan Third <alan@idiocy.org> wrote:
I=E2=80=99ve created a small= patch that adds some touch event handling to
Emacs. Currently it only works on macOS, but the same functionality is
available on GTK3, MS Windows and vanilla Xorg.

I wanted to know if I=E2=80=99m going about this the right way, or if it=E2= =80=99s
even worth my while continuing.

I=E2=80=99ve created a number of new events: touch-scroll, touch-pinch, etc= .,
that can be bound to functions. I=E2=80=99ve attached a simple script that<= br> binds touch-pinch to the text-scale-increase/decrease functions.

BTW, how do you create a lisp float from C? I tried something like

=C2=A0 =C2=A0 Lisp_Object delta;
=C2=A0 =C2=A0 XSETFLOAT (delta, [event magnification]);

but it just complains that [event magnification] returns a double and
not void *.

NOTE: If you install this patch, scrolling with the touchpad will no
longer work on macOS (a real mousewheel will be fine, though). It
needs some effort to get it working, and my elisp skills aren=E2=80=99t up = to
much. It either needs a compatibility function in lisp, or a way to
disable it and use the existing mousewheel code. It could be worth
trying to tie it into the new pixel scroll mode.
--
Alan Third

--94eb2c091f1e01ad310552da21cc--