mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
hid: add support of android devices
This commit is contained in:
parent
d766baef12
commit
8100779512
12 changed files with 81 additions and 26 deletions
|
|
@ -218,7 +218,7 @@ void ds3_pad_handler::init_config(cfg_pad* cfg)
|
|||
cfg->from_default();
|
||||
}
|
||||
|
||||
void ds3_pad_handler::check_add_device(hid_device* hidDevice, std::string_view path, std::wstring_view wide_serial)
|
||||
void ds3_pad_handler::check_add_device(hid_device* hidDevice, hid_enumerated_device_view path, std::wstring_view wide_serial)
|
||||
{
|
||||
if (!hidDevice)
|
||||
{
|
||||
|
|
@ -508,12 +508,16 @@ bool ds3_pad_handler::get_is_right_stick(const std::shared_ptr<PadDevice>& /*dev
|
|||
PadHandlerBase::connection ds3_pad_handler::update_connection(const std::shared_ptr<PadDevice>& device)
|
||||
{
|
||||
ds3_device* dev = static_cast<ds3_device*>(device.get());
|
||||
if (!dev || dev->path.empty())
|
||||
if (!dev || dev->path == hid_enumerated_device_default)
|
||||
return connection::disconnected;
|
||||
|
||||
if (dev->hidDevice == nullptr)
|
||||
{
|
||||
#ifdef ANDROID
|
||||
if (hid_device* hid_dev = hid_libusb_wrap_sys_device(dev->path, -1))
|
||||
#else
|
||||
if (hid_device* hid_dev = hid_open_path(dev->path.c_str()))
|
||||
#endif
|
||||
{
|
||||
if (hid_set_nonblocking(hid_dev, 1) == -1)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue