How to access mouse event coordinates? (conveniently)How can I simulate an arbitary key event from Elisp?Control or set the emacs mouse button event polling rate?How to get the string representation of a keymap event?Generate mouse-2 event from MacBook trackpadmouse-wheel-follow-mouse for horizontal scrolling?xterm-mouse-mode use mouse on clickable textselisp - detect line change event to trigger functionMouse wheel not working with new mouseRemap input event in all contextsUse mouse buttons as modifiers
"It is what it is" in French
Dedicated to our #1 Fan
What is "ass door"?
Why can't a country print its own money to spend it only abroad?
Can't understand how static works exactly
On the history of Haar measure
How can I show that the speed of light in vacuum is the same in all reference frames?
Ultraproduct of Dividing Lines
Are there any documented cases of extinction of a species of fungus?
Company requiring me to let them review research from before I was hired
Does Impedance Matching Imply any Practical RF Transmitter Must Waste >=50% of Energy?
Considerations when providing money to one child now, and the other later?
Why do people say "I am broke" instead of "I am broken"?
Chemistry Riddle
Can GPL and BSD licensed applications be used for government work?
Are gangsters hired to attack people at a train station classified as a terrorist attack?
Is there a way to shorten this while condition?
Why are Oscar, India, and X-Ray (O, I, and X) not used as taxiway identifiers?
How to Sow[] until I've Reap[]'d enough?
Adding gears to my grandson's 12" bike
Short story where a flexible reality hardens to an unchanging one
Why did computer video outputs go from digital to analog, then back to digital?
Was US film used in Luna 3?
Extrapolation v. Interpolation
How to access mouse event coordinates? (conveniently)
How can I simulate an arbitary key event from Elisp?Control or set the emacs mouse button event polling rate?How to get the string representation of a keymap event?Generate mouse-2 event from MacBook trackpadmouse-wheel-follow-mouse for horizontal scrolling?xterm-mouse-mode use mouse on clickable textselisp - detect line change event to trigger functionMouse wheel not working with new mouseRemap input event in all contextsUse mouse buttons as modifiers
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
When getting events from (read-event)
it's possible to access only mouse events using (mouse-movement-p event)
.
Inspecting the events I've found I can get the Y pixel location using (cdr (nth 2 (nth 1 event))
however this seems overly cryptic.
What is a good way to access data in mouse motion events?
mouse events
add a comment |
When getting events from (read-event)
it's possible to access only mouse events using (mouse-movement-p event)
.
Inspecting the events I've found I can get the Y pixel location using (cdr (nth 2 (nth 1 event))
however this seems overly cryptic.
What is a good way to access data in mouse motion events?
mouse events
add a comment |
When getting events from (read-event)
it's possible to access only mouse events using (mouse-movement-p event)
.
Inspecting the events I've found I can get the Y pixel location using (cdr (nth 2 (nth 1 event))
however this seems overly cryptic.
What is a good way to access data in mouse motion events?
mouse events
When getting events from (read-event)
it's possible to access only mouse events using (mouse-movement-p event)
.
Inspecting the events I've found I can get the Y pixel location using (cdr (nth 2 (nth 1 event))
however this seems overly cryptic.
What is a good way to access data in mouse motion events?
mouse events
mouse events
edited Jul 14 at 9:52
ideasman42
asked Jul 14 at 7:16
ideasman42ideasman42
1,9277 silver badges26 bronze badges
1,9277 silver badges26 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There is a list of functions with the posn
prefix to extract that information and more from mouse events. One caveat is that many of them require a start/end event:
(let ((e (read-event)))
(when (mouse-event-p e)
(let ((x-y (posn-x-y (event-start e))))
(message "Mouse event at: %d|%d" (car x-y) (cdr x-y)))))
How to access pixel coordinates?
– ideasman42
Jul 14 at 11:59
Wasamasa answered exactly the question in your comment, no?C-h f posn-x-y
.
– Drew
Jul 14 at 14:14
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "583"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f51596%2fhow-to-access-mouse-event-coordinates-conveniently%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is a list of functions with the posn
prefix to extract that information and more from mouse events. One caveat is that many of them require a start/end event:
(let ((e (read-event)))
(when (mouse-event-p e)
(let ((x-y (posn-x-y (event-start e))))
(message "Mouse event at: %d|%d" (car x-y) (cdr x-y)))))
How to access pixel coordinates?
– ideasman42
Jul 14 at 11:59
Wasamasa answered exactly the question in your comment, no?C-h f posn-x-y
.
– Drew
Jul 14 at 14:14
add a comment |
There is a list of functions with the posn
prefix to extract that information and more from mouse events. One caveat is that many of them require a start/end event:
(let ((e (read-event)))
(when (mouse-event-p e)
(let ((x-y (posn-x-y (event-start e))))
(message "Mouse event at: %d|%d" (car x-y) (cdr x-y)))))
How to access pixel coordinates?
– ideasman42
Jul 14 at 11:59
Wasamasa answered exactly the question in your comment, no?C-h f posn-x-y
.
– Drew
Jul 14 at 14:14
add a comment |
There is a list of functions with the posn
prefix to extract that information and more from mouse events. One caveat is that many of them require a start/end event:
(let ((e (read-event)))
(when (mouse-event-p e)
(let ((x-y (posn-x-y (event-start e))))
(message "Mouse event at: %d|%d" (car x-y) (cdr x-y)))))
There is a list of functions with the posn
prefix to extract that information and more from mouse events. One caveat is that many of them require a start/end event:
(let ((e (read-event)))
(when (mouse-event-p e)
(let ((x-y (posn-x-y (event-start e))))
(message "Mouse event at: %d|%d" (car x-y) (cdr x-y)))))
answered Jul 14 at 10:01
wasamasawasamasa
16.2k1 gold badge40 silver badges71 bronze badges
16.2k1 gold badge40 silver badges71 bronze badges
How to access pixel coordinates?
– ideasman42
Jul 14 at 11:59
Wasamasa answered exactly the question in your comment, no?C-h f posn-x-y
.
– Drew
Jul 14 at 14:14
add a comment |
How to access pixel coordinates?
– ideasman42
Jul 14 at 11:59
Wasamasa answered exactly the question in your comment, no?C-h f posn-x-y
.
– Drew
Jul 14 at 14:14
How to access pixel coordinates?
– ideasman42
Jul 14 at 11:59
How to access pixel coordinates?
– ideasman42
Jul 14 at 11:59
Wasamasa answered exactly the question in your comment, no?
C-h f posn-x-y
.– Drew
Jul 14 at 14:14
Wasamasa answered exactly the question in your comment, no?
C-h f posn-x-y
.– Drew
Jul 14 at 14:14
add a comment |
Thanks for contributing an answer to Emacs Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f51596%2fhow-to-access-mouse-event-coordinates-conveniently%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown