2014-09-09 10:16:02 +05:30
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 11:08:14 +05:30
|
|
|
// Licensed under GPLv2 or any later version
|
2014-09-04 06:42:58 +05:30
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "key_map.h"
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace KeyMap {
|
|
|
|
|
2015-01-19 04:37:48 +05:30
|
|
|
static std::map<HostDeviceKey, Service::HID::PadState> key_map;
|
2014-09-09 10:16:02 +05:30
|
|
|
static int next_device_id = 0;
|
|
|
|
|
|
|
|
int NewDeviceId() {
|
|
|
|
return next_device_id++;
|
|
|
|
}
|
2014-09-04 06:42:58 +05:30
|
|
|
|
2015-01-19 04:37:48 +05:30
|
|
|
void SetKeyMapping(HostDeviceKey key, Service::HID::PadState padState) {
|
2014-09-09 10:16:02 +05:30
|
|
|
key_map[key].hex = padState.hex;
|
2014-09-04 06:42:58 +05:30
|
|
|
}
|
|
|
|
|
2015-01-19 04:37:48 +05:30
|
|
|
Service::HID::PadState GetPadKey(HostDeviceKey key) {
|
2014-09-09 10:16:02 +05:30
|
|
|
return key_map[key];
|
2014-09-04 06:42:58 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|