emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stylus drawing input?


From: Po Lu
Subject: Re: Stylus drawing input?
Date: Tue, 24 Jan 2023 18:50:09 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Dov Grobgeld <dov.grobgeld@gmail.com> writes:

> Thanks. I need some guidance on how feasible the following is and how
> I would go about doing it.
>
> 1. How do I draw vector graphics object in an emacs buffer. I.e.
> line-to, move-to, close-path, fill etc. Do I need to generate the
> pixels on my own (can be done e.g. with the agg library or with
> libcairo) and then place the image as on overlay (how?), or is there
> higher lever interface?

Emacs doesn't have any built in vector graphics capability.  But the
image route could probably work, yes.

> 2. How can I trace the x,y input coordinates of mouse movement. E.g.
> I'd like to run a command to enter capture mode, and then catch
> subsequent motion events of the mouse, until the mouse button is
> raised. The resulting object should be a list of motion coordinates.

I suggest reading through looking the entirety of (elisp)Input Events.
It will explain everything better than I can.

> 3. How would I do the same for a stylus while catching additional
> pressure data?

I will see what interfaces the X Input extension provides to access that
information and ack.

> 4. Given some vector graphics objects drawn on the screen, how would I
> do mouse hit detection, so that doing a mouse click on the object,
> returns the object id? (This I can do "offline" though, by drawing a
> "label image" of the buffer contents on mouse press end then finding
> the label of the object under the mouse.)

I think you had better head to the nearest library (or perhaps book
store) for this one.  That is outside of the scope of this list.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]