Add support for `Aula F99` and `Aula F75`
parent
946383b502
commit
05b4f00629
@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_SinowealthKeyboard10c.h |
|
||||
| |
|
||||
| RGBController for Sinowealth Keyboards with PID 010C |
|
||||
| |
|
||||
| Rodrigo Tavares 27 Nov 2025 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "SinowealthKeyboard10cController.h"
|
||||
|
||||
class RGBController_SinowealthKeyboard10c : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_SinowealthKeyboard10c(SinowealthKeyboard10cController* controller_ptr, unsigned char model_id);
|
||||
~RGBController_SinowealthKeyboard10c();
|
||||
|
||||
void SetupZones();
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
void KeepaliveThreadFunction();
|
||||
|
||||
std::chrono::time_point<std::chrono::steady_clock> last_update_time;
|
||||
unsigned char model_id;
|
||||
SinowealthKeyboard10cController* controller;
|
||||
std::atomic<bool> keepalive_thread_run;
|
||||
std::thread* keepalive_thread;
|
||||
};
|
||||
@ -0,0 +1,84 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| SinowealthKeyboard10cController.cpp |
|
||||
| |
|
||||
| Driver for Sinowealth Keyboards with PID 010C |
|
||||
| |
|
||||
| Rodrigo Tavares 27 Nov 2025 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "SinowealthKeyboard10cController.h"
|
||||
#include "RGBController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
using namespace kbd10c;
|
||||
|
||||
SinowealthKeyboard10cController::SinowealthKeyboard10cController(hid_device* dev_handle, char* path,
|
||||
std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
name = dev_name;
|
||||
|
||||
current_mode = MODE_DIRECT;
|
||||
|
||||
location = path;
|
||||
}
|
||||
|
||||
SinowealthKeyboard10cController::~SinowealthKeyboard10cController()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
std::string SinowealthKeyboard10cController::GetLocation()
|
||||
{
|
||||
return ("HID: " + location);
|
||||
}
|
||||
|
||||
std::string SinowealthKeyboard10cController::GetName()
|
||||
{
|
||||
return (name);
|
||||
}
|
||||
|
||||
unsigned char SinowealthKeyboard10cController::GetCurrentMode()
|
||||
{
|
||||
return current_mode;
|
||||
}
|
||||
|
||||
std::string SinowealthKeyboard10cController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if(ret != 0)
|
||||
{
|
||||
return ("");
|
||||
}
|
||||
|
||||
return (StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
void SinowealthKeyboard10cController::SetLEDsDirect(std::vector<RGBColor> colors)
|
||||
{
|
||||
const int buffer_size = 520;
|
||||
unsigned char buf[buffer_size];
|
||||
memset(buf, 0x00, buffer_size);
|
||||
|
||||
buf[0x00] = 0x06;
|
||||
buf[0x01] = 0x08;
|
||||
buf[0x04] = 0x01;
|
||||
buf[0x06] = 0x7A;
|
||||
buf[0x07] = 0x01;
|
||||
|
||||
for(size_t i = 0; i < colors.size(); ++i)
|
||||
{
|
||||
buf[0x08 + i * 3] = RGBGetRValue(colors[i]);
|
||||
buf[0x08 + i * 3 + 1] = RGBGetGValue(colors[i]);
|
||||
buf[0x08 + i * 3 + 2] = RGBGetBValue(colors[i]);
|
||||
}
|
||||
|
||||
hid_send_feature_report(dev, buf, buffer_size);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| SinowealthKeyboard10cController.h |
|
||||
| |
|
||||
| Driver for Sinowealth Keyboards with PID 010C |
|
||||
| |
|
||||
| Rodrigo Tavares 27 Nov 2025 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
#include <vector>
|
||||
#include <hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace kbd10c
|
||||
{
|
||||
enum
|
||||
{
|
||||
MODE_OFF = 0x0,
|
||||
MODE_DIRECT = 0x1,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
class SinowealthKeyboard10cController
|
||||
{
|
||||
public:
|
||||
SinowealthKeyboard10cController(hid_device* dev_handle, char *_path, std::string dev_name);
|
||||
~SinowealthKeyboard10cController();
|
||||
|
||||
unsigned int GetLEDCount();
|
||||
std::string GetLocation();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
unsigned char GetCurrentMode();
|
||||
void SetLEDsDirect(std::vector<RGBColor> colors);
|
||||
private:
|
||||
hid_device* dev;
|
||||
device_type type;
|
||||
unsigned char current_mode;
|
||||
std::string location;
|
||||
std::string name;
|
||||
};
|
||||
@ -0,0 +1,130 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| SinowealthKeyboard10cDevices.cpp |
|
||||
| |
|
||||
| Device list for Sinowealth Keyboards with PID 010C |
|
||||
| |
|
||||
| Rodrigo Tavares 27 Nov 2025 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "SinowealthKeyboard10cDevices.h"
|
||||
#include "KeyboardLayoutManager.h"
|
||||
#include "RGBControllerKeyNames.h"
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| KEYMAPS |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
const keyboard_keymap_overlay_values aula_f99_layout
|
||||
{
|
||||
KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 NULL NULL NULL DEL HOME END PGUP PGDN */
|
||||
0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 0, 0, 0,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BSPC NULL NULL NULL NMLK NMDV NMTM NMMI */
|
||||
1, 7, 13, 19, 25, 31, 37, 43, 49, 55, 61, 67, 73, 79, 0, 0, 0, 91, 97, 103, 109,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ NULL NULL NULL NM7 NM8 NM9 NMPL */
|
||||
2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74, 80, 0, 0, 0, 92, 98, 104, 110,
|
||||
/* CPLK A S D F G H J K L ; " # ENTR NM4 NM5 NM6 */
|
||||
3, 9, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 0, 81, 93, 99, 105,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
4, 0, 10, 16, 22, 28, 34, 40, 46, 52, 58, 64, 82, 88, 94, 100, 106, 112,
|
||||
/* LCTL LWIN LALT SPC RALT RFNC RMNU RCTL ARWL ARWD ARWR NM0 NMPD */
|
||||
5, 11, 17, 35, 53, 59, 0, 65, 83, 89, 95, 101, 107,
|
||||
},
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, Alternate Name, OpCode, |
|
||||
\*--------------------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 14, 78, KEY_EN_DELETE, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Replace Print w/ Delete
|
||||
{ 0, 0, 15, 90, KEY_EN_HOME, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Replace ScrLk w/ Home
|
||||
{ 0, 0, 16, 96, KEY_EN_END, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Replace Pause w/ End
|
||||
{ 0, 0, 17, 102, KEY_EN_PAGE_UP, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert PgUp
|
||||
{ 0, 0, 18, 108, KEY_EN_PAGE_DOWN, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert PgDn
|
||||
|
||||
{ 0, 1, 14, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Remove Insert
|
||||
{ 0, 1, 15, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove Home
|
||||
{ 0, 1, 15, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove PgUp
|
||||
|
||||
{ 0, 2, 1, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Padding after Tab
|
||||
{ 0, 2, 15, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove Delete
|
||||
{ 0, 2, 15, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove End
|
||||
{ 0, 2, 15, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove PgDn
|
||||
|
||||
{ 0, 3, 1, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Padding after CapsLk
|
||||
{ 0, 3, 13, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove extra key
|
||||
{ 0, 3, 14, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove padding
|
||||
{ 0, 3, 14, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove padding
|
||||
{ 0, 4, 12, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove extra key
|
||||
{ 0, 4, 15, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove padding
|
||||
{ 0, 5, 12, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove Menu
|
||||
{ 0, 5, 16, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove padding
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const keyboard_keymap_overlay_values aula_f75_layout
|
||||
{
|
||||
KEYBOARD_SIZE_SEVENTY_FIVE,
|
||||
{
|
||||
{
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 */
|
||||
0, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BSPC DEL */
|
||||
1, 7, 13, 19, 25, 31, 37, 43, 49, 55, 61, 67, 73, 79,
|
||||
/* TAB Q W E R T Y U I O P [ ] \ PGUP */
|
||||
2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68, 74, 80,
|
||||
/* CPLK A S D F G H J K L ; " # ENTR PGDN */
|
||||
3, 9, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 0, 81,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU END */
|
||||
4, 0, 10, 16, 22, 28, 34, 40, 46, 52, 58, 64, 70,
|
||||
/* LCTL LWIN LALT SPC RALT RFNC RMNU RCTL ARWL ARWD ARWR */
|
||||
5, 11, 17, 35, 0, 53, 0, 59,
|
||||
},
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, Alternate Name, OpCode, |
|
||||
\*--------------------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 0, 0, KEY_EN_ESCAPE, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Insert ESC
|
||||
{ 0, 1, 14, 85, KEY_EN_DELETE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Delete
|
||||
{ 0, 2, 14, 86, KEY_EN_PAGE_UP, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert PgUp
|
||||
{ 0, 3, 14, 87, KEY_EN_PAGE_DOWN, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert PgDn
|
||||
|
||||
{ 0, 4, 12, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove RShift gap
|
||||
{ 0, 4, 13, 82, KEY_EN_UP_ARROW, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert UpArrow
|
||||
{ 0, 4, 14, 88, KEY_EN_END, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert End
|
||||
|
||||
{ 0, 5, 10, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove RAlt
|
||||
{ 0, 5, 11, 0, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_REMOVE_SHIFT_LEFT, }, // Remove RMenu
|
||||
|
||||
{ 0, 5, 12, 77, KEY_EN_LEFT_ARROW, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert LeftArrow
|
||||
{ 0, 5, 12, 83, KEY_EN_DOWN_ARROW, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert DownArrow
|
||||
{ 0, 5, 12, 89, KEY_EN_RIGHT_ARROW, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert RightArrow
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| DEVICE MODEL MAPPING |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
const sinowealth_device_map sinowealth_10c_keyboards{
|
||||
{
|
||||
0xCD, { "AULA F75", aula_f75_layout },
|
||||
},
|
||||
{
|
||||
0xA4, { "AULA F99", aula_f99_layout },
|
||||
},
|
||||
};
|
||||
@ -0,0 +1,29 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| SinowealthKeyboard10cDevices.cpp |
|
||||
| |
|
||||
| Device list for Sinowealth Keyboards with PID 010C |
|
||||
| |
|
||||
| Rodrigo Tavares 27 Nov 2025 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <utility>
|
||||
|
||||
#include "KeyboardLayoutManager.h"
|
||||
|
||||
typedef std::pair<const char*, unsigned char> led_pair;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
std::string device_name;
|
||||
keyboard_keymap_overlay_values keyboard_layout;
|
||||
} sinowealth_device;
|
||||
|
||||
typedef std::map<unsigned char, sinowealth_device> sinowealth_device_map;
|
||||
|
||||
extern const sinowealth_device_map sinowealth_10c_keyboards;
|
||||
Loading…
Reference in New Issue