Function: tab-bar-touchscreen-begin
tab-bar-touchscreen-begin is an interactive and byte-compiled function
defined in tab-bar.el.gz.
Signature
(tab-bar-touchscreen-begin EVENT)
Documentation
Handle a touchscreen begin EVENT on the tab bar.
Determine where the touch was made. If it was made on a tab itself, start a timer set to go off after a certain amount of time, and wait for the touch point to be released, and either display a context menu or select a tab as appropriate.
Otherwise, if it was made on a button, close or create a tab as appropriate.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar-touchscreen-begin (event)
"Handle a touchscreen begin EVENT on the tab bar.
Determine where the touch was made. If it was made on a tab
itself, start a timer set to go off after a certain amount of
time, and wait for the touch point to be released, and either
display a context menu or select a tab as appropriate.
Otherwise, if it was made on a button, close or create a tab as
appropriate."
(interactive "e")
(let* ((posn (cdadr event))
(item (tab-bar--event-to-item posn))
(number (tab-bar--key-to-number (car item)))
timer)
(when (eq (catch 'context-menu
(cond ((integerp number)
;; The touch began on a tab. Start a context
;; menu timer and start tracking the tap.
(unwind-protect
(progn
(setq timer (run-at-time touch-screen-delay nil
#'tab-bar-handle-timeout))
;; Now wait for the tap to complete.
(when (touch-screen-track-tap event)
;; And select the tab, or close it,
;; depending on whether or not the
;; close button was pressed.
(if (caddr item)
(tab-bar-close-tab number)
(tab-bar-select-tab number))))
;; Cancel the timer.
(cancel-timer timer)))
((and (memq (car item) '( add-tab history-back
history-forward global))
(functionp (cadr item)))
;; This is some kind of button. Wait for the
;; tap to complete and press it.
(when (touch-screen-track-tap event)
(call-interactively (cadr item))))
(t
;; The touch began on the tab bar itself.
;; Start a context menu timer and start
;; tracking the tap, but don't do anything
;; afterwards.
(unwind-protect
(progn
(setq timer (run-at-time touch-screen-delay nil
#'tab-bar-handle-timeout))
;; Now wait for the tap to complete.
(touch-screen-track-tap event))
;; Cancel the timer.
(cancel-timer timer)))))
'context-menu)
;; Display the context menu in response to a time out waiting
;; for the tap to complete.
(tab-bar-mouse-context-menu event posn))))