Removed duplicate GetKeyboardMappingLayoutType(int) declaration

* Refactored ValkyrieKeyboardController to fix pipeline
This commit is contained in:
Chris M 2024-02-02 07:54:59 +11:00
parent 249aa81423
commit e4fa1013f5
4 changed files with 16 additions and 23 deletions

View file

@ -1,19 +1,7 @@
#include "Detector.h"
#include "ValkyrieKeyboardController.h"
#include <hidapi/hidapi.h>
#include "Detector.h"
#include "RGBController.h"
#include "RGBController_ValkyrieKeyboard.h"
#include <hidapi/hidapi.h>
ValkyrieKeyboardMappingLayoutType GetKeyboardMappingLayoutType(int interface)
{
switch(interface)
{
case 3:
return PRO_LAYOUT;
default:
return NORMAL_LAYOUT;
}
}
void DetectValkyrieKeyboardControllers(hid_device_info* info, const std::string& name)
{
@ -21,10 +9,9 @@ void DetectValkyrieKeyboardControllers(hid_device_info* info, const std::string&
if(dev)
{
ValkyrieKeyboardController* controller = new ValkyrieKeyboardController(dev, info->path, info->product_id, info->interface_number);
ValkyrieKeyboardMappingLayoutType layout = GetKeyboardMappingLayoutType(info->interface_number);
RGBController_ValkyrieKeyboard* rgb_controller = new RGBController_ValkyrieKeyboard(controller, layout);
rgb_controller->name = name;
ValkyrieKeyboardController* controller = new ValkyrieKeyboardController(dev, info->path, info->product_id, info->interface_number);
RGBController_ValkyrieKeyboard* rgb_controller = new RGBController_ValkyrieKeyboard(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}