mirror of
https://github.com/ckb-next/ckb-next.git
synced 2026-10-10 12:27:21 -04:00
Merge branch 'm65-rgb-elite'
This commit is contained in:
@@ -40,6 +40,7 @@ ushort models[N_MODELS] = {
|
||||
// Mice
|
||||
P_M65,
|
||||
P_M65_PRO,
|
||||
P_M65_RGB_ELITE,
|
||||
P_GLAIVE,
|
||||
P_SABRE_O,
|
||||
P_SABRE_L,
|
||||
@@ -131,6 +132,8 @@ const char* product_str(ushort product){
|
||||
return "strafe_mk2";
|
||||
if(product == P_M65 || product == P_M65_PRO)
|
||||
return "m65";
|
||||
if(product == P_M65_RGB_ELITE)
|
||||
return "m65e";
|
||||
if(product == P_SABRE_O || product == P_SABRE_L || product == P_SABRE_N || product == P_SABRE_O2)
|
||||
return "sabre";
|
||||
if(product == P_SCIMITAR || product == P_SCIMITAR_PRO)
|
||||
|
||||
+5
-4
@@ -89,7 +89,8 @@
|
||||
|
||||
#define P_M65 0x1b12
|
||||
#define P_M65_PRO 0x1b2e
|
||||
#define IS_M65(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_M65 || (kb)->product == P_M65_PRO))
|
||||
#define P_M65_RGB_ELITE 0x1b5a
|
||||
#define IS_M65(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_M65 || (kb)->product == P_M65_PRO || (kb)->product == P_M65_RGB_ELITE))
|
||||
|
||||
#define P_SABRE_O 0x1b14 /* optical */
|
||||
#define P_SABRE_L 0x1b19 /* laser */
|
||||
@@ -116,7 +117,7 @@
|
||||
#define P_ST100 0x0a34
|
||||
#define IS_ST100(kb) ((kb)->vendor == V_CORSAIR && ((kb)->product == P_ST100))
|
||||
|
||||
#define N_MODELS 39
|
||||
#define N_MODELS 40
|
||||
extern ushort models[];
|
||||
|
||||
///
|
||||
@@ -166,7 +167,7 @@ const char* product_str(ushort product);
|
||||
#define IS_FULLRANGE(kb) (!IS_LEGACY((kb)->vendor, (kb)->product) && (kb)->product != P_K65 && (kb)->product != P_K70 && (kb)->product != P_K95 && (kb)->product != P_STRAFE_NRGB)
|
||||
|
||||
/// Mouse vs keyboard test
|
||||
#define IS_MOUSE(vendor, product) ((vendor) == (V_CORSAIR) && ((product) == (P_M65) || (product) == (P_M65_PRO) || (product) == (P_SABRE_O) || (product) == (P_SABRE_L) || (product) == (P_SABRE_N) || (product) == (P_SCIMITAR) || (product) == (P_SCIMITAR_PRO) || (product) == (P_SABRE_O2) || (product) == (P_GLAIVE) || (product) == (P_HARPOON) || (product) == (P_KATAR)))
|
||||
#define IS_MOUSE(vendor, product) ((vendor) == (V_CORSAIR) && ((product) == (P_M65) || (product) == (P_M65_PRO) || (product) == (P_M65_RGB_ELITE) || (product) == (P_SABRE_O) || (product) == (P_SABRE_L) || (product) == (P_SABRE_N) || (product) == (P_SCIMITAR) || (product) == (P_SCIMITAR_PRO) || (product) == (P_SABRE_O2) || (product) == (P_GLAIVE) || (product) == (P_HARPOON) || (product) == (P_KATAR)))
|
||||
|
||||
/// For calling with a usbdevice*, vendor and product are extracted and IS_MOUSE() is returned.
|
||||
#define IS_MOUSE_DEV(kb) IS_MOUSE((kb)->vendor, (kb)->product)
|
||||
@@ -190,7 +191,7 @@ const char* product_str(ushort product);
|
||||
#define IS_SINGLE_EP(kb) (IS_POLARIS(kb) || IS_ST100(kb))
|
||||
|
||||
/// Used for devices that use a file-based hardware animation system.
|
||||
#define USES_FILE_HWSAVE(kb) ((kb)->product == P_K95_PLATINUM || (kb)->product == P_K70_MK2 || (kb)->product == P_K70_MK2SE || (kb)->product == P_STRAFE_MK2 || (kb)->product == P_GLAIVE || (kb)->product == P_SCIMITAR_PRO || (kb)->product == P_K70_MK2LP)
|
||||
#define USES_FILE_HWSAVE(kb) ((kb)->product == P_K95_PLATINUM || (kb)->product == P_K70_MK2 || (kb)->product == P_K70_MK2SE || (kb)->product == P_STRAFE_MK2 || (kb)->product == P_GLAIVE || (kb)->product == P_SCIMITAR_PRO || (kb)->product == P_K70_MK2LP || (kb)->product == P_M65_RGB_ELITE)
|
||||
|
||||
/// USB delays for when the keyboards get picky about timing
|
||||
/// That was the original comment, but it is used anytime.
|
||||
|
||||
@@ -817,6 +817,12 @@ static QHash<QString, Key> getMap(KeyMap::Model model, KeyMap::Layout layout){
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Same as M65 but with the wheel zone instead of the front one
|
||||
case KeyMap::M65E:{
|
||||
map = getMap(KeyMap::M65, layout);
|
||||
map["wheel"] = {0, "Wheel Light", "wheel", map["front"].x, map["front"].y, map["front"].width, map["front"].height, true, false};
|
||||
map.remove("front");
|
||||
}
|
||||
default:; // <- stop GCC from complaining
|
||||
}
|
||||
// Map is finished, return result
|
||||
@@ -1047,6 +1053,8 @@ KeyMap::Model KeyMap::getModel(const QString& name){
|
||||
return K70MK2;
|
||||
if(lower == "strafe_mk2")
|
||||
return STRAFE_MK2;
|
||||
if(lower == "m65e")
|
||||
return M65E;
|
||||
return NO_MODEL;
|
||||
}
|
||||
|
||||
@@ -1090,6 +1098,8 @@ QString KeyMap::getModel(KeyMap::Model model){
|
||||
return "k70mk2";
|
||||
case STRAFE_MK2:
|
||||
return "strafe_mk2";
|
||||
case M65E:
|
||||
return "m65e";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
@@ -1123,6 +1133,7 @@ int KeyMap::modelWidth(Model model){
|
||||
case STRAFE_MK2:
|
||||
return KSTRAFE_WIDTH;
|
||||
case M65:
|
||||
case M65E:
|
||||
case SABRE:
|
||||
case SCIMITAR:
|
||||
case HARPOON:
|
||||
@@ -1152,6 +1163,7 @@ int KeyMap::modelHeight(Model model){
|
||||
case K95P:
|
||||
return K95P_HEIGHT;
|
||||
case M65:
|
||||
case M65E:
|
||||
case SABRE:
|
||||
case SCIMITAR:
|
||||
case HARPOON:
|
||||
|
||||
+2
-1
@@ -71,6 +71,7 @@ public:
|
||||
K70MK2,
|
||||
STRAFE_MK2,
|
||||
K66,
|
||||
M65E,
|
||||
_MODEL_MAX
|
||||
};
|
||||
// Key layouts (ordered alphabetically by name)
|
||||
@@ -115,7 +116,7 @@ public:
|
||||
// Type of device
|
||||
inline static bool isKeyboard(Model model) { return !isMouse(model) && !isMousepad(model) && !isHeadsetStand(model) && model != NO_MODEL; }
|
||||
inline bool isKeyboard() const { return isKeyboard(keyModel); }
|
||||
inline static bool isMouse(Model model) { return model == M65 || model == SABRE || model == SCIMITAR || model == HARPOON || model == GLAIVE || model == KATAR; }
|
||||
inline static bool isMouse(Model model) { return model == M65 || model == SABRE || model == SCIMITAR || model == HARPOON || model == GLAIVE || model == KATAR || model == M65E; }
|
||||
inline bool isMouse() const { return isMouse(keyModel); }
|
||||
inline static bool isMousepad(Model model) { return model == POLARIS; }
|
||||
inline bool isMousepad() const { return isMousepad(keyModel); }
|
||||
|
||||
@@ -115,7 +115,7 @@ void KeyWidget::paintEvent(QPaintEvent*){
|
||||
// Draw mouse overlays
|
||||
const QImage* overlay = 0;
|
||||
float xpos = 0.f, ypos = 0.f;
|
||||
if(model == KeyMap::M65){
|
||||
if(model == KeyMap::M65 || model == KeyMap::M65E){
|
||||
if(!m65Overlay)
|
||||
m65Overlay = new QImage(":/img/overlay_m65.png");
|
||||
overlay = m65Overlay;
|
||||
|
||||
Reference in New Issue
Block a user