\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#464: Support for Multimedia Keys on Windows}
\date{January 28, 2017}
\author{Ralf Fassel, 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 \#464}&\textbf{Support for Multimedia Keys on Windows}\\\hline
Author&

Ralf Fassel \tipmail{ralfixx}{gmx.de}
\par
Andreas Leitgeb \tipmail{avl}{logic.at}
\\
Created&Saturday, \(\text{28}^{\text{th}}\) January 2017\\
Type&Project\\
Tcl Version&\(8.5\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.6 $\\
Keywords&Tk, keyboard, keycode\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

This TIP proposes adding support for the multimedia keys present on many modern keyboards.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

Tk is lacking support for the multimedia keys as described on \url{https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731\%28v=vs.85\%29.aspx}
\begingroup\small\begin{verbatim}
VK_VOLUME_DOWN        0xAE   Volume Down key
VK_VOLUME_UP          0xAF   Volume Up key
VK_MEDIA_NEXT_TRACK   0xB0   Next Track key
VK_MEDIA_PREV_TRACK   0xB1   Previous Track key
VK_MEDIA_STOP         0xB2   Stop Media key
VK_MEDIA_PLAY_PAUSE   0xB3   Play/Pause Media key
\end{verbatim}
\endgroup

Linux supports these as, e.g., XF86AudioPlay, XF86AudioPrev, XF86AudioNext. Tk should support them as well so that application programmers can make use of the keys as appropriate.

Because this is driven by changing external circumstances, it is propsed that this TIP be backported to all future-releaseable versions of Tk (i.e., 8.5 onwards).

\section{Proposal}

The table of supported keys should be extended to include the following named keys:
\begin{itemize}
\item{}
\textbf{XF86AudioLowerVolume} --- the volume-down key
\item{}
\textbf{XF86AudioMute} --- the volume-mute key
\item{}
\textbf{XF86AudioNext} --- the next-track key
\item{}
\textbf{XF86AudioPlay} --- the start-playback key
\item{}
\textbf{XF86AudioPrev} --- the previous-track key
\item{}
\textbf{XF86AudioRaiseVolume} --- the volume-up key
\item{}
\textbf{XF86AudioStop} --- the stop-playback key
\end{itemize}

The above list does not imply any ordering in the implementation.

\section{Implementation}

The support can be added by extending some keymapping lookup tables in Tk.

A Ticket already exists with a proposed patch [\url{http://core.tcl.tk/tk/tktview/499526180d6cd5ca7c02eed96c10e9d3630a807c}] and fvogel has also created a branch [\url{http://core.tcl.tk/tk/timeline?r=tip-464}].

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

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