xref: /haiku/docs/user/interface/Input.dox (revision 4a32f48e70297d9a634646f01e08c2f451ecd6bd)
1/*
2 * Copyright 2019 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Name, email@email.com
7 *
8 * Corresponds to:
9 *		headers/os/interface/Input.h	hrev32748
10 *		src/kits/interface/Input.cpp	hrev46376
11 */
12
13
14///// TO THEY WHO DOCUMENT /////
15// The BeBook puts this class and its functions under the category 'Input Server'
16// grouped together with BInputServerDevice, BInputServerFilter and BInputServerMethod
17// Not sure if we should follow that choice.
18
19/*!
20	\file Input.h
21	\ingroup interface
22	\brief Undocumented file.
23
24	\since Haiku R1
25*/
26
27
28/*!
29	\class BInputDevice
30	\ingroup interface
31	\ingroup libbe
32	\brief Undocumented class.
33
34	\since Haiku R1
35*/
36
37
38/*!
39	\fn BInputDevice::~BInputDevice()
40	\brief Undocumented public method
41
42	\return Undocumented
43	\retval <value> Undocumented
44
45	\since Haiku R1
46*/
47
48
49/*!
50	\fn const char* BInputDevice::Name() const
51	\brief Undocumented public method
52
53	\return Undocumented
54	\retval <value> Undocumented
55
56	\since Haiku R1
57*/
58
59
60/*!
61	\fn input_device_type BInputDevice::Type() const
62	\brief Undocumented public method
63
64	\return Undocumented
65	\retval <value> Undocumented
66
67	\since Haiku R1
68*/
69
70
71/*!
72	\fn bool BInputDevice::IsRunning() const
73	\brief Undocumented public method
74
75	\return Undocumented
76	\retval <value> Undocumented
77
78	\since Haiku R1
79*/
80
81
82/*!
83	\fn status_t BInputDevice::Start()
84	\brief Undocumented public method
85
86	\return Undocumented
87	\retval <value> Undocumented
88
89	\since Haiku R1
90*/
91
92
93/*!
94	\fn status_t BInputDevice::Stop()
95	\brief Undocumented public method
96
97	\return Undocumented
98	\retval <value> Undocumented
99
100	\since Haiku R1
101*/
102
103
104/*!
105	\fn status_t BInputDevice::Control(uint32 code, BMessage *message)
106	\brief Undocumented public method
107
108	\param code Undocumented
109	\param message Undocumented
110
111	\return Undocumented
112	\retval <value> Undocumented
113
114	\since Haiku R1
115*/
116
117
118/*!
119	\fn static static status_t BInputDevice::Start(input_device_type type)
120	\brief Undocumented public method
121
122	\param type Undocumented
123
124	\return Undocumented
125	\retval <value> Undocumented
126
127	\since Haiku R1
128*/
129
130
131/*!
132	\fn static static status_t BInputDevice::Stop(input_device_type type)
133	\brief Undocumented public method
134
135	\param type Undocumented
136
137	\return Undocumented
138	\retval <value> Undocumented
139
140	\since Haiku R1
141*/
142
143
144/*!
145	\fn static static status_t BInputDevice::Control(input_device_type type, uint32 code, BMessage *message)
146	\brief Undocumented public method
147
148	\param type Undocumented
149	\param code Undocumented
150	\param message Undocumented
151
152	\return Undocumented
153	\retval <value> Undocumented
154
155	\since Haiku R1
156*/
157
158
159/*!
160	\enum input_method_op
161	\ingroup <kit name>
162	\brief Undocumented enum.
163
164	\since Haiku R1
165*/
166
167
168/*!
169	\var input_method_op B_INPUT_METHOD_STARTED
170	\brief Undocumented enum value.
171
172	\since Haiku R1
173*/
174
175
176/*!
177	\var input_method_op B_INPUT_METHOD_STOPPED
178	\brief Undocumented enum value.
179
180	\since Haiku R1
181*/
182
183
184/*!
185	\var input_method_op B_INPUT_METHOD_CHANGED
186	\brief Undocumented enum value.
187
188	\since Haiku R1
189*/
190
191
192/*!
193	\var input_method_op B_INPUT_METHOD_LOCATION_REQUEST
194	\brief Undocumented enum value.
195
196	\since Haiku R1
197*/
198
199
200/*!
201	\enum input_device_type
202	\ingroup interface
203	\brief Device types that the Input Server can recognize.
204
205	\since Haiku R1
206*/
207
208
209/*!
210	\var input_device_type B_POINTING_DEVICE
211	\brief Pointing devices like mice, drawing tablets, touch screens, etc.
212
213	These devices generate \c B_MOUSE_MOVED, \c B_MOUSE_UP, and \c B_MOUSE_DOWN
214	messages.
215
216	\since Haiku R1
217*/
218
219
220/*!
221	\var input_device_type B_KEYBOARD_DEVICE
222	\brief Key-based input devices like a keyboard, number pad, etc.
223
224	These devices generate \c B_KEY_DOWN, \c B_UNMAPPED_KEY_DOWN, \c B_KEY_UP,
225	\c B_UNMAPPED_KEY_UP, and \c B_MODIFIERS_CHANGED messages.
226
227	\since Haiku R1
228*/
229
230
231/*!
232	\var input_device_type B_UNDEFINED_DEVICE
233	\brief An undefined/unknown type of input device.
234
235	\since Haiku R1
236*/
237
238
239/*!
240	\enum input_device_notification
241	\ingroup interface
242	\brief Constants for the \c be:opcode field of a \c B_INPUT_DEVICES_CHANGED
243		   message.
244
245	These message constants reflect changes in the state of input devices that
246	the Input Server is aware of.
247
248	\since Haiku R1
249*/
250
251
252/*!
253	\var input_device_notification B_INPUT_DEVICE_ADDED
254	\brief An input device was added to the system.
255
256	\since Haiku R1
257*/
258
259
260/*!
261	\var input_device_notification B_INPUT_DEVICE_STARTED
262	\brief An input device was started.
263
264	\since Haiku R1
265*/
266
267
268/*!
269	\var input_device_notification B_INPUT_DEVICE_STOPPED
270	\brief An input device was stopped.
271
272	\since Haiku R1
273*/
274
275
276/*!
277	\var input_device_notification B_INPUT_DEVICE_REMOVED
278	\brief An input device was removed from the system.
279
280	\since Haiku R1
281*/
282
283
284/*!
285	\fn BInputDevice* find_input_device(const char *name)
286	\brief Undocumented function
287
288	\param name Undocumented
289
290	\return Undocumented
291	\retval <value> Undocumented
292
293	\since Haiku R1
294*/
295
296
297/*!
298	\fn status_t get_input_devices(BList *list)
299	\brief Undocumented function
300
301	\param list Undocumented
302
303	\return Undocumented
304	\retval <value> Undocumented
305
306	\since Haiku R1
307*/
308
309
310/*!
311	\fn status_t watch_input_devices(BMessenger target, bool start)
312	\brief Start/stop watching input devices for state changes.
313
314	Informs the Input Server that \a target would like to start/stop receiving
315	\c B_INPUT_DEVICES_CHANGED messages, reflecting the state of input devices
316	the Input Server is aware of.
317
318	The \c B_INPUT_DEVICES_CHANGED message contains:
319		- \c be:opcode An \c input_device_notifcation constant that identifies
320			 which event occured.
321		- \c be:device_name A string containing the device's name.
322		- \c be:device_type An \c input_device_type constant representing the
323			 device's type.
324
325	\param target Where the device state change messages should or should not be
326		   sent.
327	\param start Whether \a target should start/stop receiving device state
328		   change messages.
329
330	\return A status code.
331	\retval B_OK Watching has successfully been started or stopped.
332	\retval B_BAD_VALUE \a target never started watching for device state
333			changes, though a request was made to stop watching for changes.
334	\retval Other errors depending on the state of the Input Server.
335
336	\since Haiku R1
337*/
338