Path: blob/master/thirdparty/sdl/hidapi/mac/hidapi_darwin.h
9918 views
/*******************************************************1HIDAPI - Multi-Platform library for2communication with HID devices.34libusb/hidapi Team56Copyright 2022, All Rights Reserved.78At the discretion of the user of this library,9this software may be licensed under the terms of the10GNU General Public License v3, a BSD-Style license, or the11original HIDAPI license as outlined in the LICENSE.txt,12LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt13files located at the root of the source distribution.14These files may also be found in the public source15code repository located at:16https://github.com/libusb/hidapi .17********************************************************/1819/** @file20* @defgroup API hidapi API2122* Since version 0.12.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)23*/2425#ifndef HIDAPI_DARWIN_H__26#define HIDAPI_DARWIN_H__2728#include <stdint.h>2930#include "../hidapi/hidapi.h"3132#ifdef __cplusplus33extern "C" {34#endif3536/** @brief Get the location ID for a HID device.3738Since version 0.12.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)3940@ingroup API41@param dev A device handle returned from hid_open().42@param location_id The device's location ID on return.4344@returns45This function returns 0 on success and -1 on error.46*/47int HID_API_EXPORT_CALL hid_darwin_get_location_id(hid_device *dev, uint32_t *location_id);484950/** @brief Changes the behavior of all further calls to @ref hid_open or @ref hid_open_path.5152By default on Darwin platform all devices opened by HIDAPI with @ref hid_open or @ref hid_open_path53are opened in exclusive mode (see kIOHIDOptionsTypeSeizeDevice).5455Since version 0.12.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)5657@ingroup API58@param open_exclusive When set to 0 - all further devices will be opened59in non-exclusive mode. Otherwise - all further devices will be opened60in exclusive mode.6162@note During the initialisation by @ref hid_init - this property is set to 1 (TRUE).63This is done to preserve full backward compatibility with previous behavior.6465@note Calling this function before @ref hid_init or after @ref hid_exit has no effect.66*/67void HID_API_EXPORT_CALL hid_darwin_set_open_exclusive(int open_exclusive);6869/** @brief Getter for option set by @ref hid_darwin_set_open_exclusive.7071Since version 0.12.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)7273@ingroup API74@return 1 if all further devices will be opened in exclusive mode.7576@note Value returned by this function before calling to @ref hid_init or after @ref hid_exit77is not reliable.78*/79int HID_API_EXPORT_CALL hid_darwin_get_open_exclusive(void);8081/** @brief Check how the device was opened.8283Since version 0.12.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)8485@ingroup API86@param dev A device to get property from.8788@return 1 if the device is opened in exclusive mode, 0 - opened in non-exclusive,89-1 - if dev is invalid.90*/91int HID_API_EXPORT_CALL hid_darwin_is_device_open_exclusive(hid_device *dev);9293#ifdef __cplusplus94}95#endif9697#endif9899100