added ant esports GM600 mouse
This commit is contained in:
parent
11bdaaa2fc
commit
406350f5f5
5 changed files with 87 additions and 9 deletions
|
|
@ -17,6 +17,7 @@ InstantMouseController::InstantMouseController(hid_device* dev_handle, const hid
|
|||
{
|
||||
dev = dev_handle;
|
||||
location = info.path;
|
||||
pid = info.product_id;
|
||||
version = "";
|
||||
}
|
||||
|
||||
|
|
@ -43,6 +44,11 @@ std::string InstantMouseController::GetSerialString()
|
|||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
uint16_t InstantMouseController::GetPID()
|
||||
{
|
||||
return pid;
|
||||
}
|
||||
|
||||
std::string InstantMouseController::GetFirmwareVersion()
|
||||
{
|
||||
return(version);
|
||||
|
|
@ -78,7 +84,7 @@ void InstantMouseController::SetMode(uint8_t mode_value, uint8_t speed, uint8_t
|
|||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Packet details: |
|
||||
| 07 13 FF MS DN -B -- -- |
|
||||
| 07 13 FF MS DN -B M- -- |
|
||||
| |
|
||||
| 07 = report id |
|
||||
| 13 = set mode function |
|
||||
|
|
@ -103,7 +109,7 @@ void InstantMouseController::SetMode(uint8_t mode_value, uint8_t speed, uint8_t
|
|||
pkt[4] = (direction << 4) | led_mask;
|
||||
pkt[5] = 0xF - (brightness & 0xF);
|
||||
|
||||
pkt[6] = 0x00;
|
||||
pkt[6] = mode_value & 0xF0;
|
||||
pkt[7] = 0x00;
|
||||
|
||||
hid_send_feature_report(dev, pkt, INSTANT_MOUSE_REPORT_SIZE);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,13 @@ enum
|
|||
INSTANT_MOUSE_LOOP_MODE = 0x04,
|
||||
INSTANT_MOUSE_SPECTRUM_CYCLE_MODE = 0x06,
|
||||
INSTANT_MOUSE_RAINBOW_WAVE_MODE = 0x07,
|
||||
INSTANT_MOUSE_BREATHING_MODE = 0x08
|
||||
INSTANT_MOUSE_BREATHING_MODE = 0x08,
|
||||
ANT_MOUSE_BREATHING_MODE = 0x09,
|
||||
INSTANT_MOUSE_ENRAPTURED_MODE = 0xBB,
|
||||
INSTANT_MOUSE_FLICKER_MODE = 0xB8,
|
||||
INSTANT_MOUSE_RIPPLE_MODE = 0xBA,
|
||||
INSTANT_MOUSE_STARTRECK_MODE = 0xB9,
|
||||
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
@ -48,6 +54,7 @@ public:
|
|||
|
||||
std::string GetSerialString();
|
||||
std::string GetDeviceLocation();
|
||||
uint16_t GetPID();
|
||||
std::string GetFirmwareVersion();
|
||||
|
||||
void SetMode(uint8_t mode_value, uint8_t speed, uint8_t brightness, uint8_t direction);
|
||||
|
|
@ -57,4 +64,5 @@ private:
|
|||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string version;
|
||||
uint16_t pid;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,11 +13,8 @@
|
|||
#include "InstantMouseController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_InstantMouse.h"
|
||||
#include "InstantMouseDevices.h"
|
||||
|
||||
#define INSTANT_MICROELECTRONICS_VID 0x30FA
|
||||
#define ADVANCED_GTA_250_PID 0x1030
|
||||
#define ANKO_KM43243952_VID 0x1440
|
||||
#define ANKO_KM43277483_VID 0x1540
|
||||
|
||||
void DetectInstantMouseControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
|
|
@ -35,3 +32,5 @@ void DetectInstantMouseControllers(hid_device_info* info, const std::string& nam
|
|||
REGISTER_HID_DETECTOR_IPU("Advanced GTA 250 USB Gaming Mouse", DetectInstantMouseControllers, INSTANT_MICROELECTRONICS_VID, ADVANCED_GTA_250_PID, 1, 0xFF01, 0x01);
|
||||
REGISTER_HID_DETECTOR_IPU("Anko KM43243952 USB Gaming Mouse", DetectInstantMouseControllers, INSTANT_MICROELECTRONICS_VID, ANKO_KM43243952_VID, 1, 0xFF01, 0x01);
|
||||
REGISTER_HID_DETECTOR_IPU("Anko KM43277483 USB Gaming Mouse", DetectInstantMouseControllers, INSTANT_MICROELECTRONICS_VID, ANKO_KM43277483_VID, 1, 0xFF01, 0x01);
|
||||
REGISTER_HID_DETECTOR_IPU("AntEsports GM600 USB Gaming Mouse", DetectInstantMouseControllers, INSTANT_MICROELECTRONICS_VID, ANTESPORTS_GM600_PID, 1, 0xFF01, 0001);
|
||||
|
||||
|
|
|
|||
19
Controllers/InstantMouseController/InstantMouseDevices.h
Normal file
19
Controllers/InstantMouseController/InstantMouseDevices.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*---------------------------------------------------------*\
|
||||
| InstantMouseController.h |
|
||||
| |
|
||||
| Driver for Instant mouse |
|
||||
| |
|
||||
| shafiahaz2478 29 Aug 2024 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
#pragma once
|
||||
|
||||
#define INSTANTMOUSEDEVICES_H
|
||||
|
||||
#define INSTANT_MICROELECTRONICS_VID 0x30FA
|
||||
#define ADVANCED_GTA_250_PID 0x1030
|
||||
#define ANKO_KM43243952_VID 0x1440
|
||||
#define ANKO_KM43277483_VID 0x1540
|
||||
#define ANTESPORTS_GM600_PID 0x1040
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_InstantMouse.h"
|
||||
#include "InstantMouseDevices.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Instant mouse
|
||||
|
|
@ -21,7 +22,8 @@
|
|||
@detectors DetectInstantMouseControllers
|
||||
@comment This controller should work with all mouse with this chip.
|
||||
Identified devices that work with this controller: Advance Gaming
|
||||
GTA 250 (GX72-A725), Anko KM43243952 (GM8-A825), Anko KM43277483
|
||||
GTA 250 (GX72-A725), Anko KM43243952 (GM8-A825), Anko KM43277483,
|
||||
Ant Esports GM600
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_InstantMouse::RGBController_InstantMouse(InstantMouseController* controller_ptr)
|
||||
|
|
@ -66,7 +68,10 @@ RGBController_InstantMouse::RGBController_InstantMouse(InstantMouseController* c
|
|||
|
||||
mode breathing;
|
||||
breathing.name = "Breathing";
|
||||
breathing.value = INSTANT_MOUSE_BREATHING_MODE;
|
||||
/*------------------------------------------------------------------*\
|
||||
| ANT ESPORTS GM600 has different mode id for breathing mode. |
|
||||
\*------------------------------------------------------------------*/
|
||||
breathing.value = (controller->GetPID() == ANTESPORTS_GM600_PID ) ? ANT_MOUSE_BREATHING_MODE : INSTANT_MOUSE_BREATHING_MODE;
|
||||
breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
breathing.colors.resize(1);
|
||||
|
|
@ -102,6 +107,47 @@ RGBController_InstantMouse::RGBController_InstantMouse(InstantMouseController* c
|
|||
loop.brightness_min = INSTANT_MOUSE_BRIGHTNESS_MIN;
|
||||
loop.brightness_max = INSTANT_MOUSE_BRIGHTNESS_MAX;
|
||||
modes.push_back(loop);
|
||||
/*------------------------------------------------------------------*\
|
||||
| Extra modes for Ant Esports GM600. |
|
||||
\*------------------------------------------------------------------*/
|
||||
if(controller->GetPID() == ANTESPORTS_GM600_PID )
|
||||
{
|
||||
mode enraptured;
|
||||
enraptured.name = "Enrpatured";
|
||||
enraptured.value = INSTANT_MOUSE_ENRAPTURED_MODE;
|
||||
enraptured.flags = MODE_FLAG_HAS_SPEED;
|
||||
enraptured.color_mode = MODE_COLORS_NONE;
|
||||
enraptured.speed_min = INSTANT_MOUSE_SPEED_MIN;
|
||||
enraptured.speed_max = INSTANT_MOUSE_SPEED_MAX;
|
||||
enraptured.speed = INSTANT_MOUSE_SPEED_MAX/2;
|
||||
modes.push_back(enraptured);
|
||||
|
||||
mode flicker;
|
||||
flicker.name = "Flicker";
|
||||
flicker.value = INSTANT_MOUSE_FLICKER_MODE;
|
||||
flicker.flags = MODE_FLAG_HAS_SPEED;
|
||||
flicker.color_mode = MODE_COLORS_NONE;
|
||||
flicker.speed_min = INSTANT_MOUSE_SPEED_MIN;
|
||||
flicker.speed_max = INSTANT_MOUSE_SPEED_MAX;
|
||||
flicker.speed = INSTANT_MOUSE_SPEED_MAX/2;
|
||||
modes.push_back(flicker);
|
||||
|
||||
mode ripple;
|
||||
ripple.name = "Ripple";
|
||||
ripple.value = INSTANT_MOUSE_RIPPLE_MODE;
|
||||
ripple.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
|
||||
ripple.color_mode = MODE_COLORS_NONE;
|
||||
ripple.speed_min = INSTANT_MOUSE_SPEED_MIN;
|
||||
ripple.speed_max = INSTANT_MOUSE_SPEED_MAX;
|
||||
ripple.speed = INSTANT_MOUSE_SPEED_MAX/2;
|
||||
modes.push_back(ripple);
|
||||
|
||||
mode startreck;
|
||||
startreck.name = "Star treck";
|
||||
startreck.value = INSTANT_MOUSE_STARTRECK_MODE;
|
||||
|
||||
modes.push_back(startreck);
|
||||
}
|
||||
|
||||
mode off;
|
||||
off.name = "Off";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue