/usr/share/doc/hama-slide-mouse-control/hama-slide-mouse-control.html is in hama-slide-mouse-control 1.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>hama-slide-mouse-control</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><H1
><A
NAME="AEN1"
></A
>hama-slide-mouse-control</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN14"
></A
><H2
>Name</H2
>hama-slide-mouse-control -- Control settings of the Hama SLide S1 USB gaming mouse</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN17"
></A
><H2
>Synopsis</H2
><P
><B
CLASS="COMMAND"
>hama-slide-mouse-control</B
> [ [<CODE
CLASS="OPTION"
>-d</CODE
> <TT
CLASS="REPLACEABLE"
><I
>idVendor:idProduct</I
></TT
>] {<TT
CLASS="REPLACEABLE"
><I
>0-OR-MORE-COMMANDS</I
></TT
>...}
<BR> | <CODE
CLASS="OPTION"
>-h</CODE
> | <CODE
CLASS="OPTION"
>--help</CODE
> | <CODE
CLASS="OPTION"
>-v</CODE
> | <CODE
CLASS="OPTION"
>--version</CODE
>]</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="DESCRIPTION"
></A
><H2
>Description</H2
><P
>This program controls the Hama SLide S1 USB gaming mouse: It allows changing the DPI settings and to switch between three different modes which influence the functionality of the two "thumb buttons".</P
><P
>Note: To be able to access the USB mouse, the program must either be run as root, be installed suid root, or udev must have been configured to allow access for normal users. See the section "<A
HREF="#UDEV"
>udev Setup</A
>" below.</P
><P
>The <CODE
CLASS="OPTION"
>-d</CODE
> option can be used to specify the USB device that the program should search for. The option argument is a string of the form <TT
CLASS="LITERAL"
>"056e:001c"</TT
> (this particular value is also the default), i.e. the USB vendor and product IDs in hexadecimal, separated by a colon. See the output of the <B
CLASS="COMMAND"
>lsusb</B
> command to find out the IDs of connected devices.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="COMMANDS"
></A
><H2
>Commands</H2
><P
>Zero or more commands can be specified on the command line. If no commands at all are present, the program can be used to check for the presence of a Hama SLide mouse on the machine via its exit status. Otherwise, the commands are executed in the supplied order. If more than one Hama SLide mouse is connected, all commands are executed on all mice.</P
><P
>The mouse is a very simple device: You can only write settings to it, the current state of the settings cannot be read from it.</P
><DIV
CLASS="REFSECT2"
><A
NAME="MODE1"
></A
><H3
>Mode 1: Select DPI via Thumb Button 1</H3
><P
>Command: <B
CLASS="COMMAND"
>scroll</B
></P
><P
>This is the default mode of the mouse, it is activated immediately after plugging in the device. In this mode, the scroll wheel selects the mouse DPI while thumb button 1 is pressed down. Clicks on thumb button 1 cannot be detected by the OS. Thumb button 2 acts like another right mouse button. The current DPI setting is left unchanged.</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="MODE2"
></A
><H3
>Mode 2: Fixed DPI Setting</H3
><P
>Commands: <B
CLASS="COMMAND"
>400</B
> <B
CLASS="COMMAND"
>800</B
> <B
CLASS="COMMAND"
>1200</B
> <B
CLASS="COMMAND"
>1600</B
></P
><P
>In this mode, the mouse resolution is set to one of four DPI values by specifying that value. Both thumb buttons are available to the OS - by default, they act like another middle and right mouse button. The colour of the scroll wheel indicates the DPI setting: blue (400 dpi), green (800 dpi), cyan (1200 dpi) or red (1600 dpi).</P
><P
>Note: The program allows you to specify more than one command. You can use this to select a certain DPI value first, but switch to "scroll" mode again afterwards, e.g. with: <B
CLASS="COMMAND"
>hama-slide-mouse-control 400 scroll</B
>. A small, harmless hardware bug of the mouse exhibits itself in this case: When using the scroll wheel afterwards to select another resolution, the mouse orders the other DPI states as if the program-controlled DPI change had not taken place.</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="MODE3"
></A
><H3
>MODE 3: Thumb Buttons Switch Between Two Fixed DPI Settings</H3
><P
>Commands: <B
CLASS="COMMAND"
>400+800</B
> <B
CLASS="COMMAND"
>400+1200</B
> <B
CLASS="COMMAND"
>400+1600</B
> <B
CLASS="COMMAND"
>800+1200</B
> <B
CLASS="COMMAND"
>800+1600</B
> <B
CLASS="COMMAND"
>1200+1600</B
></P
><P
>When this mode is used, each of the two thumb buttons selects a certain DPI setting when clicked. Thumb button 1 always selects the lower, thumb button 2 the higher setting. This results in the different combinations above. The current DPI setting is left unchanged. Clicks on either thumb button cannot be detected by the OS in this mode.</P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="RETURN"
></A
><H2
>Return Codes</H2
><P
>The program returns 0 if all commands were successfully sent to the device. If no commands are given, it returns 0 if the mouse is plugged in. It returns 1 if no Hama SLide mouse (USB vendor 056e, product ID 001c) is connected to the computer. It returns 2 if there was an error sending commands to the mouse, either because the mouse returned an error in response to a command or because you do not have the access rights to change mouse settings.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="UDEV"
></A
><H2
>udev Setup under Linux</H2
><DIV
CLASS="REFSECT2"
><A
NAME="UDEV-PLUG"
></A
><H3
>Executing <B
CLASS="COMMAND"
>hama-slide-mouse-control</B
> when the mouse is plugged in</H3
><P
>If you have root access and you are the only user on your machine, use the following udev rule to set up the mouse. The given command will be executed whenever the mouse is plugged in or the computer boots or resumes. Simply create a file named <TT
CLASS="FILENAME"
>/etc/udev/rules.d/60-hama-slide-mouse-control.rules</TT
> with the following content. Of course, you can execute the program with parameters of your choice instead of "400":
<PRE
CLASS="PROGRAMLISTING"
>ACTION=="add", SUBSYSTEM=="usb_device", SYSFS{idVendor}=="056e", SYSFS{idProduct}=="001c", RUN+="/root/bin/hama-slide-mouse-control 400"</PRE
></P
><P
>Execute <B
CLASS="COMMAND"
>udevcontrol reload_rules</B
> as root after any changes to the configuration file.</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="UDEV-ANYUSER"
></A
><H3
>Allowing users to set up the mouse on login</H3
><P
>If several users (possibly with differing wishes about the mouse setup) use the machine, it is possible give all users permission to set up the mouse, instead of only root. Put the following into <TT
CLASS="FILENAME"
>/etc/udev/rules.d/60-hama-slide-mouse-control.rules</TT
>:
<PRE
CLASS="PROGRAMLISTING"
>ACTION=="add", SUBSYSTEM=="usb_device", SYSFS{idVendor}=="056e", SYSFS{idProduct}=="001c", MODE="666"</PRE
></P
><P
>Users can then run <B
CLASS="COMMAND"
>hama-slide-mouse-control</B
> from startup scripts when their Gnome or KDE desktop starts up. It should be noted that this setup will allow remotely logged-in users to annoy the local user by playing around with the settings and letting the mouse flash in all its colours! :-) Of course you can also add both the <TT
CLASS="LITERAL"
>RUN</TT
> and <TT
CLASS="LITERAL"
>MODE</TT
> keywords to the udev rule. Finally, you can restrict write access to users in a certain group, by using <TT
CLASS="LITERAL"
>MODE="660", GROUP="hamamouse"</TT
> or similar.</P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="SUID"
></A
><H2
>Setting <B
CLASS="COMMAND"
>hama-slide-mouse-control</B
> suid root</H2
><P
>It is possible to set the suid bit on the <B
CLASS="COMMAND"
>hama-slide-mouse-control</B
> to allow ordinary users to change mouse settings even if they do not have access to the USB device. The program has been written with care, using it this way should be fairly safe. <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>However, running <B
CLASS="COMMAND"
>hama-slide-mouse-control</B
> suid root is NOT recommended</I
></SPAN
> because suid binaries should be avoided in general! In this particular case, there is even less of a reason to do this, as udev provides a mechanism to allow all users to access the device.</P
><P
>The <CODE
CLASS="OPTION"
>-d</CODE
> option cannot be used if the program is run suid root.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="IMWHEEL"
></A
><H2
>Assigning Actions to the Thumb Buttons With imwheel</H2
><P
>The author has been unable to get the thumb buttons to do anything other than act as "clones" of the middle and right mouse button, but <A
HREF="http://wiki.ubuntuusers.de/Extratasten"
TARGET="_top"
>at least one web page</A
> claims that it is possible to redefine the meaning of the buttons, so here is a short description of how to configure this with <B
CLASS="COMMAND"
>imwheel</B
>.</P
><P
>Having installed <B
CLASS="COMMAND"
>imwheel</B
>, edit <TT
CLASS="FILENAME"
>/etc/X11/imwheel/startup.conf</TT
>: Set <TT
CLASS="LITERAL"
>IMWHEEL_START=1</TT
> and <TT
CLASS="LITERAL"
>IMWHEEL_PARAMS='-b "0 0 8 9"'</TT
>. Next, check the <TT
CLASS="LITERAL"
>Section "InputDevice"</TT
> of your <TT
CLASS="FILENAME"
>/etc/X11/xorg.conf</TT
> file. It is recommended to use <TT
CLASS="LITERAL"
>Option "Protocol" "evdev"</TT
> and to comment out any <TT
CLASS="LITERAL"
>ZAxisMapping</TT
> and <TT
CLASS="LITERAL"
>Buttons</TT
> settings, as they can cause confusing behaviour with newer imwheel versions. Now configure mappings in your <TT
CLASS="FILENAME"
>~/.imwheelrc</TT
> file. For example, two lines <TT
CLASS="LITERAL"
>"^XMMS"</TT
> and <TT
CLASS="LITERAL"
>None, Thumb1, Return</TT
> will define the (not very useful) action that in any window whose title starts with "XMMS", a click with "none" modifier keys (like Shift) on the Thumb1 button will simulate a keypress of the Return key. Restart X11 to have the new settings loaded.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="SEEALSO"
></A
><H2
>See Also</H2
><P
> <SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>lsusb</SPAN
>(8)</SPAN
>,
<SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>imwheel</SPAN
>(1)</SPAN
>,
<SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>xorg.conf</SPAN
>(5)</SPAN
>,
<SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>mouse</SPAN
>(4x)</SPAN
>,
<SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>udev</SPAN
>(7)</SPAN
>,
<SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>udevcontrol</SPAN
>(8)</SPAN
>
</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AUTHOR"
></A
><H2
>About This Program</H2
><P
>This program and documentation was written by <A
HREF="http://atterer.net"
TARGET="_top"
>Richard Atterer</A
>. Copyright 2007 Richard Atterer, released under GPL v2.</P
><P
>The USB commands that are sent to the device were obtained by reverse-engineering the protocol used by Hama's control program for Windows. This was done using <A
HREF="http://benoit.papillault.free.fr/usbsnoop/"
TARGET="_top"
>usbsnoop/Snoopy</A
> by Benoit Papillault - many thanks!</P
></DIV
></BODY
></HTML
>
|