]> git.eshelyaron.com Git - emacs.git/commit
Expose the name of an event's input device to Lisp
authorPo Lu <luangruo@yahoo.com>
Thu, 7 Apr 2022 13:16:11 +0000 (21:16 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 7 Apr 2022 13:16:11 +0000 (21:16 +0800)
commit3b411417086ceb2ce3838160d01c6f250e47bbf3
tree7605008be2090be2cc58ba6df8df6c2d22b8184e
parentc1a6aa0c3eb1029e3f7f5c3b227d7952bee775b8
Expose the name of an event's input device to Lisp

This name can be used to identify the device for special
treatment, i.e. only interpolating scrolls coming from mice and
not touchpads inside pixel-scroll-precision-mode.

* doc/lispref/commands.texi (Command Loop Info): Document new
variable `last-event-device'.
* etc/NEWS: Announce new variable `last-event-device'.
* src/frame.h (struct frame): New field `last_mouse_device'.
* src/keyboard.c (read_char): Clear last-event-device.
(kbd_buffer_get_event): Set last-event-device to the event's
recorded device.
(init_keyboard): Clear last-event-device.
(syms_of_keyboard): New defvar `last-event-device'.
* src/termhooks.h (struct input_event): New field `device'.
(EVENT_INIT): Set it to the special value `Qt' by default.
* src/xterm.c (x_init_master_valuators): Record the device's
name.
(x_dnd_begin_drag_and_drop): Only preserve last event device if
the mouse ended up in the source frame.
(x_note_mouse_movement): New argument `source'.
(handle_one_xevent): Set input event sources whenever
appropriate.
(mark_xterm): Mark device names.

* src/xterm.h (struct xi_device_t): New field `name'.
doc/lispref/commands.texi
etc/NEWS
src/frame.h
src/keyboard.c
src/termhooks.h
src/xterm.c
src/xterm.h