This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
2014-09-09 04:46:02 +00:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 05:38:14 +00:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-09-04 01:12:58 +00:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "key_map.h"
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace KeyMap {
|
|
|
|
|
2015-01-18 23:07:48 +00:00
|
|
|
static std::map<HostDeviceKey, Service::HID::PadState> key_map;
|
2014-09-09 04:46:02 +00:00
|
|
|
static int next_device_id = 0;
|
|
|
|
|
|
|
|
int NewDeviceId() {
|
|
|
|
return next_device_id++;
|
|
|
|
}
|
2014-09-04 01:12:58 +00:00
|
|
|
|
2015-01-18 23:07:48 +00:00
|
|
|
void SetKeyMapping(HostDeviceKey key, Service::HID::PadState padState) {
|
2014-09-09 04:46:02 +00:00
|
|
|
key_map[key].hex = padState.hex;
|
2014-09-04 01:12:58 +00:00
|
|
|
}
|
|
|
|
|
2015-01-18 23:07:48 +00:00
|
|
|
Service::HID::PadState GetPadKey(HostDeviceKey key) {
|
2014-09-09 04:46:02 +00:00
|
|
|
return key_map[key];
|
2014-09-04 01:12:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|