dolphin/Source/Core/Core/HW/GCKeyboard.cpp
aldelaro5 7e99d03b7f Add the ability to get partial input group
For hotkeys, changed HotkeyManager to allow to get and make partial groups of hotkeys.

Also preserved the old configuration naming scheme for the ini, this is done to preserve compatibility with the older groups structure.

Add the ability to get GCPad control groups

Used like the HotkeyManager methods, this is used for the new GCPad configuration dialog.

Add the ability to get groups of Keyboard input

Same reasons as the previous ones.

Add ability to get groups of Wiimote input

Add the ability to get extensions group

This needed to pass to 3 classes.  Will be used for their respective dialogs.
2016-11-25 02:37:22 -05:00

57 lines
1.2 KiB
C++

// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <cstring>
#include "Common/Common.h"
#include "Common/CommonTypes.h"
#include "Core/HW/GCKeyboard.h"
#include "Core/HW/GCKeyboardEmu.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/InputConfig.h"
#include "InputCommon/KeyboardStatus.h"
namespace Keyboard
{
static InputConfig s_config("GCKeyNew", _trans("Keyboard"), "GCKey");
InputConfig* GetConfig()
{
return &s_config;
}
void Shutdown()
{
s_config.ClearControllers();
}
void Initialize()
{
if (s_config.ControllersNeedToBeCreated())
{
for (unsigned int i = 0; i < 4; ++i)
s_config.CreateController<GCKeyboard>(i);
}
g_controller_interface.RegisterHotplugCallback(LoadConfig);
// Load the saved controller config
s_config.LoadConfig(true);
}
void LoadConfig()
{
s_config.LoadConfig(true);
}
ControllerEmu::ControlGroup* GetGroup(int port, KeyboardGroup group)
{
return static_cast<GCKeyboard*>(s_config.GetController(port))->GetGroup(group);
}
KeyboardStatus GetStatus(int port)
{
return static_cast<GCKeyboard*>(s_config.GetController(port))->GetInput();
}
}