\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#394: Platform-Independent Handling of Contemporary Mice}
\date{November 30, 2011}
\author{Andreas Leitgeb}
\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 \#394}&\textbf{Platform-Independent Handling of Contemporary Mice}\\\hline
Author&

Andreas Leitgeb \tipmail{avl}{logic.at}
\\
Created&Wednesday, \(\text{30}^{\text{th}}\) November 2011\\
Type&Project\\
Tcl Version&\(8.7\)\\
State&Draft\\
Vote&Pending\\
Version&\tipversion$Revision: 1.1 $\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

This TIP proposes a change to Tk's Events such as to support new features of modern pointer devices (mice) in a platform-independent way.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

Modern pointing devices (mice) do have more controls beyond the standard three buttons and one-dimensional scrolling gadget. They often have any of these as well:
\begin{itemize}
\item{}
Tilt-able scroll wheel
\item{}
A second wheel for horizontal scrolling
\item{}
A scroll-ball rather than a scroll wheel (see Apple's ``mightymouse'')
\item{}
Additional ``forward'' and ``backward'' buttons
\item{}
even more buttons...
\end{itemize}

On Linux platform, bind'ing on \tiplangle{}Button\tiprangle{} will catch all(?) or these (and ``\%b'' gives an ordinal number which allows for some heuristic recognition). But even on Linux, it is not possible to bind specifically to e.g. \tiplangle{}Button-8\tiprangle{}, or to \tiplangle{}B8-Motion\tiprangle{} kind of events.

On Windows platform, the system offers different types of events for certain different controls. An app would e.g. register extra to receive horizontal scroll events and those extra buttons. (This is gathered from hearsay.)

\section{Proposal}

Just like the MouseWheel event that was added to Tk in response to wheel-mice filling the market, we'd have to define new events for each new control.

For legacy-reasons, the dichotomy between vertical scroll wheel and buttons 4 and 5 will need to be preserved, maybe as well as the buttons 6 and 7 for horizontal scrolling.

Any extra buttons could then be either named ``X1'', ``X2'', ``X3'', ... or numbered 8, 9, 10, ... which would reflect as bind events \tiplangle{}Button-8\tiprangle{} or \tiplangle{}Button-X1\tiprangle{}, but also \tiplangle{}B8-Motion\tiprangle{} or \tiplangle{}BX1-Motion\tiprangle{}

For horizontal scrolling, \tiplangle{}MouseWheelHoriz\tiprangle{} would be the preferred way for cross-platform apps, but depending on whether ``4 and 5'' button events are already emulated for scrolling on windows, it would be worthwhile to also emulate ``6 and 7'' button events for horizontal wheel-activity.

At this stage of this TIP the decision isn't yet made.

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

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