Git init
[framework/uifw/xorg/lib/libxi.git] / man / XSetDeviceButtonMapping.man
1 '\" t
2 .\"     Title: xsetdevicebuttonmapping
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5 .\"      Date: 09/07/2010
6 .\"    Manual: [FIXME: manual]
7 .\"    Source: [FIXME: source]
8 .\"  Language: English
9 .\"
10 .TH "XSETDEVICEBUTTONMAPP" "libmansuffix" "09/07/2010" "[FIXME: source]" "[FIXME: manual]"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
15 .nh
16 .\" disable justification (adjust text to left margin only)
17 .ad l
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
21 .SH "NAME"
22 XSetDeviceButtonMapping, XGetDeviceButtonMapping \- query or change device button mappings
23 .SH "SYNOPSIS"
24 .sp
25 .nf
26 #include <X11/extensions/XInput\&.h>
27 .fi
28 .sp
29 .nf
30 int XSetDeviceButtonMapping( Display *display,
31                              XDevice *device,
32                              unsigned char map[],
33                              int nmap);
34 .fi
35 .sp
36 .nf
37 int XGetDeviceButtonMapping( Display *display,
38                              XDevice *device,
39                              unsigned char map_return[],
40                              int nmap);
41 .fi
42 .sp
43 .nf
44 display
45        Specifies the connection to the X server\&.
46 .fi
47 .sp
48 .nf
49 device
50        Specifies the device whose button mapping is to be
51        queried or changed\&.
52 .fi
53 .sp
54 .nf
55 map
56        Specifies the mapping list\&.
57 .fi
58 .sp
59 .nf
60 map_return
61        Returns the mapping list\&.
62 .fi
63 .sp
64 .nf
65 nmap
66        Specifies the number of items in the mapping list\&.
67 .fi
68 .SH "DESCRIPTION"
69 .sp
70 .if n \{\
71 .RS 4
72 .\}
73 .nf
74 The XSetDeviceButtonMapping request sets the mapping of the
75 specified device\&. If it succeeds, the X server generates a
76 DeviceMappingNotify event, and XSetDeviceButtonMapping returns
77 MappingSuccess\&. Element map[i] defines the logical button
78 number for the physical button i+1\&. The length of the list must
79 be the same as XGetDeviceButtonMapping would return, or a
80 BadValue error results\&. A zero element disables a button, and
81 elements are not restricted in value by the number of physical
82 buttons\&. However, no two elements can have the same nonzero
83 value, or a BadValue error results\&. If any of the buttons to be
84 altered are logically in the down state,
85 XSetDeviceButtonMapping returns MappingBusy, and the mapping is
86 not changed\&.
87 .fi
88 .if n \{\
89 .RE
90 .\}
91 .sp
92 .if n \{\
93 .RS 4
94 .\}
95 .nf
96 XSetDeviceButtonMapping can generate BadDevice, BadMatch, and
97 BadValue errors\&.
98 .fi
99 .if n \{\
100 .RE
101 .\}
102 .sp
103 .if n \{\
104 .RS 4
105 .\}
106 .nf
107 The XGetDeviceButtonMapping request returns the current mapping
108 of the specified device\&. Buttons are numbered starting from
109 one\&.XGetDeviceButtonMapping returns the number of physical
110 buttons actually on the device\&. The nominal mapping for a
111 device is map[i]=i+1\&. The nmap argument specifies the length of
112 the array where the device mapping is returned, and only the
113 first nmap elements are returned in map_return\&.
114 .fi
115 .if n \{\
116 .RE
117 .\}
118 .sp
119 .if n \{\
120 .RS 4
121 .\}
122 .nf
123 XGetDeviceButtonMapping can generate BadDevice or BadMatch
124 errors\&.
125 .fi
126 .if n \{\
127 .RE
128 .\}
129 .SH "DIAGNOSTICS"
130 .sp
131 .if n \{\
132 .RS 4
133 .\}
134 .nf
135 BadDevice
136        An invalid device was specified\&. The specified device
137        does not exist or has not been opened by this client via
138        XOpenInputDevice\&. This error may also occur if the
139        specified device is the X keyboard or X pointer device\&.
140 .fi
141 .if n \{\
142 .RE
143 .\}
144 .sp
145 .if n \{\
146 .RS 4
147 .\}
148 .nf
149 BadMatch
150        This error may occur if an XGetDeviceButtonMapping or
151        XSetDeviceButtonMapping request was made specifying a
152        device that has no buttons\&.
153 .fi
154 .if n \{\
155 .RE
156 .\}
157 .sp
158 .if n \{\
159 .RS 4
160 .\}
161 .nf
162 BadValue
163        Some numeric value falls outside the range of values
164        accepted by the request\&. Unless a specific range is
165        specified for an argument, the full range defined by the
166        argument\'s type is accepted\&. Any argument defined as a
167        set of alternatives can generate this error\&.
168 .fi
169 .if n \{\
170 .RE
171 .\}
172 .SH "SEE ALSO"
173 .sp
174 .if n \{\
175 .RS 4
176 .\}
177 .nf
178 XChangeDeviceKeyboardControl(libmansuffix), XChangeDeviceKeyMapping(libmansuffix),
179 XChangeDeviceModifierMapping(libmansuffix)
180 .fi
181 .if n \{\
182 .RE
183 .\}