2014-09-09 00:46:02 -04:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-09-03 21:12:58 -04:00
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "key_map.h"
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace KeyMap {
|
|
|
|
|
2014-09-09 00:46:02 -04:00
|
|
|
static std::map<HostDeviceKey, HID_User::PadState> key_map;
|
|
|
|
static int next_device_id = 0;
|
|
|
|
|
|
|
|
int NewDeviceId() {
|
|
|
|
return next_device_id++;
|
|
|
|
}
|
2014-09-03 21:12:58 -04:00
|
|
|
|
2014-09-09 00:46:02 -04:00
|
|
|
void SetKeyMapping(HostDeviceKey key, HID_User::PadState padState) {
|
|
|
|
key_map[key].hex = padState.hex;
|
2014-09-03 21:12:58 -04:00
|
|
|
}
|
|
|
|
|
2014-09-09 00:46:02 -04:00
|
|
|
HID_User::PadState GetPadKey(HostDeviceKey key) {
|
|
|
|
return key_map[key];
|
2014-09-03 21:12:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|