-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a backend for nsyshid, that uses libusb to provide passthrough access to real usb devices.
- Loading branch information
1 parent
3fa9822
commit c9ee3c1
Showing
9 changed files
with
979 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it> | ||
# SPDX-License-Identifier: ISC | ||
|
||
find_package(libusb CONFIG) | ||
if (NOT libusb_FOUND) | ||
find_package(PkgConfig) | ||
if (PKG_CONFIG_FOUND) | ||
pkg_search_module(libusb IMPORTED_TARGET GLOBAL libusb-1.0 libusb) | ||
if (libusb_FOUND) | ||
add_library(libusb::libusb ALIAS PkgConfig::libusb) | ||
endif () | ||
endif () | ||
endif () | ||
|
||
find_package_handle_standard_args(libusb | ||
REQUIRED_VARS | ||
libusb_LINK_LIBRARIES | ||
libusb_FOUND | ||
VERSION_VAR libusb_VERSION | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
#include "nsyshid.h" | ||
#include "Backend.h" | ||
|
||
#if NSYSHID_ENABLE_BACKEND_LIBUSB | ||
|
||
#include "BackendLibusb.h" | ||
|
||
#endif | ||
|
||
namespace nsyshid::backend | ||
{ | ||
void AttachDefaultBackends() | ||
{ | ||
#if NSYSHID_ENABLE_BACKEND_LIBUSB | ||
// add libusb backend | ||
{ | ||
auto backendLibusb = std::make_shared<backend::libusb::BackendLibusb>(); | ||
if (backendLibusb->IsInitialisedOk()) | ||
{ | ||
AttachBackend(backendLibusb); | ||
} | ||
} | ||
#endif // NSYSHID_ENABLE_BACKEND_LIBUSB | ||
} | ||
} // namespace nsyshid::backend |
Oops, something went wrong.