Cooler Master Keyboard Controller v2
This commit is contained in:
parent
28bf11d119
commit
a35616326c
29 changed files with 3174 additions and 2904 deletions
|
|
@ -0,0 +1,205 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMKeyboardAbstractController.h |
|
||||
| |
|
||||
| Abstract driver for Coolermaster keyboards |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
#include "CMKeyboardAbstractController.h"
|
||||
|
||||
CMKeyboardAbstractController::CMKeyboardAbstractController(hid_device* dev_handle, hid_device_info* dev_info)
|
||||
{
|
||||
const uint8_t sz = HID_MAX_STR;
|
||||
wchar_t tmp[sz];
|
||||
|
||||
m_pDev = dev_handle;
|
||||
m_productId = dev_info->product_id;
|
||||
m_sLocation = dev_info->path;
|
||||
|
||||
hid_get_manufacturer_string(m_pDev, tmp, sz);
|
||||
std::wstring wName = std::wstring(tmp);
|
||||
m_vendorName = std::string(wName.begin(), wName.end());
|
||||
|
||||
hid_get_product_string(m_pDev, tmp, sz);
|
||||
wName = std::wstring(tmp);
|
||||
m_deviceName = std::string(wName.begin(), wName.end());
|
||||
|
||||
m_serialNumber = m_deviceName;
|
||||
|
||||
bool bNotFound = true;
|
||||
|
||||
for(uint16_t i = 0; i < COOLERMASTER_KEYBOARD_DEVICE_COUNT; i++)
|
||||
{
|
||||
if(cm_kb_device_list[i]->product_id == m_productId)
|
||||
{
|
||||
bNotFound = false;
|
||||
m_deviceIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(bNotFound)
|
||||
{
|
||||
LOG_ERROR("[%s] device capabilities not found. Please creata a new device request.",
|
||||
m_deviceName.c_str());
|
||||
}
|
||||
};
|
||||
|
||||
CMKeyboardAbstractController::~CMKeyboardAbstractController()
|
||||
{
|
||||
if(m_pDev)
|
||||
{
|
||||
hid_close(m_pDev);
|
||||
}
|
||||
};
|
||||
|
||||
std::string CMKeyboardAbstractController::GetDeviceName()
|
||||
{
|
||||
return m_deviceName;
|
||||
}
|
||||
|
||||
void CMKeyboardAbstractController::SetDeviceName(std::string name)
|
||||
{
|
||||
m_deviceName = name;
|
||||
}
|
||||
|
||||
std::string CMKeyboardAbstractController::GetDeviceVendor()
|
||||
{
|
||||
return m_vendorName;
|
||||
}
|
||||
|
||||
std::string CMKeyboardAbstractController::GetDeviceSerial()
|
||||
{
|
||||
return m_serialNumber;
|
||||
}
|
||||
|
||||
const cm_kb_device* CMKeyboardAbstractController::GetDeviceData()
|
||||
{
|
||||
return cm_kb_device_list[m_deviceIndex];
|
||||
}
|
||||
|
||||
std::string CMKeyboardAbstractController::GetLocation()
|
||||
{
|
||||
return m_sLocation;
|
||||
}
|
||||
|
||||
std::string CMKeyboardAbstractController::GetFirmwareVersion()
|
||||
{
|
||||
return m_sFirmwareVersion;
|
||||
}
|
||||
|
||||
int CMKeyboardAbstractController::GetProductID()
|
||||
{
|
||||
return m_productId;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> CMKeyboardAbstractController::SendCommand(std::vector<uint8_t> buf, uint8_t fill)
|
||||
{
|
||||
int status;
|
||||
std::vector<uint8_t> read;
|
||||
|
||||
uint8_t data[CM_KEYBOARD_WRITE_SIZE];
|
||||
memset(data, fill, CM_KEYBOARD_WRITE_SIZE);
|
||||
|
||||
size_t i = 1;
|
||||
for(uint8_t b : buf)
|
||||
{
|
||||
data[i++] = b;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> guard(m_mutexSendCommand);
|
||||
status = hid_write(m_pDev, data, CM_KEYBOARD_WRITE_SIZE);
|
||||
|
||||
if(status < 0)
|
||||
{
|
||||
LOG_ERROR("[%s] SendCommand() failed code %d.", m_deviceName.c_str(), status);
|
||||
return read;
|
||||
}
|
||||
|
||||
memset(data, 0, CM_KEYBOARD_WRITE_SIZE);
|
||||
status = hid_read(m_pDev, data, CM_KEYBOARD_WRITE_SIZE);
|
||||
|
||||
if(status < 0)
|
||||
{
|
||||
LOG_ERROR("[%s] SendCommand() failed code %d.", m_deviceName.c_str(), status);
|
||||
return read;
|
||||
}
|
||||
|
||||
for(i = 0; i < (size_t)status; i++)
|
||||
{
|
||||
read.push_back(data[i]);
|
||||
}
|
||||
|
||||
return read;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Enter/leave direct control mode |
|
||||
\*---------------------------------------------------------*/
|
||||
void CMKeyboardAbstractController::SetControlMode(uint8_t modeId)
|
||||
{
|
||||
SendCommand({0x41, (uint8_t)modeId});
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Sets the currently active profile. |
|
||||
| byte[0] = 0x51 0x00 0x00 0x00 |
|
||||
| byte[4] = profileId |
|
||||
| - corresponds to saved keyboard profile i.e. [1-4] |
|
||||
| - 0x05 - Used on MK and CK style keyboards? |
|
||||
\*---------------------------------------------------------*/
|
||||
void CMKeyboardAbstractController::SetActiveProfile(uint8_t profileId)
|
||||
{
|
||||
SendCommand({0x51, 0x00, 0x00, 0x00, profileId});
|
||||
};
|
||||
|
||||
uint8_t CMKeyboardAbstractController::GetActiveProfile()
|
||||
{
|
||||
std::vector<uint8_t> data = SendCommand({0x52, 0x00});
|
||||
|
||||
if(data.size() > 4)
|
||||
{
|
||||
return (int)data[4];
|
||||
}
|
||||
|
||||
return 0xFF; // error
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Saves changes in currently used profile. |
|
||||
| byte[1] = 0x52 |
|
||||
\*---------------------------------------------------------*/
|
||||
void CMKeyboardAbstractController::SaveActiveProfile()
|
||||
{
|
||||
SendCommand({0x50, 0x55});
|
||||
}
|
||||
|
||||
void CMKeyboardAbstractController::SetActiveEffect(uint8_t effectId)
|
||||
{
|
||||
SendCommand({0x51, 0x28, 0x00, 0x00, effectId});
|
||||
};
|
||||
|
||||
void CMKeyboardAbstractController::SaveProfile()
|
||||
{
|
||||
SendCommand({0x50, 0x55});
|
||||
}
|
||||
|
||||
|
||||
uint8_t CMKeyboardAbstractController::GetModeStatus()
|
||||
{
|
||||
std::vector<uint8_t> data = SendCommand({0x52, 0x28});
|
||||
return data[4];
|
||||
};
|
||||
|
||||
std::string CMKeyboardAbstractController::GetHexString(std::vector<uint8_t> buf)
|
||||
{
|
||||
std::stringstream hexss;
|
||||
|
||||
for(uint8_t b : buf)
|
||||
{
|
||||
hexss << std::hex << b << " ";
|
||||
}
|
||||
|
||||
return hexss.str();
|
||||
}
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMKeyboardAbstractController.h |
|
||||
| |
|
||||
| Abstract driver for Coolermaster keyboards |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstring>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#include "CMKeyboardDevices.h"
|
||||
#include "KeyboardLayoutManager.h"
|
||||
#include "RGBController.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
|
||||
#define HID_MAX_STR 255
|
||||
#define CM_KEYBOARD_WRITE_SIZE 65
|
||||
#define CM_MAX_LEDS 255
|
||||
#define CM_KEYBOARD_TIMEOUT 50
|
||||
#define CM_KEYBOARD_TIMEOUT_SHORT 3
|
||||
|
||||
struct cm_keyboard_effect
|
||||
{
|
||||
uint8_t effectId;
|
||||
uint8_t p1;
|
||||
uint8_t p2;
|
||||
uint8_t p3;
|
||||
RGBColor color1;
|
||||
RGBColor color2;
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| byte[0] = 0x41 |
|
||||
| byte[1] = modeId |
|
||||
\*---------------------------------------------------------*/
|
||||
enum cm_keyboard_control_mode
|
||||
{
|
||||
MODE_FIRMWARE = 0x00,
|
||||
MODE_EFFECT = 0x01,
|
||||
MODE_MANUAL_V2 = 0x02,
|
||||
MODE_CUSTOM_PROFILE = 0x03,
|
||||
MODE_CUSTOM_PROFILE_V2 = 0x05,
|
||||
MODE_DIRECT = 0x80
|
||||
};
|
||||
|
||||
class CMKeyboardAbstractController
|
||||
{
|
||||
public:
|
||||
CMKeyboardAbstractController(hid_device* dev_handle, hid_device_info* dev_info);
|
||||
~CMKeyboardAbstractController();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Common USB controller fuctions |
|
||||
\*---------------------------------------------------------*/
|
||||
int GetProductID();
|
||||
std::string GetDeviceName();
|
||||
void SetDeviceName(std::string name);
|
||||
std::string GetDeviceVendor();
|
||||
std::string GetDeviceSerial();
|
||||
std::string GetLocation();
|
||||
std::string GetFirmwareVersion();
|
||||
const cm_kb_device* GetDeviceData();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard Layout Manager support funtions |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Common keyboard driver functions |
|
||||
\*---------------------------------------------------------*/
|
||||
virtual void SetControlMode(uint8_t modeId);
|
||||
virtual void SetActiveProfile(uint8_t profileId);
|
||||
virtual uint8_t GetActiveProfile();
|
||||
virtual void SaveActiveProfile();
|
||||
virtual void SaveProfile();
|
||||
virtual void SetActiveEffect(uint8_t effectId);
|
||||
virtual uint8_t GetModeStatus();
|
||||
virtual void InitializeModes(std::vector<mode> &modes) = 0;
|
||||
virtual KEYBOARD_LAYOUT GetKeyboardLayout() = 0;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Protocol specific funtions to be implmented |
|
||||
\*---------------------------------------------------------*/
|
||||
virtual void SetLeds(std::vector<led> leds, std::vector<RGBColor> colors) = 0;
|
||||
virtual void SetSingleLED(uint8_t in_led, RGBColor in_color) = 0;
|
||||
virtual void Initialize() = 0;
|
||||
virtual void Shutdown() = 0;
|
||||
virtual void SetLEDControl(bool bManual) = 0; // FW or SW control
|
||||
virtual void SetCustomMode() = 0;
|
||||
virtual void SetMode(mode selectedMode) = 0;
|
||||
|
||||
protected:
|
||||
/*---------------------------------------------------------*\
|
||||
| Utility functions. |
|
||||
\*---------------------------------------------------------*/
|
||||
std::vector<std::uint8_t> SendCommand(std::vector<uint8_t> buf, uint8_t fill=0x00);
|
||||
std::string GetHexString(std::vector<uint8_t> buf);
|
||||
std::string m_sFirmwareVersion;
|
||||
std::string m_deviceName;
|
||||
hid_device* m_pDev;
|
||||
uint16_t m_productId;
|
||||
uint16_t m_deviceIndex;
|
||||
std::string m_vendorName;
|
||||
std::string m_sLocation;
|
||||
std::string m_serialNumber;
|
||||
KEYBOARD_LAYOUT m_keyboardLayout;
|
||||
std::map<int, int> mapModeValueEffect;
|
||||
std::mutex m_mutex;
|
||||
std::mutex m_mutexSendCommand;
|
||||
};
|
||||
|
||||
768
Controllers/CoolerMasterController/CMKeyboardDevices.cpp
Normal file
768
Controllers/CoolerMasterController/CMKeyboardDevices.cpp
Normal file
|
|
@ -0,0 +1,768 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMKeyboardDevices.cpp |
|
||||
| |
|
||||
| Keymap definitions for Cooler Master Keyboards |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
#include "CMKeyboardDevices.h"
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Coolermaster Key Values |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
|
||||
const std::vector<unsigned int> mk_pro_s_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
96, 97, 98, 99, 104, 105, 106, 112, 113, 114, 67, 68, 69, 102, 103, 107,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP */
|
||||
0, 1, 8, 9, 16, 17, 24, 25, 32, 33, 40, 41, 48, 49, 56, 57, 64,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN */
|
||||
2, 3, 10, 11, 18, 19, 26, 27, 34, 35, 42, 43, 50, 51, 58, 59, 66,
|
||||
/* CPLK A S D F G H J K L ; " # ENTR */
|
||||
4, 5, 12, 13, 20, 21, 28, 29, 36, 37, 44, 45, 89, 52,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU */
|
||||
6, 100, 7, 14, 15, 22, 23, 30, 31, 38, 39, 46, 47, 61,
|
||||
/* LCTL LWIN LALT SPC RALT RFNC RMNU RCTL ARWL ARWD ARWR */
|
||||
91, 90, 92, 93, 94, 60, 95, 54, 63, 62, 70,
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> mk_pro_l_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK P1 P2 P3 P4 */
|
||||
11, 22, 30, 25, 27, 7, 51, 57, 62, 86, 87, 83, 85, 79, 72, 0,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP NMLK NMDV NMTM NMMI */
|
||||
14, 15, 23, 31, 39, 38, 46, 47, 55, 63, 71, 70, 54, 81, 3, 1, 2, 100, 108, 116, 118,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN NM7 NM8 NM9 NMPL */
|
||||
9, 8, 16, 24, 32, 33, 41, 40, 48, 56, 64, 65, 49, 82, 94, 92, 88, 96, 104, 112, 110,
|
||||
/* CPLK A S D F G H J K L ; ' \ ENTR NM4 NM5 NM6 */
|
||||
17, 10, 18, 26, 34, 35, 43, 42, 50, 58, 66, 67, 68, 84, 97, 105, 113,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
73, 19, 12, 20, 28, 36, 37, 45, 44, 52, 60, 69, 74, 80, 98, 106, 114, 111,
|
||||
/* LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR NM0 NMPD */
|
||||
6, 90, 75, 91, 77, 78, 61, 4, 95, 93, 5, 107, 115,
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> mk850_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK AIM AIMU AIMD */
|
||||
6, 27, 34, 41, 48, 62, 69, 76, 83, 90, 97, 104, 111, 118, 125, 132,
|
||||
/* M1 BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP NMLK NMDV NMTM NMMI */
|
||||
7, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98, 112, 119, 126, 133, 254, 147, 154, 161,
|
||||
/* M2 TAB Q W E R T Y U I O P [ ] \ DEL END PGDN NM7 NM8 NM9 NMPL */
|
||||
8, 22, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 99, 113, 120, 127, 134, 141, 148, 155, 162,
|
||||
/* M3 CPLK A S D F G H J K L ; ' # ENTR NM4 NM5 NM6 */
|
||||
9, 23, 30, 37, 44, 51, 58, 65, 72, 79, 86, 93, 0, 114, 142, 149, 156,
|
||||
/* M4 LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
10, 0, 24, 31, 38, 45, 52, 59, 66, 73, 80, 87, 115, 129, 143, 150, 157, 164,
|
||||
/* M5 LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR NM0 NMPD */
|
||||
11, 18, 25, 53, 81, 88, 95, 116, 123, 130, 137, 144, 158,
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*\
|
||||
| CoolerMaster SK (60%) |
|
||||
\*-------------------------------------------------------------*/
|
||||
const std::vector<unsigned int> sk622_keymap =
|
||||
{
|
||||
/* T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 */
|
||||
/* L1 ESC 1 2 3 4 5 6 7 8 9 0 - = BPSC R1 */
|
||||
8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 106,
|
||||
/* L2 TAB Q W E R T Y U I O P [ ] R2 */
|
||||
9, 23, 30, 37, 44, 51, 58, 65, 72, 79, 86, 93, 100,
|
||||
/* L3 CPLK A S D F G H J K L ; " \ ENTR R3 */
|
||||
10, 24, 31, 38, 45, 52, 59, 66, 73, 80, 87, 94, 101, 108,
|
||||
/* L4 LSFT ISO\ Z X C V B N M , . # RSFT ARWU DEL R$ */
|
||||
11, 18, 25, 32, 39, 46, 53, 60, 67, 74, 81, 88, 95, 102, 109,
|
||||
/* L5 LCTL LWIN LALT SPACE RALT RWFNC ARWL ARDN ARWR R5 */
|
||||
12, 19, 26, 54, 82, 89, 96, 103, 110,
|
||||
/* B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15 B15 */
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> sk630_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
9, 33, 41, 49, 57, 73, 81, 89, 97, 105, 113, 121, 129, 137, 145, 153,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP */
|
||||
10, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, 130, 138, 146, 154,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN */
|
||||
11, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, 131, 139, 147, 155,
|
||||
/* CPLK A S D F G H J K L ; " # ENTR */
|
||||
12, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 116, 132,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU */
|
||||
13, 21, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, 133, 149,
|
||||
/* LCTL LWIN LALT SPC RALT RFNC RMNU RCTL ARWL ARWD ARWR */
|
||||
14, 22, 30, 62, 94, 102, 110, 134, 142, 150, 158,
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> sk650_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
0, 24, 32, 40, 48, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP NMLK NMDV NMTM NMMI */
|
||||
1, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, 105, 121, 129, 137, 145, 153, 161, 169, 177,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN NM7 NM8 NM9 NMPL */
|
||||
2, 18, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 122, 130, 138, 146, 154, 162, 170, 178,
|
||||
/* CPLK A S D F G H J K L ; ' # ENTR NM4 NM5 NM6 */
|
||||
3, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 123, 155, 163, 171,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
4, 20, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 124, 140, 156, 164, 172, 180,
|
||||
/* LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR NM0 NMPD */
|
||||
5, 13, 21, 53, 85, 93, 101, 125, 133, 141, 149, 165, 173,
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> sk652_keymap =
|
||||
{
|
||||
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
9, 33, 41, 49, 57, 73, 81, 89, 97, 105, 113, 121, 129, 137, 145, 153,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP NMLK NMDV NMTM NMMI */
|
||||
10, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, 130, 138, 146, 154, 162, 170, 178, 186,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN NM7 NM8 NM9 NMPL */
|
||||
11, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, 131, 139, 147, 155, 163, 171, 179, 187,
|
||||
/* CPLK A S D F G H J K L ; ' # ENTR NM4 NM5 NM6 */
|
||||
12, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 116, 132, 164, 172, 180,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
13, 21, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, 133, 149, 165, 173, 181, 189,
|
||||
/* LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR NM0 NMPD */
|
||||
14, 22, 30, 62, 94, 102, 110, 134, 142, 150, 158, 174, 182,
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> sk653_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
0, 24, 32, 40, 48, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP NMLK NMDV NMTM NMMI */
|
||||
1, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, 105, 121, 129, 137, 145, 153, 161, 169, 177,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN NM7 NM8 NM9 NMPL */
|
||||
2, 18, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 122, 130, 138, 146, 154, 162, 170, 178,
|
||||
/* CPLK A S D F G H J K L ; ' # ENTR NM4 NM5 NM6 */
|
||||
3, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 123, 155, 163, 171,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
4, 20, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 124, 140, 156, 164, 172, 180,
|
||||
/* LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR NM0 NMPD */
|
||||
5, 13, 21, 53, 85, 93, 101, 125, 133, 141, 149, 165, 173,
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> mk730_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
7, 28, 35, 42, 49, 63, 70, 77, 84, 91, 98, 105, 112, 119, 126, 133,
|
||||
/* L1 BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP R1 */
|
||||
8, 22, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 99, 113, 120, 127, 134,
|
||||
/* L2 TAB Q W E R T Y U I O P [ ] \ DEL END PGDN R2 */
|
||||
9, 23, 30, 37, 44, 51, 58, 65, 72, 79, 86, 93, 100, 114, 121, 128, 135,
|
||||
/* L3 CPLK A S D F G H J K L ; ' # ENTR R3 */
|
||||
10, 24, 31, 38, 45, 52, 59, 66, 73, 80, 87, 94, 108, 115,
|
||||
/* L4 LSFT ISO\ Z X C V B N M , . / RSFT ARWU R4 */
|
||||
11, 18, 25, 32, 39, 46, 53, 60, 67, 74, 81, 88, 116, 130,
|
||||
/* LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR */
|
||||
12, 19, 26, 54, 82, 89, 96, 117, 124, 131, 138,
|
||||
/* B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B12 */
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> mk750_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK MUT PLA REW FFWD */
|
||||
7, 28, 35, 42, 49, 63, 70, 77, 84, 91, 98, 105, 112, 119, 136, 133,
|
||||
/* L1 BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP NMLK NMDV NMTM NMMI R1 */
|
||||
8, 22, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 99, 113, 120, 127, 134, 0, 148, 155, 162,
|
||||
/* L2 TAB Q W E R T Y U I O P [ ] \ DEL END PGDN NM7 NM8 NM9 NMPL R2 */
|
||||
9, 23, 30, 37, 44, 51, 58, 65, 72, 79, 86, 93, 100, 114, 121, 128, 135, 142, 149, 156, 163,
|
||||
/* L3 CPLK A S D F G H J K L ; ' # ENTR NM4 NM5 NM6 R3 */
|
||||
10, 24, 31, 38, 45, 52, 59, 66, 73, 80, 87, 94, 108, 115, 143, 150, 157,
|
||||
/* L4 LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER R4 */
|
||||
11, 18, 25, 32, 39, 46, 53, 60, 67, 74, 81, 88, 116, 130, 144, 151, 158, 165,
|
||||
/* LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR NM0 NMPD */
|
||||
12, 19, 26, 54, 82, 89, 96, 117, 124, 131, 138, 152, 159,
|
||||
/* B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B12 B13 B14 B15 B16 B17 B18 */
|
||||
};
|
||||
|
||||
|
||||
const std::vector<unsigned int> ck530_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
6, 21, 27, 34, 41, 55, 62, 69, 76, 83, 90, 97, 104, 111, 118, 125,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP */
|
||||
7, 15, 22, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 105, 112, 119, 126,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN */
|
||||
8, 16, 23, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 106, 113, 120, 127,
|
||||
/* CPLK A S D F G H J K L ; " # ENTR */
|
||||
9, 17, 24, 30, 37, 44, 51, 58, 65, 72, 79, 86, 93, 107,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU */
|
||||
10, 18, 25, 31, 38, 45, 52, 59, 66, 73, 80, 87, 108, 122,
|
||||
/* LCTL LWIN LALT SPC RALT RFNC RMNU RCTL ARWL ARWD ARWR */
|
||||
11, 12, 19, 46, 74, 81, 88, 109, 116, 123, 130,
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> ck550_v2_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
0, 18, 24, 30, 36, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102, 108,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP NMLK NMDV NMTM NMMI */
|
||||
1, 13, 19, 25, 31, 37, 43, 49, 55, 61, 67, 73, 79, 91, 97, 103, 109, 115, 121, 127, 133,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN NM7 NM8 NM9 NMPL */
|
||||
2, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74, 80, 92, 98, 104, 110, 116, 122, 128, 134,
|
||||
/* CPLK A S D F G H J K L ; ' # ENTR NM4 NM5 NM6 */
|
||||
3, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 75, 87, 93, 117, 123, 129,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
4, 10, 16, 22, 28, 34, 40, 46, 52, 58, 64, 70,/*76,*/ 94, 106, 118, 124, 130, 136,
|
||||
/* LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR NM0 NMPD */
|
||||
5, 11, 17, 41, 65, 71, 77, 95, 101, 107, 113, 125, 131,
|
||||
};
|
||||
|
||||
const std::vector<unsigned int> ck552_keymap =
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
0, 18, 24, 30, 36, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102, 108,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BPSC INS HOME PGUP NMLK NMDV NMTM NMMI */
|
||||
1, 13, 19, 25, 31, 37, 43, 49, 55, 61, 67, 73, 79, 91, 97, 103, 109, 115, 121, 127, 133,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ DEL END PGDN NM7 NM8 NM9 NMPL */
|
||||
2, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74, 80, 92, 98, 104, 110, 116, 122, 128, 134,
|
||||
/* CPLK A S D F G H J K L ; ' # ENTR NM4 NM5 NM6 */
|
||||
3, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 75, 81, 93, 117, 123, 129,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
4, 10, 16, 22, 28, 34, 40, 46, 52, 58, 64, 70,/*76,*/ 94, 106, 118, 124, 130, 136,
|
||||
/* LCTL LWIN LALT SPACE RALT RWFNC RMNU RCTRL ARWL ARDN ARWR NM0 NMPD */
|
||||
5, 11, 17, 41, 65, 71, 77, 95, 101, 107, 113, 125, 131,
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| KEYMAPS |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
keyboard_keymap_overlay_values mk_pro_s_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_TKL,
|
||||
{
|
||||
mk_pro_s_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
},
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values mk_pro_l_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
mk_pro_l_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 17, 101, "Key: P1", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 18, 109, "Key: P2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 19, 117, "Key: P3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 20, 119, "Key: P4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
},
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*\
|
||||
| CoolerMaster MK85O Keyboard |
|
||||
| Unknown Keys: ISO\, ISO# set to 0 |
|
||||
\*-------------------------------------------------------------*/
|
||||
keyboard_keymap_overlay_values mk850_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
mk850_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 17, 146, "Key: Aim <|>", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // aimpad <|>
|
||||
{ 0, 0, 18, 153, "Key: Aim -", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // aimpad +
|
||||
{ 0, 0, 19, 160, "Key: Aim +", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // aimpad -
|
||||
{ 0, 1, 0, 0, "Key: M5", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 2, 0, 1, "Key: M4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 3, 0, 2, "Key: M3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 4, 0, 3, "Key: M2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 5, 0, 4, "Key: M1", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
},
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values sk622_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_SIXTY,
|
||||
{
|
||||
sk622_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 0, 7, "Light: Top 1", KEYBOARD_OPCODE_INSERT_ROW, },
|
||||
{ 0, 0, 1, 14, "Light: Top 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 2, 21, "Light: Top 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 3, 28, "Light: Top 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 4, 35, "Light: Top 5", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 5, 42, "Light: Top 6", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 6, 49, "Light: Top 7", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 7, 56, "Light: Top 8", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 8, 63, "Light: Top 9", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 9, 70, "Light: Top 10", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 10, 77, "Light: Top 11", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 11, 84, "Light: Top 12", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 12, 91, "Light: Top 13", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 13, 98, "Light: Top 14", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 14, 105, "Light: Top 14", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 1, 0, 0, "Light: Left 1", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 2, 0, 1, "Light: Left 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 3, 0, 2, "Light: Left 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 4, 0, 3, "Light: Left 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 5, 0, 4, "Light: Left 5", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 1, 16, 112, "Light: Right 1", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 2, 16, 113, "Light: Right 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 3, 16, 114, "Light: Right 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 4, 16, 115, "Light: Right 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 5, 16, 116, "Light: Right 5", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 0, 6, "Light: Bottom 1", KEYBOARD_OPCODE_INSERT_ROW, },
|
||||
{ 0, 6, 1, 20, "Light: Bottom 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 2, 27, "Light: Bottom 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 3, 34, "Light: Bottom 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 4, 41, "Light: Bottom 5", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 5, 48, "Light: Bottom 6", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 6, 55, "Light: Bottom 7", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 7, 62, "Light: Bottom 8", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 8, 69, "Light: Bottom 9", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 9, 76, "Light: Bottom 10", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 10, 83, "Light: Bottom 11", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 11, 90, "Light: Bottom 12", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 12, 97, "Light: Bottom 13", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 13, 104, "Light: Bottom 14", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 14, 111, "Light: Bottom 15", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 14, 118, "Light: Bottom 16", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
},
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values sk630_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_TKL,
|
||||
{
|
||||
sk630_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
}
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values sk650_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
sk650_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
}
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values sk652_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
sk652_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
}
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values sk653_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
sk653_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*\
|
||||
| CoolerMaster MK730 Keyboard |
|
||||
\*-------------------------------------------------------------*/
|
||||
keyboard_keymap_overlay_values mk730_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_TKL,
|
||||
{
|
||||
mk730_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 1, 0, 1, "Light: Left 1", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 2, 0, 2, "Light: Left 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 3, 0, 3, "Light: Left 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 4, 0, 4, "Light: Left 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 1, 18, 141, "Light: Right 1", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 2, 18, 142, "Light: Right 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 3, 18, 143, "Light: Right 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 4, 18, 144, "Light: Right 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 1, 13, "Light: Bottom 1", KEYBOARD_OPCODE_INSERT_ROW, },
|
||||
{ 0, 6, 2, 20, "Light: Bottom 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 3, 27, "Light: Bottom 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 4, 34, "Light: Bottom 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 5, 41, "Light: Bottom 5", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 6, 55, "Light: Bottom 6", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 7, 62, "Light: Bottom 7", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 8, 69, "Light: Logo", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 10, 76, "Light: Bottom 8", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 11, 90, "Light: Bottom 9", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 12, 104, "Light: Bottom 10", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 13, 111, "Light: Bottom 11", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 14, 118, "Light: Bottom 12", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 15, 125, "Light: Bottom 13", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*\
|
||||
| CoolerMaster MK750 Keyboard |
|
||||
| based on keymap defined in Signal. |
|
||||
| The keymap needs the following adjustments |
|
||||
| NMLK - Unknown set to 0 |
|
||||
| SCLK - Unknown set to 0 |
|
||||
| CAPS - Unknown set to 0 |
|
||||
| Guesses on ISO\ and # |
|
||||
\*-------------------------------------------------------------*/
|
||||
keyboard_keymap_overlay_values mk750_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
mk750_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 17, 140, KEY_EN_MEDIA_MUTE, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 18, 147, KEY_EN_MEDIA_PLAY_PAUSE, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 19, 154, KEY_EN_MEDIA_PREVIOUS, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 20, 161, KEY_EN_MEDIA_NEXT, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 1, 0, 1, "Light: Left 1", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 2, 0, 2, "Light: Left 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 3, 0, 3, "Light: Left 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 4, 0, 4, "Light: Left 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 1, 22, 170, "Light: Right 1", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 2, 22, 171, "Light: Right 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 3, 22, 172, "Light: Right 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 4, 22, 173, "Light: Right 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 1, 20, "Light: Bottom 1", KEYBOARD_OPCODE_INSERT_ROW, },
|
||||
{ 0, 6, 2, 27, "Light: Bottom 2", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 3, 34, "Light: Bottom 3", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 4, 41, "Light: Bottom 4", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 5, 55, "Light: Bottom 5", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 6, 62, "Light: Bottom 6", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 7, 69, "Light: Bottom 7", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 8, 76, "Light: Bottom 8", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 9, 83, "Light: Bottom 9", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 10, 90, "Light: Bottom 10", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 11, 104, "Light: Bottom 11", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 12, 111, "Light: Bottom 12", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 13, 118, "Light: Bottom 13", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 14, 125, "Light: Bottom 14", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 15, 132, "Light: Bottom 15", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 16, 146, "Light: Bottom 16", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 17, 153, "Light: Bottom 17", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 6, 18, 160, "Light: Bottom 18", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
}
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values ck530_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_TKL,
|
||||
{
|
||||
ck530_keymap,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
}
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values ck550v2_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
ck550_v2_keymap,
|
||||
{
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 17, 120, "Indicator: N", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 18, 126, "Indicator: C", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
{ 0, 0, 19, 132, "Indicator: S", KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, },
|
||||
},
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values ck552_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
ck552_keymap,
|
||||
{
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, OpCode, |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
},
|
||||
};
|
||||
|
||||
static const cm_kb_zone cm_generic_zone =
|
||||
{
|
||||
ZONE_EN_KEYBOARD,
|
||||
ZONE_TYPE_MATRIX,
|
||||
};
|
||||
|
||||
cm_kb_device mk_pro_s_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_PRO_S_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&mk_pro_s_layout,
|
||||
};
|
||||
|
||||
cm_kb_device mk_pro_l_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_PRO_L_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&mk_pro_l_layout,
|
||||
};
|
||||
|
||||
cm_kb_device mk850_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_MK850_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&mk850_layout,
|
||||
};
|
||||
|
||||
cm_kb_device sk622w_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_SK622W_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&sk622_layout,
|
||||
};
|
||||
|
||||
cm_kb_device sk622b_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_SK622B_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&sk622_layout,
|
||||
};
|
||||
|
||||
cm_kb_device sk630_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_SK630_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&sk630_layout,
|
||||
};
|
||||
|
||||
cm_kb_device sk650_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_SK650_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&sk650_layout,
|
||||
};
|
||||
|
||||
cm_kb_device sk652_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_SK652_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&sk652_layout,
|
||||
};
|
||||
|
||||
cm_kb_device sk653_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_SK653_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&sk652_layout,
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| TODO: Keymap is incomplete. Extra keys mode enabled to |
|
||||
| aid in key discovery. |
|
||||
\*---------------------------------------------------------*/
|
||||
cm_kb_device mk730_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_MK730_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&mk730_layout,
|
||||
};
|
||||
|
||||
cm_kb_device mk750_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_MK750_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&mk750_layout,
|
||||
};
|
||||
|
||||
cm_kb_device ck530_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_CK530_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&ck530_layout,
|
||||
};
|
||||
|
||||
cm_kb_device ck530_v2_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_CK530_V2_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&ck530_layout,
|
||||
};
|
||||
|
||||
cm_kb_device ck550_v2_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_CK550_V2_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&ck550v2_layout,
|
||||
};
|
||||
|
||||
cm_kb_device ck552_v2_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_CK552_V2_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&ck552_layout,
|
||||
};
|
||||
|
||||
cm_kb_device mk_pro_l_white_device
|
||||
{
|
||||
COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID,
|
||||
{
|
||||
&cm_generic_zone,
|
||||
},
|
||||
&mk_pro_s_layout,
|
||||
};
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| KEYBOARDS |
|
||||
\*-----------------------------------------------------------------*/
|
||||
const cm_kb_device* cm_kb_devices[] =
|
||||
{
|
||||
&mk_pro_s_device,
|
||||
&mk_pro_l_device,
|
||||
&mk850_device,
|
||||
&sk622w_device,
|
||||
&sk622b_device,
|
||||
&sk630_device,
|
||||
&sk650_device,
|
||||
&sk652_device,
|
||||
&sk653_device,
|
||||
&mk730_device,
|
||||
&mk750_device,
|
||||
&ck530_device,
|
||||
&ck530_v2_device,
|
||||
&ck550_v2_device,
|
||||
&ck552_v2_device,
|
||||
&mk_pro_l_white_device,
|
||||
};
|
||||
|
||||
const unsigned int COOLERMASTER_KEYBOARD_DEVICE_COUNT = (sizeof(cm_kb_devices) / sizeof(cm_kb_devices[ 0 ]));
|
||||
const cm_kb_device** cm_kb_device_list = cm_kb_devices;
|
||||
120
Controllers/CoolerMasterController/CMKeyboardDevices.h
Normal file
120
Controllers/CoolerMasterController/CMKeyboardDevices.h
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMKeyboardDevices.h |
|
||||
| |
|
||||
| Keymap definitions for Cooler Master Keyboards |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "KeyboardLayoutManager.h"
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| List of all supported effects by this controller. |
|
||||
| All of these effects are firmware controlled, and |
|
||||
| they types of effects supported will depend on the |
|
||||
| Keyboard. |
|
||||
| |
|
||||
| To enable a command, the SetEffect(effectId) needs |
|
||||
| to be called. The specific effectId->Effect mapping |
|
||||
| depends on the keyboard. |
|
||||
\*-----------------------------------------------------*/
|
||||
enum cm_keyboard_effect_type
|
||||
{
|
||||
NONE = 0,
|
||||
DIRECT,
|
||||
SINGLE,
|
||||
FULLY_LIT,
|
||||
STATIC,
|
||||
BREATHE,
|
||||
CYCLE,
|
||||
WAVE,
|
||||
RIPPLE,
|
||||
CROSS,
|
||||
RAINDROPS,
|
||||
STARS,
|
||||
SNAKE,
|
||||
CUSTOMIZED,
|
||||
INDICATOR,
|
||||
MULTILAYER,
|
||||
REACTIVE_FADE,
|
||||
REACTIVE_PUNCH,
|
||||
REACTIVE_TORNADO,
|
||||
HEARTBEAT,
|
||||
FIREBALL,
|
||||
SNOW,
|
||||
CIRCLE_SPECTRUM,
|
||||
WATER_RIPPLE,
|
||||
OFF
|
||||
};
|
||||
|
||||
#define CM_KB_ZONES_MAX 1
|
||||
|
||||
typedef struct
|
||||
{
|
||||
std::string name;
|
||||
zone_type type;
|
||||
} cm_kb_zone;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t product_id;
|
||||
const cm_kb_zone * zones[CM_KB_ZONES_MAX];
|
||||
keyboard_keymap_overlay_values* layout_new;
|
||||
} cm_kb_device;
|
||||
|
||||
#define COOLERMASTER_VID 0x2516
|
||||
|
||||
#define CMKB_MAXKEYS 256
|
||||
|
||||
/*-----------------------------------------------------------------*\
|
||||
| keyboard support status is indicated to the right of |
|
||||
| the PID definition. Attribution to products is also |
|
||||
| indicated. |
|
||||
| |
|
||||
| libcmmk |
|
||||
| signal https://gitlab.com/signalrgb/signal-plugins |
|
||||
| openrgb |
|
||||
| ck550-macos https://github.com/vookimedlo/ck550-macos/tree/master |
|
||||
| reversed |
|
||||
| |
|
||||
| issue tickets, open merge requests etc are provided |
|
||||
| for developer references. |
|
||||
| # denotes issue ticket |
|
||||
| ! denotes merge/pull request |
|
||||
\*-----------------------------------------------------------------*/
|
||||
#define COOLERMASTER_KEYBOARD_CK351_PID 0x014F // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_CK530_PID 0x009F // [ck550-macos]
|
||||
#define COOLERMASTER_KEYBOARD_CK530_V2_PID 0x0147 // [signal]
|
||||
#define COOLERMASTER_KEYBOARD_CK550_V2_PID 0x0145 // [openrgb #800, #2863, signal]
|
||||
#define COOLERMASTER_KEYBOARD_CK552_V2_PID 0x007F // [ck550-macos, signal]
|
||||
#define COOLERMASTER_KEYBOARD_CK570_V2_PID 0x01E8 // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_CK720_PID 0x016B // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_CK721_PID 0x016D // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_CK721LINE_PID 0x01EE // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_PRO_L_PID 0x003B // [libcmmk !16]
|
||||
#define COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID 0x0047 // [libcmmk]
|
||||
#define COOLERMASTER_KEYBOARD_PRO_S_PID 0x003C // [libcmmk #30 !31 !36, !37, !7, #5(closed), #3(closed)]
|
||||
// MASTERKEYS PRO M [libcmmk #17]
|
||||
#define COOLERMASTER_KEYBOARD_MK721_PID 0x016F // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_MK730_PID 0x008F // [openrgb #1630, libcmmk]
|
||||
#define COOLERMASTER_KEYBOARD_MK750_PID 0x0067 // fw1.2 [libcmmk #25 !9, !14, signal]
|
||||
#define COOLERMASTER_KEYBOARD_MK770_PID 0x01D5 // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_MK850_PID 0x0069 // [signal]
|
||||
#define COOLERMASTER_KEYBOARD_SK620B_PID 0x0157 // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_SK620W_PID 0x0159 // [signal]
|
||||
#define COOLERMASTER_KEYBOARD_SK622B_PID 0x0149 // [openrgb #3110, signal #217(closed)]
|
||||
#define COOLERMASTER_KEYBOARD_SK622W_PID 0x014B // [signal]
|
||||
#define COOLERMASTER_KEYBOARD_SK630_PID 0x0089 // [openrgb #967, libcmmk !21]
|
||||
#define COOLERMASTER_KEYBOARD_SK631B_PID 0x008B // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_SK631W_PID 0x0125 // [libcmmk]
|
||||
#define COOLERMASTER_KEYBOARD_SK650_PID 0x008D // [openrgb #613, libcmmk #23 !37 !27 !28, signal]
|
||||
#define COOLERMASTER_KEYBOARD_SK651B_PID 0x0091 // unsupported
|
||||
#define COOLERMASTER_KEYBOARD_SK651W_PID 0x0127 // [signal]
|
||||
#define COOLERMASTER_KEYBOARD_SK652_PID 0x015D // [signal]
|
||||
#define COOLERMASTER_KEYBOARD_SK653_PID 0x01AB // [openrgb #3571, signal]
|
||||
|
||||
extern const unsigned int COOLERMASTER_KEYBOARD_DEVICE_COUNT;
|
||||
extern const cm_kb_device** cm_kb_device_list;
|
||||
497
Controllers/CoolerMasterController/CMKeyboardV1Controller.cpp
Normal file
497
Controllers/CoolerMasterController/CMKeyboardV1Controller.cpp
Normal file
|
|
@ -0,0 +1,497 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMKeyboardV1Controller.cpp |
|
||||
| |
|
||||
| Driver for Coolermaster MasterKeys keyboards (V1) |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
#include "CMKeyboardV1Controller.h"
|
||||
#include "LogManager.h"
|
||||
#include <cmath>
|
||||
|
||||
CMKeyboardV1Controller::CMKeyboardV1Controller(hid_device* dev_handle, hid_device_info* dev_info) : CMKeyboardAbstractController(dev_handle, dev_info)
|
||||
{
|
||||
m_sFirmwareVersion = _GetFirmwareVersion();
|
||||
}
|
||||
|
||||
CMKeyboardV1Controller::~CMKeyboardV1Controller()
|
||||
{
|
||||
}
|
||||
|
||||
void CMKeyboardV1Controller::Initialize()
|
||||
{
|
||||
SetLEDControl(true);
|
||||
}
|
||||
|
||||
void CMKeyboardV1Controller::SetActiveEffect(uint8_t effectId)
|
||||
{
|
||||
SendCommand({0x51, 0x28, 0x00, 0x00, effectId});
|
||||
}
|
||||
|
||||
uint8_t CMKeyboardV1Controller::GetActiveEffect()
|
||||
{
|
||||
std::vector<uint8_t> data = SendCommand({0x52, 0x28});
|
||||
|
||||
return data[4];
|
||||
}
|
||||
|
||||
void CMKeyboardV1Controller::SetEffect(uint8_t effectId, uint8_t p1, uint8_t p2, uint8_t p3, RGBColor color1, RGBColor color2)
|
||||
{
|
||||
std::vector<uint8_t> data;
|
||||
|
||||
data.push_back(0x51);
|
||||
data.push_back(0x2C);
|
||||
data.push_back(0x00); // multilayer_mode - NOT SUPPORTED
|
||||
data.push_back(0x00);
|
||||
data.push_back(effectId);
|
||||
data.push_back(p1);
|
||||
data.push_back(p2);
|
||||
data.push_back(p3);
|
||||
data.push_back(0xFF);
|
||||
data.push_back(0xFF);
|
||||
data.push_back(RGBGetRValue(color1));
|
||||
data.push_back(RGBGetGValue(color1));
|
||||
data.push_back(RGBGetBValue(color1));
|
||||
data.push_back(RGBGetRValue(color2));
|
||||
data.push_back(RGBGetGValue(color2));
|
||||
data.push_back(RGBGetBValue(color2));
|
||||
|
||||
/*-------------------------------------------*\
|
||||
| Likely a bit mask for each LEDs. |
|
||||
| 3 bits per LED x 127 possible LEDs ~48 bytes|
|
||||
\*-------------------------------------------*/
|
||||
for(size_t i = 0; i < 48; i++)
|
||||
{
|
||||
data.push_back(0xFF);
|
||||
}
|
||||
|
||||
SetCustomMode();
|
||||
SetActiveEffect(effectId);
|
||||
SendCommand(data);
|
||||
}
|
||||
|
||||
void CMKeyboardV1Controller::SetCustomMode()
|
||||
{
|
||||
SetControlMode(0x01);
|
||||
}
|
||||
|
||||
void CMKeyboardV1Controller::SetMode(mode selectedMode)
|
||||
{
|
||||
RGBColor color1 = 0;
|
||||
RGBColor color2 = 0;
|
||||
uint8_t cSpeed = 0;
|
||||
uint8_t cDirection = 0;
|
||||
uint8_t effectId = selectedMode.value;
|
||||
bool bModeRandom = false;
|
||||
|
||||
if(selectedMode.colors.size() >= 1)
|
||||
{
|
||||
color1 = selectedMode.colors[0];
|
||||
}
|
||||
|
||||
if(selectedMode.colors.size() >= 2)
|
||||
{
|
||||
color2 = selectedMode.colors[1];
|
||||
}
|
||||
|
||||
if(selectedMode.color_mode == MODE_COLORS_RANDOM)
|
||||
{
|
||||
bModeRandom = true;
|
||||
}
|
||||
|
||||
int selectedEffect = mapModeValueEffect[effectId];
|
||||
cSpeed = selectedMode.speed;
|
||||
|
||||
switch(selectedMode.direction)
|
||||
{
|
||||
case MODE_DIRECTION_LEFT:
|
||||
case MODE_DIRECTION_HORIZONTAL:
|
||||
cDirection = 0x00;
|
||||
break;
|
||||
|
||||
case MODE_DIRECTION_RIGHT:
|
||||
cDirection = 0x04;
|
||||
break;
|
||||
|
||||
case MODE_DIRECTION_UP:
|
||||
case MODE_DIRECTION_VERTICAL:
|
||||
cDirection = 0x06;
|
||||
break;
|
||||
|
||||
case MODE_DIRECTION_DOWN:
|
||||
cDirection = 0x02;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(selectedEffect)
|
||||
{
|
||||
case DIRECT:
|
||||
case STATIC:
|
||||
{
|
||||
SetEffect(effectId, 0, 0, 0, color1, color2);
|
||||
}
|
||||
break;
|
||||
|
||||
case CROSS:
|
||||
case BREATHE:
|
||||
case REACTIVE_PUNCH:
|
||||
case CIRCLE_SPECTRUM:
|
||||
case SNAKE:
|
||||
{
|
||||
SetEffect(effectId, cSpeed, 0, 0xFF, color1, color2);
|
||||
}
|
||||
break;
|
||||
|
||||
case WAVE:
|
||||
{
|
||||
SetEffect(effectId, cSpeed, cDirection, 0xFF, color1, color2);
|
||||
}
|
||||
break;
|
||||
|
||||
case RIPPLE:
|
||||
{
|
||||
SetEffect(effectId, cSpeed, bModeRandom ? 0x80 : 0x00, 0xFF, color1, color2);
|
||||
}
|
||||
break;
|
||||
|
||||
case RAINDROPS:
|
||||
{
|
||||
SetEffect(effectId, 0x6a, 0x00, cSpeed, color1, color2);
|
||||
}
|
||||
break;
|
||||
|
||||
case STARS:
|
||||
{
|
||||
SetEffect(effectId, cSpeed, 0x00, 0x10, color1, color2);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CMKeyboardV1Controller::InitializeModes(std::vector<mode> &modes)
|
||||
{
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0x02;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
|
||||
modes.push_back(Direct);
|
||||
|
||||
mapModeValueEffect[0x02] = DIRECT;
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = 0x00;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.colors.resize(1);
|
||||
modes.push_back(Static);
|
||||
mapModeValueEffect[0x00] = STATIC;
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = 0x01;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.speed_min = 0x46;
|
||||
Breathing.speed_max = 0x27;
|
||||
Breathing.speed = 0x36;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.colors.resize(1);
|
||||
modes.push_back(Breathing);
|
||||
mapModeValueEffect[0x01] = BREATHE;
|
||||
|
||||
mode Cycle;
|
||||
Cycle.name = "Spectrum Cycle";
|
||||
Cycle.value = 0x02;
|
||||
Cycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
Cycle.color_mode = MODE_COLORS_NONE;
|
||||
Cycle.speed_min = 0x96;
|
||||
Cycle.speed_max = 0x68;
|
||||
Cycle.speed = 0x7F;
|
||||
modes.push_back(Cycle);
|
||||
mapModeValueEffect[0x02] = CIRCLE_SPECTRUM;
|
||||
|
||||
mode Reactive;
|
||||
Reactive.name = "Reactive";
|
||||
Reactive.value = 0x03;
|
||||
Reactive.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Reactive.speed_min = 0x3C;
|
||||
Reactive.speed_max = 0x2F;
|
||||
Reactive.speed = 0x35;
|
||||
Reactive.colors_min = 2;
|
||||
Reactive.colors_max = 2;
|
||||
Reactive.colors.resize(2);
|
||||
modes.push_back(Reactive);
|
||||
mapModeValueEffect[0x03] = REACTIVE_PUNCH;
|
||||
|
||||
mode Wave;
|
||||
Wave.name = "Rainbow Wave";
|
||||
Wave.value = 0x04;
|
||||
Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD;
|
||||
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Wave.speed_min = 0x48;
|
||||
Wave.speed_max = 0x2A;
|
||||
Wave.speed = 0x29;
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.colors_min = 1;
|
||||
Wave.colors_max = 1;
|
||||
Wave.colors.resize(1);
|
||||
modes.push_back(Wave);
|
||||
mapModeValueEffect[0x04] = WAVE;
|
||||
|
||||
mode Ripple;
|
||||
Ripple.name = "Ripple Effect";
|
||||
Ripple.value = 0x05;
|
||||
Ripple.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Ripple.speed_min = 0x96;
|
||||
Ripple.speed_max = 0x62;
|
||||
Ripple.speed = 0x7C;
|
||||
Ripple.colors_min = 2;
|
||||
Ripple.colors_max = 2;
|
||||
Ripple.colors.resize(2);
|
||||
modes.push_back(Ripple);
|
||||
mapModeValueEffect[0x05] = RIPPLE;
|
||||
|
||||
mode Cross;
|
||||
Cross.name = "Cross";
|
||||
Cross.value = 0x06;
|
||||
Cross.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Cross.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Cross.speed_min = 0x2A;
|
||||
Cross.speed_max = 0x48;
|
||||
Cross.speed = 0x39;
|
||||
Cross.colors_min = 2;
|
||||
Cross.colors_max = 2;
|
||||
Cross.colors.resize(2);
|
||||
modes.push_back(Cross);
|
||||
mapModeValueEffect[0x06] = CROSS;
|
||||
|
||||
mode Raindrops;
|
||||
Raindrops.name = "Raindrops";
|
||||
Raindrops.value = 0x07;
|
||||
Raindrops.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Raindrops.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Raindrops.speed_min = 0x40;
|
||||
Raindrops.speed_max = 0x08;
|
||||
Raindrops.speed = 0x24;
|
||||
Raindrops.colors_min = 2;
|
||||
Raindrops.colors_max = 2;
|
||||
Raindrops.colors.resize(2);
|
||||
modes.push_back(Raindrops);
|
||||
mapModeValueEffect[0x07] = RAINDROPS;
|
||||
|
||||
mode Stars;
|
||||
Stars.name = "Starfield";
|
||||
Stars.value = 0x08;
|
||||
Stars.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Stars.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Stars.speed_min = 0x46;
|
||||
Stars.speed_max = 0x32;
|
||||
Stars.speed = 0x3C;
|
||||
Stars.colors_min = 2;
|
||||
Stars.colors_max = 2;
|
||||
Stars.colors.resize(2);
|
||||
modes.push_back(Stars);
|
||||
mapModeValueEffect[0x08] = STARS;
|
||||
|
||||
mode Snake;
|
||||
Snake.name = "Snake";
|
||||
Snake.value = 0x09;
|
||||
Snake.flags = MODE_FLAG_HAS_SPEED;
|
||||
Snake.color_mode = MODE_COLORS_NONE;
|
||||
Snake.speed_min = 0x48;
|
||||
Snake.speed_max = 0x2A;
|
||||
Snake.speed = 0x39;
|
||||
modes.push_back(Snake);
|
||||
mapModeValueEffect[0x09] = SNAKE;
|
||||
}
|
||||
|
||||
struct cm_keyboard_effect CMKeyboardV1Controller::GetEffect(uint8_t effectId)
|
||||
{
|
||||
std::vector<uint8_t> data;
|
||||
data.push_back(0x52);
|
||||
data.push_back(0x2C);
|
||||
data.push_back(0x00);
|
||||
data.push_back(0x00);
|
||||
data.push_back(effectId);
|
||||
|
||||
data = SendCommand(data);
|
||||
struct cm_keyboard_effect response;
|
||||
|
||||
response.effectId = effectId;
|
||||
response.p1 = data[5];
|
||||
response.p2 = data[6];
|
||||
response.p3 = data[7];
|
||||
response.color1 = ToRGBColor(data[10], data[11], data[12]);
|
||||
response.color2 = ToRGBColor(data[13], data[14], data[15]);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> CMKeyboardV1Controller::GetEnabledEffects()
|
||||
{
|
||||
std::vector<uint8_t> data;
|
||||
|
||||
data = SendCommand({0x52, 0x29});
|
||||
|
||||
std::vector<uint8_t> effects;
|
||||
|
||||
for(size_t i = 4; data[i] != 0xFF; i++)
|
||||
{
|
||||
effects.push_back(data[i]);
|
||||
}
|
||||
|
||||
return effects;
|
||||
}
|
||||
|
||||
|
||||
void CMKeyboardV1Controller::SetLEDControl(bool bManual)
|
||||
{
|
||||
uint8_t modeId = 0; // firmware
|
||||
|
||||
if(bManual)
|
||||
{
|
||||
modeId = 0x02; // manual
|
||||
}
|
||||
|
||||
SetControlMode(modeId);
|
||||
};
|
||||
|
||||
void CMKeyboardV1Controller::SetLeds(std::vector<led> leds, std::vector<RGBColor> colors)
|
||||
{
|
||||
SetLEDControl(true);
|
||||
|
||||
RGBColor rgbColorMap[CM_MAX_LEDS];
|
||||
memset(rgbColorMap, 0, sizeof(RGBColor)*CM_MAX_LEDS);
|
||||
|
||||
for(size_t i = 0; i < leds.size(); i++)
|
||||
{
|
||||
rgbColorMap[leds[i].value] = colors[i];
|
||||
}
|
||||
|
||||
RGBColor * pRGBColor = rgbColorMap;
|
||||
|
||||
std::lock_guard<std::mutex> guard(m_mutex);
|
||||
|
||||
for(size_t i = 0; i < 8; i++)
|
||||
{
|
||||
std::vector<uint8_t> data;
|
||||
data.push_back(0xC0);
|
||||
data.push_back(0x02);
|
||||
data.push_back(i*2);
|
||||
data.push_back(0x00);
|
||||
|
||||
for(size_t j = 0; j < 16; j++)
|
||||
{
|
||||
data.push_back(RGBGetRValue(*pRGBColor));
|
||||
data.push_back(RGBGetGValue(*pRGBColor));
|
||||
data.push_back(RGBGetBValue(*pRGBColor));
|
||||
|
||||
++pRGBColor;
|
||||
}
|
||||
|
||||
SendCommand(data);
|
||||
}
|
||||
}
|
||||
|
||||
void CMKeyboardV1Controller::SetSingleLED(uint8_t in_led, RGBColor in_color)
|
||||
{
|
||||
std::vector<uint8_t> data;
|
||||
data.push_back(0xC0);
|
||||
data.push_back(0x01);
|
||||
data.push_back(0x01);
|
||||
data.push_back(0x00);
|
||||
data.push_back(in_led);
|
||||
data.push_back(RGBGetRValue(in_color));
|
||||
data.push_back(RGBGetGValue(in_color));
|
||||
data.push_back(RGBGetBValue(in_color));
|
||||
|
||||
SendCommand(data);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------*\
|
||||
| Detect the Firmware Version |
|
||||
| |
|
||||
| Firmware version string is in the format: |
|
||||
| <layout>.<minor>.<major> |
|
||||
| Where <layout> is: |
|
||||
| UNK = 0, ANSI/US = 1, ISO/EU = 2, JP = 3 |
|
||||
| Examples: |
|
||||
| 1.2.1 = ANSI/US Keyboard (PRO S) |
|
||||
| 2.2.1 = ISO/EU Keyboard (PRO L) |
|
||||
\*-------------------------------------------------------------------*/
|
||||
std::string CMKeyboardV1Controller::_GetFirmwareVersion()
|
||||
{
|
||||
std::vector<uint8_t> read;
|
||||
|
||||
SetControlMode(MODE_FIRMWARE);
|
||||
read = SendCommand({0x01, 0x02});
|
||||
|
||||
char cVersionStr[CM_KEYBOARD_WRITE_SIZE];
|
||||
|
||||
for(size_t i = 0; i < read.size(); i++)
|
||||
{
|
||||
cVersionStr[i] = read[i];
|
||||
}
|
||||
|
||||
cVersionStr[CM_KEYBOARD_WRITE_SIZE - 1] = 0;
|
||||
|
||||
std::string sFirmwareVersion;
|
||||
|
||||
sFirmwareVersion = std::string(cVersionStr+4);
|
||||
|
||||
LOG_VERBOSE("[%s] GetFirmwareVersion(): [%s]", m_deviceName.c_str(), sFirmwareVersion.c_str());
|
||||
|
||||
return sFirmwareVersion;
|
||||
}
|
||||
|
||||
void CMKeyboardV1Controller::Shutdown()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
KEYBOARD_LAYOUT CMKeyboardV1Controller::GetKeyboardLayout()
|
||||
{
|
||||
KEYBOARD_LAYOUT layout = KEYBOARD_LAYOUT_DEFAULT;
|
||||
|
||||
if(m_sFirmwareVersion.empty())
|
||||
{
|
||||
LOG_WARNING("[%s] GetKeyboardLayout() empty firmware string detected. Unable to detect firmware layout. Assuming defaults.", m_deviceName.c_str());
|
||||
|
||||
layout = KEYBOARD_LAYOUT_ANSI_QWERTY;
|
||||
return layout;
|
||||
}
|
||||
|
||||
switch(m_sFirmwareVersion.c_str()[0])
|
||||
{
|
||||
case '0':
|
||||
default:
|
||||
case '1':
|
||||
layout = KEYBOARD_LAYOUT_ANSI_QWERTY;
|
||||
break;
|
||||
|
||||
case '2':
|
||||
layout = KEYBOARD_LAYOUT_ISO_QWERTY;
|
||||
break;
|
||||
|
||||
case '3':
|
||||
layout = KEYBOARD_LAYOUT_JIS;
|
||||
break;
|
||||
}
|
||||
|
||||
return layout;
|
||||
}
|
||||
39
Controllers/CoolerMasterController/CMKeyboardV1Controller.h
Normal file
39
Controllers/CoolerMasterController/CMKeyboardV1Controller.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMKeyboardV1Controller.h |
|
||||
| |
|
||||
| Driver for Coolermaster MasterKeys keyboards (V1) |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
#include "CMKeyboardAbstractController.h"
|
||||
|
||||
class CMKeyboardV1Controller : public CMKeyboardAbstractController
|
||||
{
|
||||
public:
|
||||
CMKeyboardV1Controller(hid_device* dev_handle, hid_device_info* dev_info);
|
||||
~CMKeyboardV1Controller();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Protocol specific funtions to be implmented |
|
||||
\*---------------------------------------------------------*/
|
||||
void SetLeds(std::vector<led> leds, std::vector<RGBColor> colors);
|
||||
void SetSingleLED(uint8_t in_led, RGBColor in_color);
|
||||
void Initialize();
|
||||
void Shutdown();
|
||||
void SetLEDControl(bool bManual);
|
||||
|
||||
void SetActiveEffect(uint8_t effectId);
|
||||
uint8_t GetActiveEffect();
|
||||
void SetEffect(uint8_t effectId, uint8_t p1, uint8_t p2, uint8_t p3, RGBColor color1, RGBColor color2);
|
||||
struct cm_keyboard_effect GetEffect(uint8_t effectId);
|
||||
void SetCustomMode();
|
||||
void SetMode(mode selectedMode);
|
||||
std::vector<uint8_t> GetEnabledEffects();
|
||||
void InitializeModes(std::vector<mode> &modes);
|
||||
KEYBOARD_LAYOUT GetKeyboardLayout();
|
||||
|
||||
private:
|
||||
std::string _GetFirmwareVersion();
|
||||
|
||||
};
|
||||
1046
Controllers/CoolerMasterController/CMKeyboardV2Controller.cpp
Normal file
1046
Controllers/CoolerMasterController/CMKeyboardV2Controller.cpp
Normal file
File diff suppressed because it is too large
Load diff
54
Controllers/CoolerMasterController/CMKeyboardV2Controller.h
Normal file
54
Controllers/CoolerMasterController/CMKeyboardV2Controller.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMKeyboardV2Controller.h |
|
||||
| |
|
||||
| Driver for Coolermaster V2 |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
#include "CMKeyboardAbstractController.h"
|
||||
|
||||
struct stCMKeyboardV2_mode
|
||||
{
|
||||
const char *name;
|
||||
unsigned int value;
|
||||
unsigned int speed_min;
|
||||
unsigned int speed_max;
|
||||
unsigned int speed;
|
||||
unsigned int brightness;
|
||||
unsigned int direction;
|
||||
unsigned int nColors;
|
||||
unsigned int color_mode;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
class CMKeyboardV2Controller : public CMKeyboardAbstractController
|
||||
{
|
||||
public:
|
||||
CMKeyboardV2Controller(hid_device* dev_handle, hid_device_info* dev_info);
|
||||
~CMKeyboardV2Controller();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Protocol specific funtions to be implmented |
|
||||
\*---------------------------------------------------------*/
|
||||
void SetLeds(std::vector<led> leds, std::vector<RGBColor> colors);
|
||||
void SetSingleLED(uint8_t in_led, RGBColor in_color);
|
||||
void Initialize();
|
||||
void Shutdown();
|
||||
void SetLEDControl(bool bManual);
|
||||
void SendApplyPacket(uint8_t mode);
|
||||
void MagicStartupPacket();
|
||||
void MagicCommand(uint8_t profileId);
|
||||
void SetCustomMode();
|
||||
void SetMode(mode selectedMode);
|
||||
void SetEffect(uint8_t effectId, uint8_t p1, uint8_t p2, uint8_t p3, RGBColor color1, RGBColor color2);
|
||||
void InitializeModes(std::vector<mode> &modes);
|
||||
KEYBOARD_LAYOUT GetKeyboardLayout();
|
||||
|
||||
private:
|
||||
void _SetEffectMode(uint8_t effectId);
|
||||
void _UpdateSpeed(mode selectedMode, uint8_t &cSpeed1, uint8_t &cSpeed2);
|
||||
std::string _GetFirmwareVersion();
|
||||
|
||||
bool m_bMoreFFs;
|
||||
};
|
||||
|
|
@ -1,320 +0,0 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMMKController.cpp |
|
||||
| |
|
||||
| Lukas N (chmod222) 28th Jun 2020 |
|
||||
| Tam D (too.manyhobbies) 25th Apr 2021 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#include "CMMKController.h"
|
||||
|
||||
CMMKController::CMMKController(hid_device* dev, hid_device_info* dev_info)
|
||||
{
|
||||
location = dev_info->path;
|
||||
|
||||
const int szTemp = 256;
|
||||
wchar_t tmpName[szTemp];
|
||||
|
||||
hid_get_manufacturer_string(dev, tmpName, szTemp);
|
||||
std::wstring wName = std::wstring(tmpName);
|
||||
vendor_name = std::string(wName.begin(), wName.end());
|
||||
|
||||
hid_get_product_string(dev, tmpName, szTemp);
|
||||
wName = std::wstring(tmpName);
|
||||
device_name = std::string(wName.begin(), wName.end());
|
||||
|
||||
cmmk_attach_path(&cmmk_handle, dev_info->path, dev_info->product_id, -1);
|
||||
|
||||
char buf[32] = {0};
|
||||
cmmk_get_firmware_version(&cmmk_handle, buf, 32);
|
||||
firmware_version = std::string(buf);
|
||||
|
||||
enum cmmk_product_type kb_type = cmmk_get_device_model(&cmmk_handle);
|
||||
|
||||
switch(kb_type)
|
||||
{
|
||||
case CMMK_PRODUCT_MASTERKEYS_PRO_S:
|
||||
case CMMK_PRODUCT_MASTERKEYS_SK630:
|
||||
kb_size = KEYBOARD_SIZE_TKL;
|
||||
row_count = CMMK_ROWS_MAX - 1;
|
||||
column_count = CMMK_COLS_MAX - 4;
|
||||
break;
|
||||
|
||||
case CMMK_PRODUCT_MASTERKEYS_PRO_L:
|
||||
case CMMK_PRODUCT_MASTERKEYS_SK650:
|
||||
kb_size = KEYBOARD_SIZE_FULL;
|
||||
row_count = CMMK_ROWS_MAX - 1;
|
||||
column_count = CMMK_COLS_MAX;
|
||||
break;
|
||||
|
||||
case CMMK_PRODUCT_MASTERKEYS_MK750:
|
||||
default:
|
||||
kb_size = KEYBOARD_SIZE_FULL;
|
||||
row_count = CMMK_ROWS_MAX;
|
||||
column_count = CMMK_COLS_MAX;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------*\
|
||||
| Detect the keyboard version and set the appropriate layout. |
|
||||
\*--------------------------------------------------------------*/
|
||||
|
||||
switch(firmware_version[0])
|
||||
{
|
||||
case '1':
|
||||
kb_layout_type = KEYBOARD_LAYOUT_ANSI_QWERTY;
|
||||
break;
|
||||
|
||||
/*--------------------------------------------------------------*\
|
||||
| In case we need to handle different versions in the future. |
|
||||
\*--------------------------------------------------------------*/
|
||||
default:
|
||||
kb_layout_type = KEYBOARD_LAYOUT_ISO_QWERTY;
|
||||
break;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------*\
|
||||
| Populate key offsets. |
|
||||
\*--------------------------------------------------------------*/
|
||||
keyboard_layout* kb_layout;
|
||||
if(KEYBOARD_LAYOUT_ANSI_QWERTY == kb_layout_type)
|
||||
{
|
||||
switch (kb_type)
|
||||
{
|
||||
case CMMK_PRODUCT_MASTERKEYS_PRO_L:
|
||||
kb_layout = &layout_ansi_pro_l;
|
||||
break;
|
||||
case CMMK_PRODUCT_MASTERKEYS_PRO_S:
|
||||
kb_layout = &layout_ansi_pro_s;
|
||||
break;
|
||||
case CMMK_PRODUCT_MASTERKEYS_MK750:
|
||||
kb_layout = &layout_ansi_mk750;
|
||||
break;
|
||||
case CMMK_PRODUCT_MASTERKEYS_SK630:
|
||||
kb_layout = &layout_ansi_sk630;
|
||||
break;
|
||||
case CMMK_PRODUCT_MASTERKEYS_SK650:
|
||||
kb_layout = &layout_ansi_sk650;
|
||||
break;
|
||||
|
||||
default:
|
||||
kb_layout = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (kb_type)
|
||||
{
|
||||
case CMMK_PRODUCT_MASTERKEYS_PRO_L:
|
||||
kb_layout = &layout_iso_pro_l;
|
||||
break;
|
||||
case CMMK_PRODUCT_MASTERKEYS_PRO_S:
|
||||
kb_layout = &layout_iso_pro_s;
|
||||
break;
|
||||
case CMMK_PRODUCT_MASTERKEYS_MK750:
|
||||
kb_layout = &layout_iso_mk750;
|
||||
break;
|
||||
case CMMK_PRODUCT_MASTERKEYS_SK630:
|
||||
kb_layout = &layout_iso_sk630;
|
||||
break;
|
||||
case CMMK_PRODUCT_MASTERKEYS_SK650:
|
||||
kb_layout = &layout_iso_sk650;
|
||||
break;
|
||||
|
||||
default:
|
||||
kb_layout = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<int> keys_fn, keys_main, keys_num, keys_extra;
|
||||
|
||||
memset(&kb_transform, -1, row_count*column_count);
|
||||
|
||||
int key_idx = 0;
|
||||
if(kb_layout)
|
||||
{
|
||||
for(int row = 0; row < row_count; row++)
|
||||
{
|
||||
for(int col = 0; col < column_count; col++)
|
||||
{
|
||||
int val = (*kb_layout)[row][col];
|
||||
|
||||
if (-1 != val)
|
||||
{
|
||||
kb_offsets.ansi.push_back(val);
|
||||
kb_transform[row][col] = key_idx;
|
||||
key_idx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CMMKController::~CMMKController()
|
||||
{
|
||||
cmmk_detach(&cmmk_handle);
|
||||
}
|
||||
|
||||
std::string CMMKController::GetDeviceName()
|
||||
{
|
||||
return device_name;
|
||||
}
|
||||
|
||||
std::string CMMKController::GetDeviceVendor()
|
||||
{
|
||||
return vendor_name;
|
||||
}
|
||||
|
||||
std::string CMMKController::GetLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
std::string CMMKController::GetFirmwareVersion()
|
||||
{
|
||||
return firmware_version;
|
||||
}
|
||||
|
||||
uint8_t CMMKController::GetRowCount()
|
||||
{
|
||||
return row_count;
|
||||
}
|
||||
|
||||
uint8_t CMMKController::GetColumnCount()
|
||||
{
|
||||
return column_count;
|
||||
}
|
||||
|
||||
KEYBOARD_LAYOUT CMMKController::GetLayout()
|
||||
{
|
||||
return kb_layout_type;
|
||||
}
|
||||
|
||||
keyboard_layout * CMMKController::GetTransform()
|
||||
{
|
||||
return &kb_transform;
|
||||
}
|
||||
|
||||
KEYBOARD_SIZE CMMKController::GetSize()
|
||||
{
|
||||
return kb_size;
|
||||
}
|
||||
|
||||
layout_values CMMKController::GetLayoutValues()
|
||||
{
|
||||
return kb_offsets;
|
||||
}
|
||||
|
||||
void CMMKController::SetFirmwareControl()
|
||||
{
|
||||
ActivateMode(CMMK_FIRMWARE);
|
||||
}
|
||||
|
||||
void CMMKController::SetManualControl()
|
||||
{
|
||||
ActivateMode(CMMK_MANUAL);
|
||||
}
|
||||
|
||||
void CMMKController::SetSingle(int row, int col, struct rgb color)
|
||||
{
|
||||
cmmk_set_single_key(&cmmk_handle, row, col, &color);
|
||||
}
|
||||
|
||||
void CMMKController::SetAll(struct cmmk_color_matrix const& colors)
|
||||
{
|
||||
cmmk_set_leds(&cmmk_handle, &colors);
|
||||
}
|
||||
|
||||
void CMMKController::SetAllSingle(struct rgb color)
|
||||
{
|
||||
cmmk_set_all_single(&cmmk_handle, &color);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_fully_lit eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_FULLY_LIT);
|
||||
cmmk_set_effect_fully_lit(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_breathe eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_BREATHE);
|
||||
cmmk_set_effect_breathe(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_cycle eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_CYCLE);
|
||||
cmmk_set_effect_cycle(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_single eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_SINGLE);
|
||||
cmmk_set_effect_single(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_wave eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_WAVE);
|
||||
cmmk_set_effect_wave(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_ripple eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_RIPPLE);
|
||||
cmmk_set_effect_ripple(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_cross eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_CROSS);
|
||||
cmmk_set_effect_cross(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_raindrops eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_RAINDROPS);
|
||||
cmmk_set_effect_raindrops(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_stars eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_STARS);
|
||||
cmmk_set_effect_stars(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
void CMMKController::SetMode(cmmk_effect_snake eff)
|
||||
{
|
||||
ActivateEffect(CMMK_EFFECT_SNAKE);
|
||||
cmmk_set_effect_snake(&cmmk_handle, &eff);
|
||||
}
|
||||
|
||||
bool CMMKController::PositionValid(int y, int x)
|
||||
{
|
||||
return(cmmk_lookup_key_id(&cmmk_handle, y, x) >= 0);
|
||||
}
|
||||
|
||||
void CMMKController::ActivateMode(int mode)
|
||||
{
|
||||
if (current_mode != mode)
|
||||
{
|
||||
cmmk_set_control_mode(&cmmk_handle, mode);
|
||||
|
||||
current_mode = mode;
|
||||
current_effect = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void CMMKController::ActivateEffect(int effect)
|
||||
{
|
||||
ActivateMode(CMMK_EFFECT);
|
||||
|
||||
if (current_effect != effect)
|
||||
{
|
||||
cmmk_set_active_effect(&cmmk_handle, (enum cmmk_effect_id)effect);
|
||||
|
||||
current_effect = effect;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| CMMKController.h |
|
||||
| |
|
||||
| Driver for Coolermaster MasterKeys keyboards |
|
||||
| |
|
||||
| Lukas N (chmod222) 28th Jun 2020 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include <KeyboardLayoutManager.h>
|
||||
#include <hidapi/hidapi.h>
|
||||
#include <libcmmk/libcmmk.h>
|
||||
|
||||
typedef int16_t keyboard_layout[CMMK_ROWS_MAX][CMMK_COLS_MAX];
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| i'm not thrilled with the include path, but this will |
|
||||
| work for now. fixing this would need to happen in libcmmk |
|
||||
\*---------------------------------------------------------*/
|
||||
#pragma GCC push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#include <ansi/pro_s.h>
|
||||
#include <ansi/pro_l.h>
|
||||
#include <ansi/mk750.h>
|
||||
#include <ansi/sk630.h>
|
||||
#include <ansi/sk650.h>
|
||||
#include <iso/pro_s.h>
|
||||
#include <iso/pro_l.h>
|
||||
#include <iso/mk750.h>
|
||||
#include <iso/sk630.h>
|
||||
#include <iso/sk650.h>
|
||||
#pragma GCC pop
|
||||
|
||||
#pragma once
|
||||
|
||||
class CMMKController
|
||||
{
|
||||
public:
|
||||
CMMKController(hid_device* dev_handle, hid_device_info* dev_info);
|
||||
~CMMKController();
|
||||
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceVendor();
|
||||
std::string GetLocation();
|
||||
std::string GetFirmwareVersion();
|
||||
uint8_t GetRowCount();
|
||||
uint8_t GetColumnCount();
|
||||
|
||||
KEYBOARD_LAYOUT GetLayout();
|
||||
KEYBOARD_SIZE GetSize();
|
||||
layout_values GetLayoutValues();
|
||||
keyboard_layout* GetTransform();
|
||||
|
||||
void SetFirmwareControl();
|
||||
void SetManualControl();
|
||||
|
||||
void SetSingle(int row, int col, struct rgb color);
|
||||
void SetAll(struct cmmk_color_matrix const& colors);
|
||||
void SetAllSingle(struct rgb color);
|
||||
|
||||
void SetMode(cmmk_effect_fully_lit eff);
|
||||
void SetMode(cmmk_effect_breathe eff);
|
||||
void SetMode(cmmk_effect_cycle eff);
|
||||
void SetMode(cmmk_effect_single eff);
|
||||
void SetMode(cmmk_effect_wave eff);
|
||||
void SetMode(cmmk_effect_ripple eff);
|
||||
void SetMode(cmmk_effect_cross eff);
|
||||
void SetMode(cmmk_effect_raindrops eff);
|
||||
void SetMode(cmmk_effect_stars eff);
|
||||
void SetMode(cmmk_effect_snake eff);
|
||||
|
||||
bool PositionValid(int y, int x);
|
||||
|
||||
private:
|
||||
void ActivateMode(int mode);
|
||||
void ActivateEffect(int effect);
|
||||
|
||||
int current_mode = -1;
|
||||
int current_effect = -1;
|
||||
|
||||
std::string device_name;
|
||||
std::string vendor_name;
|
||||
std::string location;
|
||||
std::string firmware_version;
|
||||
|
||||
KEYBOARD_SIZE kb_size;
|
||||
KEYBOARD_LAYOUT kb_layout_type;
|
||||
layout_values kb_offsets;
|
||||
keyboard_layout kb_transform;
|
||||
keyboard_layout* kb_layout;
|
||||
|
||||
uint8_t row_count;
|
||||
uint8_t column_count;
|
||||
|
||||
mutable struct cmmk cmmk_handle;
|
||||
};
|
||||
|
|
@ -17,8 +17,9 @@
|
|||
#include "RGBController_CMARGBGen2A1Controller.h"
|
||||
#include "RGBController_CMRGBController.h"
|
||||
#include "RGBController_CMR6000Controller.h"
|
||||
#include "RGBController_CMMKController.h"
|
||||
#include "RGBController_CMMonitorController.h"
|
||||
#include "RGBController_CMKeyboardController.h"
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Coolermaster USB vendor ID |
|
||||
\*-----------------------------------------------------*/
|
||||
|
|
@ -26,13 +27,8 @@
|
|||
|
||||
/*-----------------------------------------------------*\
|
||||
| Coolermaster Keyboards |
|
||||
| PIDs defined in `CMMKControllerV2.h` |
|
||||
\*-----------------------------------------------------*/
|
||||
#define COOLERMASTER_MASTERKEYS_PRO_L_PID 0x003B
|
||||
#define COOLERMASTER_MASTERKEYS_PRO_L_WHITE_PID 0x0047
|
||||
#define COOLERMASTER_MASTERKEYS_PRO_S_PID 0x003C
|
||||
#define COOLERMASTER_MASTERKEYS_MK750_PID 0x0067
|
||||
#define COOLERMASTER_MASTERKEYS_SK630_PID 0x0089
|
||||
#define COOLERMASTER_MASTERKEYS_SK650_PID 0x008D
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Coolermaster GPUs |
|
||||
|
|
@ -125,16 +121,75 @@ void DetectCoolerMasterGPU(hid_device_info* info, const std::string&)
|
|||
}
|
||||
}
|
||||
|
||||
void DetectCoolerMasterKeyboards(hid_device_info* info, const std::string&)
|
||||
void DetectCoolerMasterV1Keyboards(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
CMMKController* controller = new CMMKController(dev, info);
|
||||
RGBController_CMMKController* rgb_controller = new RGBController_CMMKController(controller);
|
||||
// Constructor sets the name
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
switch(info->product_id)
|
||||
{
|
||||
case COOLERMASTER_KEYBOARD_PRO_L_PID:
|
||||
case COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID:
|
||||
case COOLERMASTER_KEYBOARD_PRO_S_PID:
|
||||
{
|
||||
CMKeyboardV1Controller* controller = new CMKeyboardV1Controller(dev, info);
|
||||
controller->SetDeviceName(name);
|
||||
RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller);
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
LOG_DEBUG("[%s] Controller not created as the product ID %04X is missing from detector switch", name.c_str(), info->product_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DetectCoolerMasterV2Keyboards(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
switch(info->product_id)
|
||||
{
|
||||
case COOLERMASTER_KEYBOARD_PRO_L_PID:
|
||||
case COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID:
|
||||
case COOLERMASTER_KEYBOARD_PRO_S_PID:
|
||||
{
|
||||
CMKeyboardV1Controller* controller = new CMKeyboardV1Controller(dev, info);
|
||||
controller->SetDeviceName(name);
|
||||
RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller);
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
break;
|
||||
|
||||
case COOLERMASTER_KEYBOARD_SK622B_PID:
|
||||
case COOLERMASTER_KEYBOARD_SK622W_PID:
|
||||
case COOLERMASTER_KEYBOARD_SK630_PID:
|
||||
case COOLERMASTER_KEYBOARD_SK650_PID:
|
||||
case COOLERMASTER_KEYBOARD_SK652_PID:
|
||||
case COOLERMASTER_KEYBOARD_SK653_PID:
|
||||
case COOLERMASTER_KEYBOARD_CK530_PID:
|
||||
case COOLERMASTER_KEYBOARD_CK530_V2_PID:
|
||||
case COOLERMASTER_KEYBOARD_CK550_V2_PID:
|
||||
case COOLERMASTER_KEYBOARD_CK552_V2_PID:
|
||||
case COOLERMASTER_KEYBOARD_MK730_PID:
|
||||
case COOLERMASTER_KEYBOARD_MK750_PID:
|
||||
{
|
||||
CMKeyboardV2Controller* controller = new CMKeyboardV2Controller(dev, info);
|
||||
controller->SetDeviceName(name);
|
||||
RGBController_CMKeyboardController* rgb_controller = new RGBController_CMKeyboardController(controller);
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
||||
default:
|
||||
LOG_DEBUG("[%s] Controller not created as the product ID %04X is missing from detector switch", name.c_str(), info->product_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -227,13 +282,24 @@ void DetectCoolerMasterMonitor(hid_device_info* info, const std::string& name)
|
|||
|
||||
/*-----------------------------------------------------*\
|
||||
| Coolermaster Keyboards |
|
||||
| PIDs defined in `CMKeyboardDevices.h` |
|
||||
\*-----------------------------------------------------*/
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MasterKeys Pro L", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_PRO_L_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MasterKeys Pro L White", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_PRO_L_WHITE_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MasterKeys Pro S", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_PRO_S_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MK750", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_MK750_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master SK630", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_SK630_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master SK650", DetectCoolerMasterKeyboards, COOLERMASTER_VID, COOLERMASTER_MASTERKEYS_SK650_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MasterKeys Pro S", DetectCoolerMasterV1Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_PRO_S_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MasterKeys Pro L", DetectCoolerMasterV1Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_PRO_L_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MasterKeys Pro L White", DetectCoolerMasterV1Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_PRO_L_WHITE_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MK850", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_MK850_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master SK622 White", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_SK622W_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master SK622 Black", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_SK622B_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master SK630", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_SK630_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master SK650", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_SK650_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master SK652", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_SK652_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master SK653", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_SK653_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MK730", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_MK730_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master MK750", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_MK750_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master CK530", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_CK530_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master CK530 V2", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_CK530_V2_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master CK550 V2", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_CK550_V2_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_IPU("Cooler Master CK550 V1 / CK552", DetectCoolerMasterV2Keyboards, COOLERMASTER_VID, COOLERMASTER_KEYBOARD_CK552_V2_PID, 1, 0xFF00, 1);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Coolermaster LEDstrip controllers |
|
||||
|
|
|
|||
|
|
@ -0,0 +1,185 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| RGBController_CMKeyboardController.cpp |
|
||||
| |
|
||||
| Controller for Coolermaster keyboards |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
#include "RGBController_CMKeyboardController.h"
|
||||
#include "CMKeyboardDevices.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Coolermaster Masterkeys Keyboards
|
||||
@category Keyboard
|
||||
@type USB
|
||||
@save :robot:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectCoolerMasterKeyboards
|
||||
@comment
|
||||
In CMKeyboardV1Controller brightness control not supported.
|
||||
Supported effects differ between CMKeyboardV1Controller and
|
||||
CMKeyboardV2Controller.
|
||||
\*-------------------------------------------------------------------*/
|
||||
RGBController_CMKeyboardController::RGBController_CMKeyboardController(CMKeyboardAbstractController* pController)
|
||||
{
|
||||
m_pController = pController;
|
||||
vendor = m_pController->GetDeviceVendor();
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "Cooler Master Keyboard Device";
|
||||
version = m_pController->GetFirmwareVersion();
|
||||
|
||||
/*----------------------------------------------------------------*\
|
||||
| Coolermaster uses the name field to store the serial number in |
|
||||
| many of their keyboards. |
|
||||
\*----------------------------------------------------------------*/
|
||||
serial = m_pController->GetDeviceSerial();
|
||||
location = m_pController->GetLocation();
|
||||
m_keyboardLayout = m_pController->GetKeyboardLayout();
|
||||
name = m_pController->GetDeviceName();
|
||||
|
||||
m_pController->InitializeModes(modes);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_CMKeyboardController::~RGBController_CMKeyboardController()
|
||||
{
|
||||
for(size_t i = 0; i < m_pUnknownKeyNames.size(); i++)
|
||||
{
|
||||
if(m_pUnknownKeyNames[i])
|
||||
{
|
||||
delete(m_pUnknownKeyNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
delete m_pLayoutManager;
|
||||
}
|
||||
|
||||
#include <set>
|
||||
#define COOLERMASTER_ZONES_MAX 1
|
||||
void RGBController_CMKeyboardController::SetupZones()
|
||||
{
|
||||
std::string physical_size;
|
||||
unsigned int max_led_value = 0;
|
||||
const cm_kb_device* coolermaster = m_pController->GetDeviceData();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in zones from the device data |
|
||||
\*---------------------------------------------------------*/
|
||||
for(size_t i = 0; i < COOLERMASTER_ZONES_MAX; i++)
|
||||
{
|
||||
if(coolermaster->zones[i] == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
zone new_zone;
|
||||
|
||||
new_zone.name = coolermaster->zones[i]->name;
|
||||
new_zone.type = coolermaster->zones[i]->type;
|
||||
|
||||
if(new_zone.type == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
KeyboardLayoutManager new_kb(m_keyboardLayout, coolermaster->layout_new->base_size, coolermaster->layout_new->key_values);
|
||||
|
||||
matrix_map_type * new_map = new matrix_map_type;
|
||||
new_zone.matrix_map = new_map;
|
||||
|
||||
new_map->map = new unsigned int[new_map->height * new_map->width];
|
||||
|
||||
if(coolermaster->layout_new->base_size != KEYBOARD_SIZE_EMPTY)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Minor adjustments to keyboard layout |
|
||||
\*---------------------------------------------------------*/
|
||||
keyboard_keymap_overlay_values* temp = coolermaster->layout_new;
|
||||
new_kb.ChangeKeys(*temp);
|
||||
|
||||
new_map->height = new_kb.GetRowCount();
|
||||
new_map->width = new_kb.GetColumnCount();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Matrix map still uses declared zone rows and columns |
|
||||
| as the packet structure depends on the matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
new_kb.GetKeyMap(new_map->map, KEYBOARD_MAP_FILL_TYPE_COUNT, new_map->height, new_map->width);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Create LEDs for the Matrix zone |
|
||||
| Place keys in the layout to populate the matrix |
|
||||
\*---------------------------------------------------------*/
|
||||
new_zone.leds_count = new_kb.GetKeyCount();
|
||||
LOG_DEBUG("[%s] Created KB matrix with %d rows and %d columns containing %d keys",
|
||||
m_pController->GetDeviceName().c_str(), new_kb.GetRowCount(), new_kb.GetColumnCount(), new_zone.leds_count);
|
||||
|
||||
for(size_t led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
|
||||
new_led.name = new_kb.GetKeyNameAt(led_idx);
|
||||
new_led.value = new_kb.GetKeyValueAt(led_idx);
|
||||
max_led_value = std::max(max_led_value, new_led.value);
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Add 1 the max_led_value to account for the 0th index |
|
||||
\*---------------------------------------------------------*/
|
||||
max_led_value++;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| name is not set yet so description is used instead |
|
||||
\*---------------------------------------------------------*/
|
||||
LOG_DEBUG("[%s] Creating a %s zone: %s with %d LEDs", description.c_str(),
|
||||
((new_zone.type == ZONE_TYPE_MATRIX) ? "matrix": "linear"),
|
||||
new_zone.name.c_str(), new_zone.leds_count);
|
||||
new_zone.leds_min = new_zone.leds_count;
|
||||
new_zone.leds_max = new_zone.leds_count;
|
||||
zones.push_back(new_zone);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_CMKeyboardController::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
}
|
||||
|
||||
void RGBController_CMKeyboardController::DeviceUpdateLEDs()
|
||||
{
|
||||
m_pController->SetLeds(leds, colors);
|
||||
}
|
||||
|
||||
void RGBController_CMKeyboardController::UpdateSingleLED(int led, RGBColor color)
|
||||
{
|
||||
uint8_t key_value = m_pLayoutManager->GetKeyValueAt(led);
|
||||
m_pController->SetSingleLED(key_value, color);
|
||||
}
|
||||
|
||||
void RGBController_CMKeyboardController::UpdateSingleLED(int led)
|
||||
{
|
||||
m_pController->SetSingleLED(led, colors[led]);
|
||||
}
|
||||
|
||||
void RGBController_CMKeyboardController::UpdateZoneLEDs(int /*zone_idx*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CMKeyboardController::DeviceUpdateMode()
|
||||
{
|
||||
m_pController->SetMode(modes[active_mode]);
|
||||
}
|
||||
|
||||
void RGBController_CMKeyboardController::SetCustomMode()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| RGBController_CMKeyboardController.h |
|
||||
| |
|
||||
| Controller for Coolermaster keyboards |
|
||||
| |
|
||||
| Tam D (too.manyhobbies) 30th Nov 2023 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "CMKeyboardAbstractController.h"
|
||||
#include "CMKeyboardV1Controller.h"
|
||||
#include "CMKeyboardV2Controller.h"
|
||||
#include "CMKeyboardDevices.h"
|
||||
|
||||
class RGBController_CMKeyboardController : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_CMKeyboardController(CMKeyboardAbstractController* pController);
|
||||
~RGBController_CMKeyboardController();
|
||||
|
||||
void SetupZones();
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateSingleLED(int led, RGBColor color);
|
||||
void UpdateSingleLED(int led);
|
||||
void UpdateZoneLEDs(int zone_idx);
|
||||
|
||||
void SetCustomMode();
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
CMKeyboardAbstractController* m_pController;;
|
||||
KeyboardLayoutManager* m_pLayoutManager;
|
||||
KEYBOARD_LAYOUT m_keyboardLayout;
|
||||
KEYBOARD_SIZE m_keyboardSize;
|
||||
layout_values m_layoutValues;
|
||||
std::vector<char *> m_pUnknownKeyNames;
|
||||
};
|
||||
|
|
@ -1,503 +0,0 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| RGBController_CMMKController.cpp |
|
||||
| |
|
||||
| Driver for Coolermaster MasterKeys keyboards |
|
||||
| |
|
||||
| Lukas N (chmod222) 28th Jun 2020 |
|
||||
| Tam D (too.manyhobbies) 25th Apr 2021 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_CMMKController.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#define CMMK_SPEED_MIN CMMK_SPEED0
|
||||
#define CMMK_SPEED_MID CMMK_SPEED2
|
||||
#define CMMK_SPEED_MAX CMMK_SPEED4
|
||||
#define CMMK_MODE_FIRMWARE 0xFF
|
||||
#define CMMK_MODE_MANUAL 0x7F
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Coolermaster Masterkeys Keyboards
|
||||
@category Keyboard
|
||||
@type USB
|
||||
@save :robot:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectCoolerMasterKeyboards
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_CMMKController::RGBController_CMMKController(CMMKController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
name = controller->GetDeviceName();
|
||||
vendor = controller->GetDeviceVendor();
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "Cooler Master MasterKeys Device";
|
||||
version = controller->GetFirmwareVersion();
|
||||
serial = "";
|
||||
location = controller->GetLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = CMMK_MODE_MANUAL;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = CMMK_EFFECT_FULLY_LIT;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.colors.resize(1);
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = CMMK_EFFECT_BREATHE;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.speed_min = CMMK_SPEED_MIN;
|
||||
Breathing.speed_max = CMMK_SPEED_MAX;
|
||||
Breathing.speed = CMMK_SPEED_MID;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.colors.resize(1);
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Cycle;
|
||||
Cycle.name = "Spectrum Cycle";
|
||||
Cycle.value = CMMK_EFFECT_CYCLE;
|
||||
Cycle.flags = MODE_FLAG_HAS_SPEED;
|
||||
Cycle.color_mode = MODE_COLORS_NONE;
|
||||
Cycle.speed_min = 2 * CMMK_SPEED_MIN; //Spectrum Cycle uses a unique speed range
|
||||
Cycle.speed_max = 2 * CMMK_SPEED_MAX;
|
||||
Cycle.speed = 2 * CMMK_SPEED_MID;
|
||||
modes.push_back(Cycle);
|
||||
|
||||
mode Reactive;
|
||||
Reactive.name = "Reactive";
|
||||
Reactive.value = CMMK_EFFECT_SINGLE;
|
||||
Reactive.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Reactive.speed_min = CMMK_SPEED_MIN;
|
||||
Reactive.speed_max = CMMK_SPEED_MAX;
|
||||
Reactive.speed = CMMK_SPEED_MID;
|
||||
Reactive.colors_min = 2;
|
||||
Reactive.colors_max = 2;
|
||||
Reactive.colors.resize(2);
|
||||
modes.push_back(Reactive);
|
||||
|
||||
mode Wave;
|
||||
Wave.name = "Rainbow Wave";
|
||||
Wave.value = CMMK_EFFECT_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD;
|
||||
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Wave.speed_min = CMMK_SPEED_MIN;
|
||||
Wave.speed_max = CMMK_SPEED_MAX;
|
||||
Wave.speed = CMMK_SPEED_MID;
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.colors_min = 1;
|
||||
Wave.colors_max = 1;
|
||||
Wave.colors.resize(1);
|
||||
modes.push_back(Wave);
|
||||
|
||||
mode Ripple;
|
||||
Ripple.name = "Ripple Effect";
|
||||
Ripple.value = CMMK_EFFECT_RIPPLE;
|
||||
Ripple.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Ripple.speed_min = CMMK_SPEED_MIN;
|
||||
Ripple.speed_max = CMMK_SPEED_MAX;
|
||||
Ripple.speed = CMMK_SPEED_MID;
|
||||
Ripple.colors_min = 2;
|
||||
Ripple.colors_max = 2;
|
||||
Ripple.colors.resize(2);
|
||||
modes.push_back(Ripple);
|
||||
|
||||
mode Cross;
|
||||
Cross.name = "Cross";
|
||||
Cross.value = CMMK_EFFECT_CROSS;
|
||||
Cross.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Cross.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Cross.speed_min = CMMK_SPEED_MIN;
|
||||
Cross.speed_max = CMMK_SPEED_MAX;
|
||||
Cross.speed = CMMK_SPEED_MID;
|
||||
Cross.colors_min = 2;
|
||||
Cross.colors_max = 2;
|
||||
Cross.colors.resize(2);
|
||||
modes.push_back(Cross);
|
||||
|
||||
mode Raindrops;
|
||||
Raindrops.name = "Raindrops";
|
||||
Raindrops.value = CMMK_EFFECT_RAINDROPS;
|
||||
Raindrops.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Raindrops.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Raindrops.speed_min = CMMK_SPEED_MIN;
|
||||
Raindrops.speed_max = CMMK_SPEED_MAX;
|
||||
Raindrops.speed = CMMK_SPEED_MID;
|
||||
Raindrops.colors_min = 2;
|
||||
Raindrops.colors_max = 2;
|
||||
Raindrops.colors.resize(2);
|
||||
modes.push_back(Raindrops);
|
||||
|
||||
mode Stars;
|
||||
Stars.name = "Starfield";
|
||||
Stars.value = CMMK_EFFECT_STARS;
|
||||
Stars.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Stars.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Stars.speed_min = CMMK_SPEED_MIN;
|
||||
Stars.speed_max = CMMK_SPEED_MAX;
|
||||
Stars.speed = CMMK_SPEED_MID;
|
||||
Stars.colors_min = 2;
|
||||
Stars.colors_max = 2;
|
||||
Stars.colors.resize(2);
|
||||
modes.push_back(Stars);
|
||||
|
||||
mode Snake;
|
||||
Snake.name = "Snake";
|
||||
Snake.value = CMMK_EFFECT_SNAKE;
|
||||
Snake.flags = MODE_FLAG_HAS_SPEED;
|
||||
Snake.color_mode = MODE_COLORS_NONE;
|
||||
Snake.speed_min = CMMK_SPEED_MIN;
|
||||
Snake.speed_max = CMMK_SPEED_MAX;
|
||||
Snake.speed = CMMK_SPEED_MID;
|
||||
modes.push_back(Snake);
|
||||
|
||||
mode FirmwareControl;
|
||||
FirmwareControl.name = "Firmware Controlled";
|
||||
FirmwareControl.value = 0xFF;
|
||||
FirmwareControl.flags = 0;
|
||||
FirmwareControl.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(FirmwareControl);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_CMMKController::~RGBController_CMMKController()
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_CMMKController::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Create the keyboard zone usiung Keyboard Layout Manager |
|
||||
\*---------------------------------------------------------*/
|
||||
zone new_zone;
|
||||
new_zone.name = ZONE_EN_KEYBOARD;
|
||||
new_zone.type = ZONE_TYPE_MATRIX;
|
||||
|
||||
layoutManager = new KeyboardLayoutManager(controller->GetLayout(), controller->GetSize(), controller->GetLayoutValues());
|
||||
|
||||
matrix_map_type * new_map = new matrix_map_type;
|
||||
new_zone.matrix_map = new_map;
|
||||
new_zone.matrix_map->height = layoutManager->GetRowCount();
|
||||
new_zone.matrix_map->width = layoutManager->GetColumnCount();
|
||||
|
||||
new_zone.matrix_map->map = new unsigned int[new_map->height * new_map->width];
|
||||
new_zone.leds_count = layoutManager->GetKeyCount();
|
||||
new_zone.leds_min = new_zone.leds_count;
|
||||
new_zone.leds_max = new_zone.leds_count;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Matrix map still uses declared zone rows and columns |
|
||||
| as the packet structure depends on the matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
layoutManager->GetKeyMap(new_map->map, KEYBOARD_MAP_FILL_TYPE_COUNT, new_map->height, new_map->width);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Create LEDs for the Matrix zone |
|
||||
| Place keys in the layout to populate the matrix |
|
||||
\*---------------------------------------------------------*/
|
||||
for(size_t led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
|
||||
new_led.name = layoutManager->GetKeyNameAt(led_idx);
|
||||
new_led.value = layoutManager->GetKeyValueAt(led_idx);
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
zones.push_back(new_zone);
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_CMMKController::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
struct rgb map_to_cmmk_rgb(RGBColor input)
|
||||
{
|
||||
return rgb
|
||||
{
|
||||
(uint8_t)RGBGetRValue(input),
|
||||
(uint8_t)RGBGetGValue(input),
|
||||
(uint8_t)RGBGetBValue(input)
|
||||
};
|
||||
}
|
||||
|
||||
enum cmmk_wave_direction map_to_cmmk_dir(int input)
|
||||
{
|
||||
switch(input)
|
||||
{
|
||||
case MODE_DIRECTION_LEFT:
|
||||
return CMMK_RIGHT_TO_LEFT;
|
||||
|
||||
case MODE_DIRECTION_RIGHT:
|
||||
return CMMK_LEFT_TO_RIGHT;
|
||||
|
||||
case MODE_DIRECTION_UP:
|
||||
return CMMK_FRONT_TO_BACK;
|
||||
|
||||
case MODE_DIRECTION_DOWN:
|
||||
return CMMK_BACK_TO_FRONT;
|
||||
|
||||
default:
|
||||
return CMMK_RIGHT_TO_LEFT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RGBController_CMMKController::copy_buffers(std::vector<RGBColor> &in_colors, struct cmmk_color_matrix& mat, std::atomic<bool>& dirty)
|
||||
{
|
||||
dirty.store(false);
|
||||
|
||||
keyboard_layout * transform = controller->GetTransform();
|
||||
|
||||
if(0 == transform)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(int row = 0; row < controller->GetRowCount(); row++)
|
||||
{
|
||||
for(int col = 0; col < controller->GetColumnCount(); col++)
|
||||
{
|
||||
int key_idx = (*transform)[row][col];
|
||||
|
||||
if(-1 == key_idx)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
struct rgb color = map_to_cmmk_rgb(in_colors[key_idx]);
|
||||
|
||||
dirty.store(true);
|
||||
mat.data[row][col] = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_CMMKController::DeviceUpdateLEDs()
|
||||
{
|
||||
copy_buffers(colors, current_matrix, dirty);
|
||||
|
||||
if(force_update.load() || dirty.load())
|
||||
{
|
||||
controller->SetAll(current_matrix);
|
||||
|
||||
force_update.store(false);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_CMMKController::UpdateZoneLEDs(int zone_idx)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device only supports a single zone, as a result we |
|
||||
| update all LEDs. |
|
||||
\*---------------------------------------------------------*/
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CMMKController::UpdateSingleLED(int led_idx, RGBColor color)
|
||||
{
|
||||
keyboard_layout * transform = controller->GetTransform();
|
||||
led selected_led = leds[led_idx];
|
||||
|
||||
if(0 == transform)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// this is really expensive
|
||||
for(int row = 0; row < controller->GetRowCount(); row++)
|
||||
{
|
||||
for(int col = 0; col < controller->GetColumnCount(); col++)
|
||||
{
|
||||
int val = (*transform)[row][col];
|
||||
|
||||
if(val != (int)selected_led.value)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
controller->SetSingle(row, col, map_to_cmmk_rgb(color));
|
||||
dirty.store(false);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RGBController_CMMKController::UpdateSingleLED(int led_idx)
|
||||
{
|
||||
UpdateSingleLED(led_idx, colors[led_idx]);
|
||||
}
|
||||
|
||||
void RGBController_CMMKController::SetCustomMode()
|
||||
{
|
||||
active_mode = 1;
|
||||
}
|
||||
|
||||
void RGBController_CMMKController::DeviceUpdateMode()
|
||||
{
|
||||
force_update.store(true);
|
||||
|
||||
switch(modes[active_mode].value)
|
||||
{
|
||||
case CMMK_MODE_FIRMWARE:
|
||||
controller->SetFirmwareControl();
|
||||
break;
|
||||
|
||||
case CMMK_MODE_MANUAL:
|
||||
controller->SetManualControl();
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_FULLY_LIT:
|
||||
{
|
||||
cmmk_effect_fully_lit fully_lit_effect;
|
||||
|
||||
fully_lit_effect.color = map_to_cmmk_rgb(modes[active_mode].colors[0]);
|
||||
|
||||
controller->SetMode(fully_lit_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_BREATHE:
|
||||
{
|
||||
cmmk_effect_breathe breathe_effect;
|
||||
|
||||
breathe_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
breathe_effect.color = map_to_cmmk_rgb(modes[active_mode].colors[0]);
|
||||
|
||||
controller->SetMode(breathe_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_CYCLE:
|
||||
{
|
||||
cmmk_effect_cycle cycle_effect;
|
||||
|
||||
cycle_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
|
||||
controller->SetMode(cycle_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_SINGLE:
|
||||
{
|
||||
cmmk_effect_single single_effect;
|
||||
|
||||
single_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
single_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
|
||||
single_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
|
||||
|
||||
controller->SetMode(single_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_WAVE:
|
||||
{
|
||||
cmmk_effect_wave wave_effect;
|
||||
|
||||
wave_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
wave_effect.direction = map_to_cmmk_dir(modes[active_mode].direction);
|
||||
wave_effect.start = map_to_cmmk_rgb(modes[active_mode].colors[0]);
|
||||
|
||||
controller->SetMode(wave_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_RIPPLE:
|
||||
{
|
||||
cmmk_effect_ripple ripple_effect;
|
||||
|
||||
ripple_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
ripple_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
|
||||
ripple_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
|
||||
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_RANDOM)
|
||||
{
|
||||
ripple_effect.ripple_type = CMMK_RIPPLE_RANDOM_COLOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ripple_effect.ripple_type = CMMK_RIPPLE_GIVEN_COLOR;
|
||||
}
|
||||
|
||||
controller->SetMode(ripple_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_CROSS:
|
||||
{
|
||||
cmmk_effect_cross cross_effect;
|
||||
|
||||
cross_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
cross_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
|
||||
cross_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
|
||||
|
||||
controller->SetMode(cross_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_RAINDROPS:
|
||||
{
|
||||
cmmk_effect_raindrops raindrops_effect;
|
||||
|
||||
raindrops_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
raindrops_effect.interval = CMMK_SPEED_MID;
|
||||
raindrops_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
|
||||
raindrops_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
|
||||
|
||||
controller->SetMode(raindrops_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_STARS:
|
||||
{
|
||||
cmmk_effect_stars stars_effect;
|
||||
|
||||
stars_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
stars_effect.interval = CMMK_SPEED_MID;
|
||||
stars_effect.active = map_to_cmmk_rgb(modes[active_mode].colors[0]);
|
||||
stars_effect.rest = map_to_cmmk_rgb(modes[active_mode].colors[1]);
|
||||
|
||||
controller->SetMode(stars_effect);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMMK_EFFECT_SNAKE:
|
||||
{
|
||||
cmmk_effect_snake snake_effect;
|
||||
|
||||
snake_effect.speed = (uint8_t)modes[active_mode].speed;
|
||||
|
||||
controller->SetMode(snake_effect);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
/*-------------------------------------------------------------------*\
|
||||
| RGBController_CMMKController.h |
|
||||
| |
|
||||
| Driver for Coolermaster MasterKeys keyboards |
|
||||
| |
|
||||
| Lukas N (chmod222) 28th Jun 2020 |
|
||||
| Tam D (too.manyhobbies) 25th Apr 2021 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstring>
|
||||
#include "RGBController.h"
|
||||
#include "CMMKController.h"
|
||||
#include "RGBControllerKeyNames.h"
|
||||
#include "KeyboardLayoutManager.h"
|
||||
|
||||
class RGBController_CMMKController : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_CMMKController(CMMKController* controller_ptr);
|
||||
~RGBController_CMMKController();
|
||||
|
||||
void SetupZones();
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateSingleLED(int led, RGBColor color);
|
||||
void UpdateSingleLED(int led);
|
||||
void UpdateZoneLEDs(int zone_idx);
|
||||
|
||||
void SetCustomMode();
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
void copy_buffers(std::vector<RGBColor> &in_colors, struct cmmk_color_matrix& mat, std::atomic<bool>& dirty);
|
||||
|
||||
CMMKController* controller;
|
||||
KeyboardLayoutManager* layoutManager;
|
||||
|
||||
struct cmmk_color_matrix current_matrix;
|
||||
|
||||
std::atomic<bool> dirty;
|
||||
std::atomic<bool> force_update;
|
||||
};
|
||||
28
OpenRGB.pro
28
OpenRGB.pro
|
|
@ -71,8 +71,6 @@ INCLUDEPATH +=
|
|||
dependencies/httplib \
|
||||
dependencies/json/ \
|
||||
dependencies/libe131/src/ \
|
||||
dependencies/libcmmk/include/ \
|
||||
dependencies/libcmmk/src/mappings/ \
|
||||
dependencies/libusb-1.0.22/include/ \
|
||||
dependencies/mdns \
|
||||
dependencies/mbedtls-2.24.0/include/ \
|
||||
|
|
@ -245,17 +243,6 @@ HEADERS +=
|
|||
dependencies/Swatches/swatches.h \
|
||||
dependencies/hidapi/hidapi/hidapi.h \
|
||||
dependencies/json/json.hpp \
|
||||
dependencies/libcmmk/include/libcmmk/libcmmk.h \
|
||||
dependencies/libcmmk/src/mappings/ansi/pro_s.h \
|
||||
dependencies/libcmmk/src/mappings/ansi/pro_l.h \
|
||||
dependencies/libcmmk/src/mappings/ansi/mk750.h \
|
||||
dependencies/libcmmk/src/mappings/ansi/sk630.h \
|
||||
dependencies/libcmmk/src/mappings/ansi/sk650.h \
|
||||
dependencies/libcmmk/src/mappings/iso/pro_s.h \
|
||||
dependencies/libcmmk/src/mappings/iso/pro_l.h \
|
||||
dependencies/libcmmk/src/mappings/iso/mk750.h \
|
||||
dependencies/libcmmk/src/mappings/iso/sk630.h \
|
||||
dependencies/libcmmk/src/mappings/iso/sk650.h \
|
||||
LogManager.h \
|
||||
NetworkClient.h \
|
||||
NetworkProtocol.h \
|
||||
|
|
@ -407,7 +394,10 @@ HEADERS +=
|
|||
Controllers/ColorfulTuringGPUController/RGBController_ColorfulTuringGPU.h \
|
||||
Controllers/CoolerMasterController/CMARGBcontroller.h \
|
||||
Controllers/CoolerMasterController/CMARGBGen2A1controller.h \
|
||||
Controllers/CoolerMasterController/CMMKController.h \
|
||||
Controllers/CoolerMasterController/CMKeyboardAbstractController.h \
|
||||
Controllers/CoolerMasterController/CMKeyboardDevices.h \
|
||||
Controllers/CoolerMasterController/CMKeyboardV1Controller.h \
|
||||
Controllers/CoolerMasterController/CMKeyboardV2Controller.h \
|
||||
Controllers/CoolerMasterController/CMMMController.h \
|
||||
Controllers/CoolerMasterController/CMMM711Controller.h \
|
||||
Controllers/CoolerMasterController/CMMonitorController.h \
|
||||
|
|
@ -417,7 +407,7 @@ HEADERS +=
|
|||
Controllers/CoolerMasterController/CMSmallARGBController.h \
|
||||
Controllers/CoolerMasterController/RGBController_CMARGBController.h \
|
||||
Controllers/CoolerMasterController/RGBController_CMARGBGen2A1Controller.h \
|
||||
Controllers/CoolerMasterController/RGBController_CMMKController.h \
|
||||
Controllers/CoolerMasterController/RGBController_CMKeyboardController.h \
|
||||
Controllers/CoolerMasterController/RGBController_CMMMController.h \
|
||||
Controllers/CoolerMasterController/RGBController_CMMM711Controller.h \
|
||||
Controllers/CoolerMasterController/RGBController_CMMonitorController.h \
|
||||
|
|
@ -875,7 +865,6 @@ SOURCES +=
|
|||
dependencies/hueplusplus-1.0.0/src/Utils.cpp \
|
||||
dependencies/hueplusplus-1.0.0/src/ZLLSensors.cpp \
|
||||
dependencies/libe131/src/e131.c \
|
||||
dependencies/libcmmk/src/libcmmk.c \
|
||||
main.cpp \
|
||||
cli.cpp \
|
||||
LogManager.cpp \
|
||||
|
|
@ -1038,18 +1027,21 @@ SOURCES +=
|
|||
Controllers/ColorfulTuringGPUController/RGBController_ColorfulTuringGPU.cpp \
|
||||
Controllers/CoolerMasterController/CMARGBcontroller.cpp \
|
||||
Controllers/CoolerMasterController/CMARGBGen2A1controller.cpp \
|
||||
Controllers/CoolerMasterController/CMMKController.cpp \
|
||||
Controllers/CoolerMasterController/CMKeyboardDevices.cpp \
|
||||
Controllers/CoolerMasterController/CMMMController.cpp \
|
||||
Controllers/CoolerMasterController/CMMM711Controller.cpp \
|
||||
Controllers/CoolerMasterController/CMMonitorController.cpp \
|
||||
Controllers/CoolerMasterController/CMMP750Controller.cpp \
|
||||
Controllers/CoolerMasterController/CMKeyboardAbstractController.cpp \
|
||||
Controllers/CoolerMasterController/CMKeyboardV1Controller.cpp \
|
||||
Controllers/CoolerMasterController/CMKeyboardV2Controller.cpp \
|
||||
Controllers/CoolerMasterController/CMR6000Controller.cpp \
|
||||
Controllers/CoolerMasterController/CMRGBController.cpp \
|
||||
Controllers/CoolerMasterController/CMSmallARGBController.cpp \
|
||||
Controllers/CoolerMasterController/CoolerMasterControllerDetect.cpp \
|
||||
Controllers/CoolerMasterController/RGBController_CMARGBController.cpp \
|
||||
Controllers/CoolerMasterController/RGBController_CMARGBGen2A1Controller.cpp \
|
||||
Controllers/CoolerMasterController/RGBController_CMMKController.cpp \
|
||||
Controllers/CoolerMasterController/RGBController_CMKeyboardController.cpp \
|
||||
Controllers/CoolerMasterController/RGBController_CMMMController.cpp \
|
||||
Controllers/CoolerMasterController/RGBController_CMMM711Controller.cpp \
|
||||
Controllers/CoolerMasterController/RGBController_CMMonitorController.cpp \
|
||||
|
|
|
|||
|
|
@ -327,7 +327,6 @@ There have been two instances of hardware damage in OpenRGB's development and we
|
|||
* NVFC: https://github.com/graphitemaster/NVFC
|
||||
* Qt-Plus (ColorWheel): https://github.com/liuyanghejerry/Qt-Plus
|
||||
* AMD ADL Libraries: https://github.com/GPUOpen-LibrariesAndSDKs/display-library
|
||||
* libcmmk: https://github.com/chmod222/libcmmk
|
||||
* hueplusplus: https://github.com/enwi/hueplusplus
|
||||
* httplib: https://github.com/yhirose/cpp-httplib
|
||||
* mdns: https://github.com/mjansson/mdns
|
||||
|
|
@ -355,3 +354,6 @@ While no code from these projects directly made its way into OpenRGB, these proj
|
|||
* g810-led: https://github.com/MatMoul/g810-led
|
||||
* liquidctl: https://github.com/jonasmalacofilho/liquidctl
|
||||
* Annemone: https://github.com/manualmanul/Annemone
|
||||
* libcmmk: https://github.com/chmod222/libcmmk
|
||||
* Signal RGB Plugins: https://gitlab.com/signalrgb/signal-plugins/-/tree/master/Plugins
|
||||
* k550-macos https://github.com/vookimedlo/ck550-macos/tree/master
|
||||
|
|
|
|||
426
dependencies/libcmmk/include/libcmmk/libcmmk.h
vendored
426
dependencies/libcmmk/include/libcmmk/libcmmk.h
vendored
|
|
@ -1,426 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef LIBCMMK_H
|
||||
#define LIBCMMK_H
|
||||
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BYTE_SIZE 8
|
||||
|
||||
#define CMMK_ROWS_MAX 7
|
||||
#define CMMK_COLS_MAX 22
|
||||
|
||||
#define CMMK_FW_SIZE 16
|
||||
#define CMMK_KEYLIST_SIZE 256
|
||||
#define CMMK_BUFFER_SIZE 65
|
||||
|
||||
/*
|
||||
* If we have C99 support (which we do, because libusb-1.0 requires it...), define some handy
|
||||
* macros.
|
||||
*/
|
||||
#if __STDC_VERSION__ >= 199901L
|
||||
/* struct rgb from 0xRRGGBB */
|
||||
#define MKRGB(hex) (struct rgb){((hex) >> 16) & 0xFF, ((hex) >> 8) & 0xFF, (hex) & 0xFF }
|
||||
|
||||
/* struct rgb from single parts */
|
||||
#define MKRGBS(r, g, b) (struct rgb){ (r), (g), (b) }
|
||||
#endif
|
||||
|
||||
struct rgb {
|
||||
unsigned char R;
|
||||
unsigned char G;
|
||||
unsigned char B;
|
||||
};
|
||||
|
||||
|
||||
/* Result codes */
|
||||
enum cmmk_result {
|
||||
CMMK_OK = 0,
|
||||
CMMK_ERR, /* Non-specific error */
|
||||
CMMK_LAYOUT_DETECTION_FAILED,
|
||||
CMMK_USB_COMM, /* An error happened while trying to talk to the device */
|
||||
CMMK_INVAL, /* Invalid parameter given */
|
||||
};
|
||||
|
||||
/*
|
||||
* Physical USB product IDs for general device type detection only.
|
||||
*/
|
||||
enum cmmk_product {
|
||||
CMMK_USB_MASTERKEYS_PRO_L = 0x003b,
|
||||
CMMK_USB_MASTERKEYS_PRO_L_WHITE = 0x0047,
|
||||
CMMK_USB_MASTERKEYS_PRO_S = 0x003c,
|
||||
CMMK_USB_MASTERKEYS_MK750 = 0x0067,
|
||||
CMMK_USB_MASTERKEYS_SK630 = 0x0089,
|
||||
CMMK_USB_MASTERKEYS_SK650 = 0x008d,
|
||||
};
|
||||
|
||||
/*
|
||||
* The specific layout of a given device.
|
||||
*/
|
||||
enum cmmk_layout {
|
||||
CMMK_LAYOUT_US_S,
|
||||
CMMK_LAYOUT_US_L, /* TODO */
|
||||
CMMK_LAYOUT_US_MK750, /* TODO */
|
||||
CMMK_LAYOUT_US_SK630, /* TODO */
|
||||
CMMK_LAYOUT_US_SK650, /* TODO */
|
||||
CMMK_LAYOUT_EU_S, /* TODO */
|
||||
CMMK_LAYOUT_EU_L,
|
||||
CMMK_LAYOUT_EU_MK750,
|
||||
CMMK_LAYOUT_EU_SK630,
|
||||
CMMK_LAYOUT_EU_SK650,
|
||||
|
||||
CMMK_LAYOUT_INVAL /* end marker */
|
||||
};
|
||||
|
||||
/* Apparently can be anything in range [0x00, 0x50].
|
||||
* Over 0x50 it just stops animating */
|
||||
enum cmmk_effect_speed {
|
||||
CMMK_SPEED0 = 0x46,
|
||||
CMMK_SPEED1 = 0x41,
|
||||
CMMK_SPEED2 = 0x38,
|
||||
CMMK_SPEED3 = 0x3D,
|
||||
CMMK_SPEED4 = 0x31
|
||||
};
|
||||
|
||||
enum cmmk_wave_direction {
|
||||
CMMK_LEFT_TO_RIGHT = 0x00,
|
||||
CMMK_RIGHT_TO_LEFT = 0x04,
|
||||
CMMK_BACK_TO_FRONT = 0x02,
|
||||
CMMK_FRONT_TO_BACK = 0x06
|
||||
};
|
||||
|
||||
enum cmmk_ripple_type {
|
||||
CMMK_RIPPLE_GIVEN_COLOR, /* use the given color */
|
||||
CMMK_RIPPLE_RANDOM_COLOR = 0x80 /* use a random color */
|
||||
};
|
||||
|
||||
enum cmmk_control_mode {
|
||||
/* Firmware controls everything */
|
||||
CMMK_FIRMWARE = 0x00,
|
||||
|
||||
/* Firmware controlled effect, configured via software */
|
||||
CMMK_EFFECT = 0x01,
|
||||
|
||||
/* Manual control of everything */
|
||||
CMMK_MANUAL = 0x02,
|
||||
|
||||
/* Profile setup (may actually be a misnomer, as saving the profile works
|
||||
* in effect mode as well */
|
||||
CMMK_PROFILE_CUSTOMIZATION = 0x03
|
||||
};
|
||||
|
||||
enum cmmk_effect_id {
|
||||
CMMK_EFFECT_FULLY_LIT = 0x00,
|
||||
CMMK_EFFECT_BREATHE = 0x01,
|
||||
CMMK_EFFECT_CYCLE = 0x02,
|
||||
CMMK_EFFECT_SINGLE = 0x03,
|
||||
CMMK_EFFECT_WAVE = 0x04,
|
||||
CMMK_EFFECT_RIPPLE = 0x05,
|
||||
CMMK_EFFECT_CROSS = 0x06,
|
||||
CMMK_EFFECT_RAINDROPS = 0x07,
|
||||
CMMK_EFFECT_STARS = 0x08,
|
||||
CMMK_EFFECT_SNAKE = 0x09,
|
||||
CMMK_EFFECT_CUSTOMIZED = 0x0a,
|
||||
CMMK_EFFECT_MULTILAYER = 0xe0,
|
||||
CMMK_EFFECT_OFF = 0xfe
|
||||
};
|
||||
|
||||
/* These enums are only used for display or similar purposes.
|
||||
*
|
||||
* All the important layout information is contained in `enum cmmk_layout'. But because
|
||||
* most of the time, library users really want the model and layout information separated,
|
||||
* these two helpers abstract it away a bit. */
|
||||
enum cmmk_layout_type {
|
||||
CMMK_LAYOUT_TYPE_ANSI,
|
||||
CMMK_LAYOUT_TYPE_ISO
|
||||
};
|
||||
|
||||
enum cmmk_product_type {
|
||||
CMMK_PRODUCT_MASTERKEYS_PRO_L,
|
||||
CMMK_PRODUCT_MASTERKEYS_PRO_S,
|
||||
CMMK_PRODUCT_MASTERKEYS_MK750,
|
||||
CMMK_PRODUCT_MASTERKEYS_SK630,
|
||||
CMMK_PRODUCT_MASTERKEYS_SK650,
|
||||
};
|
||||
|
||||
/*
|
||||
* Attach to and detach from USB device
|
||||
*/
|
||||
struct cmmk {
|
||||
/* libusb_context *cxt; */
|
||||
hid_device *dev;
|
||||
|
||||
/*
|
||||
* Internal product IDs that are not all that useful outside the library.
|
||||
*/
|
||||
int product;
|
||||
int layout;
|
||||
|
||||
/*
|
||||
* Lookup map to get matrix positions for keys in constant time.
|
||||
*/
|
||||
int8_t rowmap[CMMK_KEYLIST_SIZE];
|
||||
int8_t colmap[CMMK_KEYLIST_SIZE];
|
||||
|
||||
int multilayer_mode;
|
||||
};
|
||||
|
||||
/* Helper types because passing multi dim arrays as parameter is yucky */
|
||||
struct cmmk_color_matrix {
|
||||
struct rgb data[CMMK_ROWS_MAX][CMMK_COLS_MAX];
|
||||
};
|
||||
|
||||
struct cmmk_effect_matrix {
|
||||
uint8_t data[CMMK_ROWS_MAX][CMMK_COLS_MAX]; /* values as type of enum cmmk_effect_id */
|
||||
};
|
||||
|
||||
/* Generic effect type for when type safety becomes too verbose.
|
||||
*
|
||||
* No sanity checking is done before sending this off to the firmware, so try to stay within
|
||||
* normal parameters. */
|
||||
struct cmmk_generic_effect {
|
||||
int p1;
|
||||
int p2;
|
||||
int p3;
|
||||
|
||||
struct rgb color1;
|
||||
struct rgb color2;
|
||||
};
|
||||
|
||||
struct cmmk_effect_fully_lit {
|
||||
struct rgb color;
|
||||
};
|
||||
|
||||
struct cmmk_effect_breathe {
|
||||
int speed;
|
||||
|
||||
struct rgb color;
|
||||
};
|
||||
|
||||
struct cmmk_effect_cycle {
|
||||
int speed;
|
||||
};
|
||||
|
||||
struct cmmk_effect_single {
|
||||
int speed;
|
||||
|
||||
struct rgb active;
|
||||
struct rgb rest;
|
||||
};
|
||||
|
||||
struct cmmk_effect_wave {
|
||||
int speed;
|
||||
|
||||
enum cmmk_wave_direction direction;
|
||||
|
||||
struct rgb start;
|
||||
};
|
||||
|
||||
struct cmmk_effect_ripple {
|
||||
int speed;
|
||||
|
||||
enum cmmk_ripple_type ripple_type;
|
||||
|
||||
struct rgb active;
|
||||
struct rgb rest;
|
||||
};
|
||||
|
||||
struct cmmk_effect_cross {
|
||||
int speed;
|
||||
|
||||
struct rgb active;
|
||||
struct rgb rest;
|
||||
};
|
||||
|
||||
struct cmmk_effect_raindrops {
|
||||
int speed;
|
||||
int interval;
|
||||
|
||||
struct rgb active;
|
||||
struct rgb rest;
|
||||
};
|
||||
|
||||
struct cmmk_effect_stars {
|
||||
int speed;
|
||||
int interval;
|
||||
|
||||
struct rgb active;
|
||||
struct rgb rest;
|
||||
};
|
||||
|
||||
struct cmmk_effect_snake {
|
||||
int speed;
|
||||
};
|
||||
|
||||
/* Tries to find a connected, compatible device. Returns 0 and sets *product to the
|
||||
* first device it finds */
|
||||
int cmmk_find_device(int *product);
|
||||
|
||||
/*
|
||||
* If layout = -1, try to automatically determine the layout. Otherwise, use one of the values
|
||||
* enumerated in `enum cmmk_layout'.
|
||||
*
|
||||
* Note that autodetection is based on unproven theories right now (see issue #10).
|
||||
* Your mileage may vary.
|
||||
*
|
||||
* If layout autodetection fails, 1 is returned and cmmk_detach is called implicitely.
|
||||
*/
|
||||
int cmmk_attach(struct cmmk *dev, int product, int layout);
|
||||
int cmmk_attach_path(struct cmmk *dev, char const *path, int product, int layout);
|
||||
int cmmk_detach(struct cmmk *dev);
|
||||
|
||||
/* Resets the layout to the given ID and regenerates lookup tables */
|
||||
int cmmk_force_layout(struct cmmk *dev, int layout);
|
||||
|
||||
/* fw must be up to 8 bytes to read the entire version string */
|
||||
int cmmk_get_firmware_version(struct cmmk *dev, char *fw, size_t fwsiz);
|
||||
|
||||
enum cmmk_product_type cmmk_get_device_model(struct cmmk *dev);
|
||||
enum cmmk_layout_type cmmk_get_device_layout(struct cmmk *dev);
|
||||
|
||||
const char * cmmk_product_to_str(int product);
|
||||
const char * cmmk_layout_to_str(int layout);
|
||||
|
||||
/*
|
||||
* Enter and leave direct control mode. Any control commands outside of control
|
||||
* mode are ignored. Enabling control mode while inside control mode will reset
|
||||
* active effect and allow direct control over LEDs.
|
||||
*/
|
||||
int cmmk_set_control_mode(struct cmmk *dev, int mode);
|
||||
|
||||
/* Only meaningful in profile customization mode */
|
||||
int cmmk_get_active_profile(struct cmmk *dev, int *prof);
|
||||
int cmmk_set_active_profile(struct cmmk *dev, int prof);
|
||||
|
||||
int cmmk_save_active_profile(struct cmmk *dev);
|
||||
|
||||
/* Predefined effects */
|
||||
int cmmk_get_active_effect(struct cmmk *dev, enum cmmk_effect_id *eff);
|
||||
int cmmk_set_active_effect(struct cmmk *dev, enum cmmk_effect_id eff);
|
||||
|
||||
/* Fetch the list of enabled effects. Updates "n" with the number of effects actually
|
||||
* read.
|
||||
*/
|
||||
int cmmk_get_enabled_effects(
|
||||
struct cmmk *dev,
|
||||
enum cmmk_effect_id *effs,
|
||||
size_t siz,
|
||||
size_t *n);
|
||||
|
||||
/* Sets the list of enabled effects. Buffer size is implied and should of course be
|
||||
* at least as big as n. */
|
||||
int cmmk_set_enabled_effects(
|
||||
struct cmmk *dev,
|
||||
enum cmmk_effect_id const *effs,
|
||||
size_t n);
|
||||
|
||||
/*
|
||||
* Get and set effect configurations.
|
||||
*
|
||||
* Caveeat: In customization mode, you can only change the configuration of an effect when it is
|
||||
* currently active. This does not seem to be the case in effects mode.
|
||||
*/
|
||||
int cmmk_get_effect(struct cmmk *dev, enum cmmk_effect_id id, struct cmmk_generic_effect *eff);
|
||||
int cmmk_set_effect(struct cmmk *dev, enum cmmk_effect_id id, struct cmmk_generic_effect const *eff);
|
||||
|
||||
int cmmk_get_effect_fully_lit(struct cmmk *dev, struct cmmk_effect_fully_lit *eff);
|
||||
int cmmk_set_effect_fully_lit(struct cmmk *dev, struct cmmk_effect_fully_lit const *eff);
|
||||
|
||||
int cmmk_get_effect_breathe(struct cmmk *dev, struct cmmk_effect_breathe *eff);
|
||||
int cmmk_set_effect_breathe(struct cmmk *dev, struct cmmk_effect_breathe const *eff);
|
||||
|
||||
int cmmk_get_effect_cycle(struct cmmk *dev, struct cmmk_effect_cycle *eff);
|
||||
int cmmk_set_effect_cycle(struct cmmk *dev, struct cmmk_effect_cycle const *eff);
|
||||
|
||||
int cmmk_get_effect_single(struct cmmk *dev, struct cmmk_effect_single *eff);
|
||||
int cmmk_set_effect_single(struct cmmk *dev, struct cmmk_effect_single const *eff);
|
||||
|
||||
int cmmk_get_effect_wave(struct cmmk *dev, struct cmmk_effect_wave *eff);
|
||||
int cmmk_set_effect_wave(struct cmmk *dev, struct cmmk_effect_wave const *eff);
|
||||
|
||||
int cmmk_get_effect_ripple(struct cmmk *dev, struct cmmk_effect_ripple *eff);
|
||||
int cmmk_set_effect_ripple(struct cmmk *dev, struct cmmk_effect_ripple const *eff);
|
||||
|
||||
int cmmk_get_effect_cross(struct cmmk *dev, struct cmmk_effect_cross *eff);
|
||||
int cmmk_set_effect_cross(struct cmmk *dev, struct cmmk_effect_cross const *eff);
|
||||
|
||||
int cmmk_get_effect_raindrops(struct cmmk *dev, struct cmmk_effect_raindrops *eff);
|
||||
int cmmk_set_effect_raindrops(struct cmmk *dev, struct cmmk_effect_raindrops const *eff);
|
||||
|
||||
int cmmk_get_effect_stars(struct cmmk *dev, struct cmmk_effect_stars *eff);
|
||||
int cmmk_set_effect_stars(struct cmmk *dev, struct cmmk_effect_stars const *eff);
|
||||
|
||||
int cmmk_get_effect_snake(struct cmmk *dev, struct cmmk_effect_snake *eff);
|
||||
int cmmk_set_effect_snake(struct cmmk *dev, struct cmmk_effect_snake const *eff);
|
||||
|
||||
/*
|
||||
* colmap *must* be at least 6x22. Otherwise, segmentation faults ensue.
|
||||
*
|
||||
* CAVEAT: The result will be wrong immediately after switching profiles. A few milliseconds
|
||||
* of delay need to be inserted after the switch and before the query.
|
||||
*/
|
||||
int cmmk_get_customized_leds(struct cmmk *dev, struct cmmk_color_matrix *colmap);
|
||||
int cmmk_set_customized_leds(struct cmmk *dev, struct cmmk_color_matrix const *colmap);
|
||||
|
||||
/*
|
||||
* Switch multilayer mode on (active > 0) or off (active == 0).
|
||||
*
|
||||
* Affects effect configuration getters and setters.
|
||||
*/
|
||||
int cmmk_switch_multilayer(struct cmmk *dev, int active);
|
||||
|
||||
int cmmk_get_multilayer_map(struct cmmk *dev, struct cmmk_effect_matrix *effmap);
|
||||
int cmmk_set_multilayer_map(struct cmmk *dev, struct cmmk_effect_matrix const *effmap);
|
||||
|
||||
/*
|
||||
* Set the single key `key' to the given color.
|
||||
*/
|
||||
int cmmk_set_single_key_by_id(struct cmmk *dev, int key, struct rgb const *color);
|
||||
|
||||
/*
|
||||
* Set the single key in row `row` and column `col` to the given color.
|
||||
*/
|
||||
int cmmk_set_single_key(struct cmmk *dev, int row, int col, struct rgb const *color);
|
||||
int cmmk_lookup_key_id(struct cmmk *dev, int row, int col);
|
||||
/*
|
||||
* Set the entire keyboard to the given color.
|
||||
*/
|
||||
int cmmk_set_all_single(struct cmmk *dev, struct rgb const *col);
|
||||
/*
|
||||
* Set the entire keyboard in one step from the given map.
|
||||
*
|
||||
* Keys in the map are indized by their individual mappings, so
|
||||
* colmap[K_ESC] will address the ESC key, much like
|
||||
* set_single_key(..., K_ESC, ...) will.
|
||||
*/
|
||||
int cmmk_set_leds(struct cmmk *dev, struct cmmk_color_matrix const *colmap);
|
||||
|
||||
#ifdef CMMK_DECLARE_DEBUG_FUNCTIONS
|
||||
int cmmk_send_anything(struct cmmk *dev, unsigned char *data, size_t data_siz);
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !defined(LIBCMMK_H) */
|
||||
1080
dependencies/libcmmk/src/libcmmk.c
vendored
1080
dependencies/libcmmk/src/libcmmk.c
vendored
File diff suppressed because it is too large
Load diff
25
dependencies/libcmmk/src/mappings/ansi/mk750.h
vendored
25
dependencies/libcmmk/src/mappings/ansi/mk750.h
vendored
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_ansi_mk750 = {
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
44
dependencies/libcmmk/src/mappings/ansi/pro_l.h
vendored
44
dependencies/libcmmk/src/mappings/ansi/pro_l.h
vendored
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_ansi_pro_l = {
|
||||
/*
|
||||
ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRN SCL PAU P1 P2 P3 P4 */
|
||||
{11, 22, 30, 25, 27, -1, 7, 51, 57, 62, -1, 86, 87, 83, 85, 79, 72, 0, 101, 109, 117, 119},
|
||||
|
||||
/*
|
||||
` 1 2 3 4 5 6 7 8 9 0 - = XXX BCK INS HOM PUP #LCK #/ #* #- */
|
||||
{14, 15, 23, 31, 39, 38, 46, 47, 55, 63, 71, 70, 54, -1, 81, 3, 1, 2, 100, 108, 116, 118},
|
||||
|
||||
/*
|
||||
TAB Q W E R T Y U I O P [ ] XXX \ DEL END PDN #7 #8 #9 #+ */
|
||||
{9, 8, 16, 24, 32, 33, 41, 40, 48, 56, 64, 65, 49, -1, 82, 94, 92, 88, 96, 104, 112, 110},
|
||||
|
||||
/*
|
||||
CAP A S D F G H J K L ; ' XXX XXX ENT XXX XXX XXX #4 #5 #6 XXX */
|
||||
{17, 10, 18, 26, 34, 35, 43, 42, 50, 58, 66, 67, -1, -1, 84, -1, -1, -1, 97, 105, 113, -1},
|
||||
|
||||
/*
|
||||
LSHFT XXX Z X C V B N M , . / XXX XXX RSHFT XXX UP XXX #1 #2 #3 #ENTER */
|
||||
{73, -1, 12, 20, 28, 36, 37, 45, 44, 52, 60, 69, -1, -1, 74, -1, 80, -1, 98, 106, 114, 111},
|
||||
|
||||
/*
|
||||
LCTRL LWIN LALT XXX XXX XXX SPACE XXX XXX XXX RALT RWIN FN XXX RCTRL LEFT DOWN RIGHT #0 XXX #. XXX */
|
||||
{6, 90, 75, -1, -1, -1, 91, -1, -1, -1, 77, 78, 61, -1, 4, 95, 93, 5, 107, -1, 115, -1},
|
||||
|
||||
/* Bottom row does not exist */
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
43
dependencies/libcmmk/src/mappings/ansi/pro_s.h
vendored
43
dependencies/libcmmk/src/mappings/ansi/pro_s.h
vendored
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_ansi_pro_s = {
|
||||
/*
|
||||
ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRN SCL PAU XXX XXX XXX XXX */
|
||||
{96, 97, 98, 99, 104, -1, 105, 106, 112, 113, -1, 114, 67, 68, 69, 102, 103, 107, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
` 1 2 3 4 5 6 7 8 9 0 - = XXX BCK INS HOM PUP XXX XXX XXX XXX */
|
||||
{0, 1, 8, 9, 16, 17, 24, 25, 32, 33, 40, 41, 48, -1, 49, 56, 57, 64, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
TAB Q W E R T Y U I O P [ ] XXX \ DEL END PDN XXX XXX XXX XXX */
|
||||
{2, 3, 10, 11, 18, 19, 26, 27, 34, 35, 42, 43, 50, -1, 51, 58, 59, 66, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
CAP A S D F G H J K L ; ' XXX XXX ENT XXX XXX XXX XXX XXX XXX XXX */
|
||||
{4, 5, 12, 13, 20, 21, 28, 29, 36, 37, 44, 45, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
LSHFT XXX Z X C V B N M , . / XXX XXX RSHFT XXX UP XXX XXX XXX XXX XXX */
|
||||
{6, -1, 7, 14, 15, 22, 23, 30, 31, 38, 39, 46, -1, -1, 47, -1, 61, -1, -1, -1, -1, -1}, // after / was 1 BAD
|
||||
|
||||
/*
|
||||
LCTRL LWIN LALT XXX XXX XXX SPACE XXX XXX XXX RALT RWIN FN XXX RCTRL LEFT DOWN RIGHT XXX XXX XXX XXX */
|
||||
{91, 90, 92, -1, -1, -1, 93, -1, -1, -1, 94, 60, 95, -1, 54, 63, 62, 70, -1, -1, -1, -1},
|
||||
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
44
dependencies/libcmmk/src/mappings/ansi/sk630.h
vendored
44
dependencies/libcmmk/src/mappings/ansi/sk630.h
vendored
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_ansi_sk630 = {
|
||||
/*
|
||||
ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRN SCL PAU XXX XXX XXX XXX */
|
||||
{ 9, 33, 41, 49, 57, -1, 73, 81, 89, 97, -1, 105, 113, 121, 129, 137, 145, 153, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
^ 1 2 3 4 5 6 7 8 9 0 ß ´ XXX BCK INS HOM PUP XXX XXX XXX` XXX */
|
||||
{10, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, -1, 130, 138, 146, 154, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
TAB Q W E R T Z/Y U I O P { } XXX | DEL END PGDN XXX XXX XXX XXX */
|
||||
{11, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, -1, 131, 139, 147, 155, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
CAP A S D F G H J K L ; " XXX XXX ENT XXX XXX XXX XXX XXX XXX XXX */
|
||||
{12, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, -1, -1, 132, -1, -1, -1, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
LSHFT Z X C V B N M < > ? XXX XXX XXX RSHFT XXX UP XXX XXX XXX XXX XXX */
|
||||
{13, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, -1, -1, -1, 133, -1, 149, -1, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
LCTRL LWIN LALT XXX XXX XXX SPACE XXX XXX XXX RALT RWIN FN XXX RCTRL LEFT DOWN RIGHT XXX XXX XXX XXX */
|
||||
{14, 22, 30, -1, -1, -1, 62, -1, -1, -1, 94, 102, 110, -1, 134, 142, 150, 158, -1, -1, -1, -1},
|
||||
|
||||
/* Bottom row does not exist */
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
25
dependencies/libcmmk/src/mappings/ansi/sk650.h
vendored
25
dependencies/libcmmk/src/mappings/ansi/sk650.h
vendored
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_ansi_sk650 = {
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
45
dependencies/libcmmk/src/mappings/iso/mk750.h
vendored
45
dependencies/libcmmk/src/mappings/iso/mk750.h
vendored
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_iso_mk750 = {
|
||||
/*
|
||||
ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRN SCL PAU MUT PLA REW FWD */
|
||||
{96, 97, 98, 99, 104, -1, 105, 106, 112, 113, -1, 114, 67, 68, 69, 102, 103, 107, 111, 110, 108, 109},
|
||||
|
||||
/*
|
||||
^ 1 2 3 4 5 6 7 8 9 0 ß ´ XXX BCK INS HOM PUP #LCK #/ #* #- */
|
||||
{0, 1, 8, 9, 16, 17, 24, 25, 32, 33, 40, 41, 48, -1, 49, 56, 57, 64, 72, 73, 80, 81},
|
||||
|
||||
/*
|
||||
TAB Q W E R T Z/Y U I O P Ü/[ +/] XXX ENT DEL END PDN #7 #8 #9 #+ */
|
||||
{2, 3, 10, 11, 18, 19, 26, 27, 34, 35, 42, 43, 50, -1, 52, 58, 59, 66, 74, 75, 82, 83},
|
||||
|
||||
/*
|
||||
CAP A S D F G H J K L Ö/; Ä/' #/C42 XXX XXX XXX XXX XXX #4 #5 #6 XXX */
|
||||
{4, 5, 12, 13, 20, 21, 28, 29, 36, 37, 44, 45, 119, -1, -1, -1, -1, -1, 76, 77, 84, -1},
|
||||
|
||||
/*
|
||||
LSHFT </C45 Y/Z X C V B N M , . -// XXX XXX RSHFT XXX UP XXX #1 #2 #3 #ENTER */
|
||||
{6, 118, 7, 14, 15, 22, 23, 30, 31, 38, 39, 46, -1, -1, 47, -1, 61, -1, 78, 79, 86, 85},
|
||||
|
||||
/*
|
||||
LCTRL LWIN LALT XXX XXX XXX SPACE XXX XXX XXX RALT RWIN FN XXX RCTRL LEFT DOWN RIGHT #0 XXX #, XXX */
|
||||
{91, 90, 92, -1, -1, -1, 93, -1, -1, -1, 53, 95, 60, -1, 54, 63, 62, 70, 71, -1, 87, -1},
|
||||
|
||||
/*
|
||||
XXX LED1 LED2 LED3 LED4 XXX LED6 LED7 LED8 LED9 LED10 LED11 LED12 LED13 LED14 LED15 XXX LED17 LED18 LED19 LED20 XXX */
|
||||
{-1, 128, 140, 126, 141, -1, 142, 125, 143, 151, 124, 123, 122, 150, 121, 120, -1, 137, 135, 136, 138, -1}
|
||||
};
|
||||
44
dependencies/libcmmk/src/mappings/iso/pro_l.h
vendored
44
dependencies/libcmmk/src/mappings/iso/pro_l.h
vendored
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_iso_pro_l = {
|
||||
/*
|
||||
ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRN SCL PAU P1 P2 P3 P4 */
|
||||
{11, 22, 30, 25, 27, -1, 7, 51, 57, 62, -1, 86, 87, 83, 85, 79, 72, 0, 101, 109, 117, 119},
|
||||
|
||||
/*
|
||||
^ 1 2 3 4 5 6 7 8 9 0 ß ´ XXX BCK INS HOM PUP #LCK #/ #* #- */
|
||||
{14, 15, 23, 31, 39, 38, 46, 47, 55, 63, 71, 70, 54, -1, 81, 3, 1, 2, 100, 108, 116, 118},
|
||||
|
||||
/*
|
||||
TAB Q W E R T Z/Y U I O P Ü/[ +/] XXX ENT DEL END PDN #7 #8 #9 #+ */
|
||||
{9, 8, 16, 24, 32, 33, 41, 40, 48, 56, 64, 65, 49, -1, 84, 94, 92, 88, 96, 104, 112, 110},
|
||||
|
||||
/*
|
||||
CAP A S D F G H J K L Ö/; Ä/' #/C42 XXX XXX XXX XXX XXX #4 #5 #6 XXX */
|
||||
{17, 10, 18, 26, 34, 35, 43, 42, 50, 58, 66, 67, 68, -1, -1, -1, -1, -1, 97, 105, 113, -1},
|
||||
|
||||
/*
|
||||
LSHFT </C45 Y/Z X C V B N M , . -// XXX XXX RSHFT XXX UP XXX #1 #2 #3 #ENTER */
|
||||
{73, 19, 12, 20, 28, 36, 37, 45, 44, 52, 60, 69, -1, -1, 74, -1, 80, -1, 98, 106, 114, 111},
|
||||
|
||||
/*
|
||||
LCTRL LWIN LALT XXX XXX XXX SPACE XXX XXX XXX RALT RWIN FN XXX RCTRL LEFT DOWN RIGHT #0 XXX #, XXX */
|
||||
{6, 90, 75, -1, -1, -1, 91, -1, -1, -1, 77, 78, 61, -1, 4, 95, 93, 5, 107, -1, 115, -1},
|
||||
|
||||
/* Bottom row does not exist */
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
37
dependencies/libcmmk/src/mappings/iso/pro_s.h
vendored
37
dependencies/libcmmk/src/mappings/iso/pro_s.h
vendored
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_iso_pro_s = {
|
||||
/* ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRN SCRLK PAUSE XXX XXX XXX XXX */
|
||||
{ 96, 97, 98, 99, 104, -1, 105, 106, 112, 113, -1, 114, 67, 68, 69, 102, 103, 107, -1, -1, -1, -1},
|
||||
|
||||
/* ` 1 2 3 4 5 6 7 8 9 0 - +/ˆ XXX BKSPC INSRT HOME PGUP NUMLK #/ #* #- */
|
||||
{ 0, 1, 8, 9, 16, 17, 24, 25, 32, 33, 40, 41, 48, -1, 49, 56, 57, 64, -1, -1, -1, -1},
|
||||
|
||||
/* TAB Q W E R T Y U I O P [ ]/¨ XXX ENTER DELTE END PGDN #7 #8 #9 #+ */
|
||||
{ 2, 3, 10, 11, 18, 19, 26, 27, 34, 35, 42, 43, 50, -1, 52, 58, 59, 66, -1, -1, -1, -1},
|
||||
|
||||
/* CAPLK A S D F G H J K L ; ' \ XXX XXX XXX XXX XXX #4 #5 #6 XXX */
|
||||
{ 4, 5, 12, 13, 20, 21, 28, 29, 36, 37, 44, 45, 89, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
|
||||
/* LSHFT < Z X C V B N M , . / XXX XXX RSHFT XXX UP XXX #1 #2 #3 #ENTR */
|
||||
{ 6, 100, 7, 14, 15, 22, 23, 30, 31, 38, 39, 46, -1, -1, 47, -1, 61, -1, -1, -1, -1, -1},
|
||||
|
||||
/* LCTRL LWIN LALT XXX XXX XXX SPACE XXX XXX XXX RALT RWIN FNC XXX RCTRL LEFT DOWN RIGHT #0 XXX #. XXX */
|
||||
{ 91, 90, 92, -1, -1, -1, 93, -1, -1, -1, 94, 95, 60, -1, 54, 63, 62, 70, -1, -1, -1, -1},
|
||||
|
||||
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
44
dependencies/libcmmk/src/mappings/iso/sk630.h
vendored
44
dependencies/libcmmk/src/mappings/iso/sk630.h
vendored
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_iso_sk630 = {
|
||||
/*
|
||||
ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRN SCL PAU MUT PLA REW FWD */
|
||||
{ 9, 33, 41, 49, 57, -1, 73, 81, 89, 97, -1, 105, 113, 121, 129, 137, 145, 153, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
^ 1 2 3 4 5 6 7 8 9 0 ß ´ XXX BCK INS HOM PUP #LCK #/ #* #- */
|
||||
{10, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, -1, 130, 138, 146, 154, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
TAB Q W E R T Z/Y U I O P Ü/[ +/] XXX ENT DEL END PDN #7 #8 #9 #+ */
|
||||
{11, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, -1, 132, 139, 147, 155, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
CAP A S D F G H J K L Ö/; Ä/' #/C42 XXX XXX XXX XXX XXX #4 #5 #6 XXX */
|
||||
{12, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
LSHFT </C45 Y/Z X C V B N M , . -// XXX XXX RSHFT XXX UP XXX #1 #2 #3 #ENTER */
|
||||
{13, 21, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, -1, -1, 133, -1, 149, -1, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
LCTRL LWIN LALT XXX XXX XXX SPACE XXX XXX XXX RALT RWIN FN XXX RCTRL LEFT DOWN RIGHT #0 XXX #, XXX */
|
||||
{14, 22, 30, -1, -1, -1, 62, -1, -1, -1, 94, 102, 110, -1, 134, 142, 150, 158, -1, -1, -1, -1},
|
||||
|
||||
/* Bottom row does not exist */
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
44
dependencies/libcmmk/src/mappings/iso/sk650.h
vendored
44
dependencies/libcmmk/src/mappings/iso/sk650.h
vendored
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* This file is part of libcmmk.
|
||||
*
|
||||
* libcmmk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* libcmmk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with libcmmk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
static keyboard_layout layout_iso_sk650 = {
|
||||
/*
|
||||
ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRN SCL PAU MUT PLA REW FWD */
|
||||
{ 9, 33, 41, 49, 57, -1, 73, 81, 89, 97, -1, 105, 113, 121, 129, 137, 145, 153, -1, -1, -1, -1},
|
||||
|
||||
/*
|
||||
^ 1 2 3 4 5 6 7 8 9 0 ß ´ XXX BCK INS HOM PUP #LCK #/ #* #- */
|
||||
{10, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, -1, 130, 138, 146, 154, 162, 170, 178, 186},
|
||||
|
||||
/*
|
||||
TAB Q W E R T Z/Y U I O P Ü/[ +/] XXX ENT DEL END PDN #7 #8 #9 #+ */
|
||||
{11, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, -1, 132, 139, 147, 155, 163, 171, 179, 187},
|
||||
|
||||
/*
|
||||
CAP A S D F G H J K L Ö/; Ä/' #/C42 XXX XXX XXX XXX XXX #4 #5 #6 XXX */
|
||||
{12, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 124, -1, -1, -1, -1, -1, 164, 172, 180, -1},
|
||||
|
||||
/*
|
||||
LSHFT </C45 Y/Z X C V B N M , . -// XXX XXX RSHFT XXX UP XXX #1 #2 #3 #ENTER */
|
||||
{13, 21, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, -1, -1, 133, -1, 149, -1, 165, 173, 181, 189},
|
||||
|
||||
/*
|
||||
LCTRL LWIN LALT XXX XXX XXX SPACE XXX XXX XXX RALT RWIN FN XXX RCTRL LEFT DOWN RIGHT #0 XXX #, XXX */
|
||||
{14, 22, 30, -1, -1, -1, 62, -1, -1, -1, 94, 102, 110, -1, 134, 142, 150, 158, 174, -1, 182, -1},
|
||||
|
||||
/* Bottom row does not exist */
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue