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