From 7da0640987e11095ce67aaf0efc5d0aac96d9535 Mon Sep 17 00:00:00 2001 From: Emil Melnikov Date: Fri, 30 Dec 2016 22:43:00 +0300 Subject: [PATCH 1/2] Find libusb via pkgconfig in CMakeLists.txt --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3297963..0513ae1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,14 @@ cmake_minimum_required(VERSION 3.1) project(bloody) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -I/usr/include/libusb-1.0 -lusb-1.0") #TODO: findlibusb +find_package(PkgConfig REQUIRED) +pkg_search_module(LIBUSB1 REQUIRED libusb-1.0) +include_directories(SYSTEM ${LIBUSB1_INCLUDE_DIRS}) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES main.cpp) -add_executable(bloody ${SOURCE_FILES} Mouse.cpp Mouse.h) \ No newline at end of file +add_executable(bloody ${SOURCE_FILES} Mouse.cpp Mouse.h) +target_link_libraries(bloody ${LIBUSB1_LIBRARIES}) From 3184e45b3e1af3bfacb60a91e9194fdd5a1629de Mon Sep 17 00:00:00 2001 From: Emil Melnikov Date: Fri, 30 Dec 2016 22:43:47 +0300 Subject: [PATCH 2/2] Add Bloody AL9 mouse --- Mouse.cpp | 3 +++ Mouse.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Mouse.cpp b/Mouse.cpp index 2614625..4b08905 100644 --- a/Mouse.cpp +++ b/Mouse.cpp @@ -154,6 +154,9 @@ void Mouse::listDevices() { case BLOODY_R3_PID: name = "Bloody R3"; break; + case BLOODY_AL9_PID: + name = "Bloody AL9"; + break; default: name = "Unknown"; } diff --git a/Mouse.h b/Mouse.h index 9af07db..807413e 100644 --- a/Mouse.h +++ b/Mouse.h @@ -15,8 +15,9 @@ static const int BLOODY_V8_PID = 0x11F5; static const int BLOODY_R7_PID = 0x1485; static const int BLOODY_R8_1_PID = 0x14ee; static const int BLOODY_R3_PID = 0x1a5a; +static const int BLOODY_AL9_PID = 0xf633; -static const int COMPATIBLE_PIDS[] = {BLOODY_V5_PID, BLOODY_V7_PID, BLOODY_V8_PID, BLOODY_R7_PID, BLOODY_R8_1_PID, BLOODY_R3_PID}; +static const int COMPATIBLE_PIDS[] = {BLOODY_V5_PID, BLOODY_V7_PID, BLOODY_V8_PID, BLOODY_R7_PID, BLOODY_R8_1_PID, BLOODY_R3_PID, BLOODY_AL9_PID}; static const size_t COMPATIBLE_PIDS_SIZE = sizeof(COMPATIBLE_PIDS)/sizeof(COMPATIBLE_PIDS[0]); static const int A4TECH_MAGIC = 0x07;