目次 - SDL 3.0 API(機能別) - HIDAPI - SDL_hid_open

SDL_hid_open

ベンダーID(VID), プロダクトID(PID), シリアルナンバー(任意)を指定してHIDデバイスを開く

ヘッダ

SDL3/SDL_hidapi.h

構文

SDL_hid_device * SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number);

引数

unsigned shortvendor_idオープンするデバイスのベンダーID(VID)
unsigned shortproduct_idオープンするデバイスのプロダクトID(PID)
const wchar_t *serial_numberオープンするデバイスのシリアルナンバー (NULLも可)

戻り値

(SDL_hid_device *) SDL_hid_deviceオブジェクトへのポインタを戻す. 失敗のときNULLを戻す SDL_GetError()で詳細を知ることができる.

詳細

serial_numberがNULLのとき, 指定のVIDとPIDの最初のデバイスを開く.

バージョン

SDL 3.2.0以降

SDL Wikiへのリンク

SDL_hid_open - SDL Wiki