2021-12-21 06:02:17 +01:00
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "mercuryio/config.h"
|
|
|
|
|
2022-01-08 08:25:42 +01:00
|
|
|
static const int mercury_io_default_cells[] = {
|
|
|
|
'1','1','1','2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','7','7','8','8','8','9','9','9','0','0','0',
|
|
|
|
'1','1','1','2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','7','7','8','8','8','9','9','9','0','0','0',
|
|
|
|
'Q','Q','Q','W','W','W','E','E','E','R','R','R','T','T','T','Y','Y','Y','U','U','U','I','I','I','O','O','O','P','P','P',
|
|
|
|
'Q','Q','Q','W','W','W','E','E','E','R','R','R','T','T','T','Y','Y','Y','U','U','U','I','I','I','O','O','O','P','P','P',
|
2022-01-11 01:36:11 +01:00
|
|
|
'A','A','A','S','S','S','D','D','D','F','F','F','G','G','G','H','H','H','J','J','J','K','K','K','L','L','L',VK_OEM_1,VK_OEM_1,VK_OEM_1,
|
|
|
|
'A','A','A','S','S','S','D','D','D','F','F','F','G','G','G','H','H','H','J','J','J','K','K','K','L','L','L',VK_OEM_1,VK_OEM_1,VK_OEM_1,
|
|
|
|
'Z','Z','Z','X','X','X','C','C','C','V','V','V','B','B','B','N','N','N','M','M','M',VK_OEM_COMMA,VK_OEM_COMMA,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_PERIOD,VK_OEM_PERIOD,VK_OEM_2,VK_OEM_2,VK_OEM_2,
|
|
|
|
'Z','Z','Z','X','X','X','C','C','C','V','V','V','B','B','B','N','N','N','M','M','M',VK_OEM_COMMA,VK_OEM_COMMA,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_PERIOD,VK_OEM_PERIOD,VK_OEM_2,VK_OEM_2,VK_OEM_2,
|
2022-01-08 08:25:42 +01:00
|
|
|
};
|
|
|
|
|
2021-12-21 06:02:17 +01:00
|
|
|
void mercury_io_config_load(
|
|
|
|
struct mercury_io_config *cfg,
|
|
|
|
const wchar_t *filename)
|
|
|
|
{
|
2022-01-08 08:25:42 +01:00
|
|
|
wchar_t key[240];
|
|
|
|
int i;
|
|
|
|
|
2021-12-21 06:02:17 +01:00
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(filename != NULL);
|
|
|
|
|
2022-01-08 08:25:42 +01:00
|
|
|
cfg->vk_test = GetPrivateProfileIntW(L"io4", L"test", 0x2D, filename);
|
|
|
|
cfg->vk_service = GetPrivateProfileIntW(L"io4", L"service", 0x2E, filename);
|
2022-01-16 05:18:52 +01:00
|
|
|
cfg->vk_vol_up = GetPrivateProfileIntW(L"io4", L"volup", 0x26, filename);
|
|
|
|
cfg->vk_vol_down = GetPrivateProfileIntW(L"io4", L"voldown", 0x28, filename);
|
2022-01-08 08:25:42 +01:00
|
|
|
|
|
|
|
for (i = 0 ; i < 240 ; i++) {
|
|
|
|
swprintf_s(key, _countof(key), L"cell%i", i + 1);
|
|
|
|
cfg->vk_cell[i] = GetPrivateProfileIntW(
|
|
|
|
L"touch",
|
|
|
|
key,
|
|
|
|
mercury_io_default_cells[i],
|
|
|
|
filename);
|
|
|
|
}
|
2021-12-21 06:02:17 +01:00
|
|
|
}
|