\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#84: Add control for mouse movement filtering}
\date{February 26, 2002}
\author{Jyrki Alakuijala, Jeff Hobbs}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#84}&\textbf{Add control for mouse movement filtering}\\\hline
Author&

Jyrki Alakuijala \tipmail{Jyrki.Alakuijala}{iki.fi}
\par
Jeff Hobbs \tipmail{JeffH}{ActiveState.com}
\\
Created&Tuesday, \(\text{26}^{\text{th}}\) February 2002\\
Type&Project\\
Tcl Version&\(8.4\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.5 $\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

When the mouse is moved, the Tcl/Tk system eats most of the mouse movement events and only the last movement event when Tcl/Tk is not busy is stored in the event queue. I would like to obtain all the movement events from the X-server or the Windows UI.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

I have an artistic drawing program where I need to track mouse as accurately as possible. At the moment I poll the \textit{XQueryPointer()} in the busy loops to create (pseudo)events in the C-side of the code to compensate for the missing events, but (of course) this does not work in Windows.

I would like to have an option for the widget system or for the window control so that a window (or, alternatively all the windows) could receive all the movement events instead of only the last buffered one.

This has been a problem for me since 1995 and has --- at many times --- caused me to consider changing the widget system.

\section{Implementation}
\begingroup\small\begin{verbatim}
    int Tk_CollapseMotionEvents(Display *display, int collapse)
\end{verbatim}
\endgroup

A reference implementation is SF Tk patch 564642, which adds a flag to the TkDisplay that specifies whether motions events should be collapsed or not. The default is the current behavior of collapsing these events.

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\end{document}
