1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct input_handler</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="input_subsystem.html#idp1114168316" title="Input core"><link rel="prev" href="API-struct-input-dev.html" title="struct input_dev"><link rel="next" href="API-struct-input-handle.html" title="struct input_handle"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct input_handler</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-input-dev.html">Prev</a>&#160;</td><th width="60%" align="center">Input core</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-struct-input-handle.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-input-handler"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct input_handler &#8212; 
2     implements one of interfaces for input devices
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4struct input_handler {
5  void * private;
6  void (* event) (struct input_handle *handle, unsigned int type, unsigned int code, int value);
7  void (* events) (struct input_handle *handle,const struct input_value *vals, unsigned int count);
8  bool (* filter) (struct input_handle *handle, unsigned int type, unsigned int code, int value);
9  bool (* match) (struct input_handler *handler, struct input_dev *dev);
10  int (* connect) (struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
11  void (* disconnect) (struct input_handle *handle);
12  void (* start) (struct input_handle *handle);
13  bool legacy_minors;
14  int minor;
15  const char * name;
16  const struct input_device_id * id_table;
17  struct list_head h_list;
18  struct list_head node;
19};  </pre></div><div class="refsect1"><a name="idp1114225284"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">private</span></dt><dd><p>
20   driver-specific data
21      </p></dd><dt><span class="term">event</span></dt><dd><p>
22   event handler. This method is being called by input core with
23   interrupts disabled and dev-&gt;event_lock spinlock held and so
24   it may not sleep
25      </p></dd><dt><span class="term">events</span></dt><dd><p>
26   event sequence handler. This method is being called by
27   input core with interrupts disabled and dev-&gt;event_lock
28   spinlock held and so it may not sleep
29      </p></dd><dt><span class="term">filter</span></dt><dd><p>
30   similar to <em class="parameter"><code>event</code></em>; separates normal event handlers from
31   <span class="quote">&#8220;<span class="quote">filters</span>&#8221;</span>.
32      </p></dd><dt><span class="term">match</span></dt><dd><p>
33   called after comparing device's id with handler's id_table
34   to perform fine-grained matching between device and handler
35      </p></dd><dt><span class="term">connect</span></dt><dd><p>
36   called when attaching a handler to an input device
37      </p></dd><dt><span class="term">disconnect</span></dt><dd><p>
38   disconnects a handler from input device
39      </p></dd><dt><span class="term">start</span></dt><dd><p>
40   starts handler for given handle. This function is called by
41   input core right after <code class="function">connect</code> method and also when a process
42   that <span class="quote">&#8220;<span class="quote">grabbed</span>&#8221;</span> a device releases it
43      </p></dd><dt><span class="term">legacy_minors</span></dt><dd><p>
44   set to <code class="constant">true</code> by drivers using legacy minor ranges
45      </p></dd><dt><span class="term">minor</span></dt><dd><p>
46   beginning of range of 32 legacy minors for devices this driver
47   can provide
48      </p></dd><dt><span class="term">name</span></dt><dd><p>
49   name of the handler, to be shown in /proc/bus/input/handlers
50      </p></dd><dt><span class="term">id_table</span></dt><dd><p>
51   pointer to a table of input_device_ids this driver can
52   handle
53      </p></dd><dt><span class="term">h_list</span></dt><dd><p>
54   list of input handles associated with the handler
55      </p></dd><dt><span class="term">node</span></dt><dd><p>
56   for placing the driver onto input_handler_list
57      </p></dd></dl></div></div><div class="refsect1"><a name="idp1114237860"></a><h2>Description</h2><p>
58   Input handlers attach to input devices and create input handles. There
59   are likely several handlers attached to any given input device at the
60   same time. All of them will get their copy of input event generated by
61   the device.
62   </p><p>
63
64   The very same structure is used to implement input filters. Input core
65   allows filters to run first and will not pass event to regular handlers
66   if any of the filters indicate that the event should be filtered (by
67   returning <code class="constant">true</code> from their <code class="function">filter</code> method).
68   </p><p>
69
70   Note that input core serializes calls to <code class="function">connect</code> and <code class="function">disconnect</code>
71   methods.
72</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-input-dev.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="input_subsystem.html#idp1114168316">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-struct-input-handle.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct input_dev</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">struct input_handle</span></td></tr></table></div></body></html>
73