Sync KeyMap to native changes

This commit is contained in:
Daniel Dressler 2013-06-24 21:34:14 -07:00
parent 83a5609f22
commit 29271f67d7
4 changed files with 19 additions and 7 deletions

View file

@ -599,7 +599,9 @@ add_library(native STATIC
native/image/zim_save.h
native/input/gesture_detector.cpp
native/input/gesture_detector.h
native/input/keycodes.h
native/input/input_state.h
native/input/input_state.cpp
native/json/json_writer.cpp
native/json/json_writer.h
native/math/curves.cpp

View file

@ -18,7 +18,6 @@
#include "input/input_state.h"
#include "Core/Config.h"
#include "KeyMap.h"
#include "input/keyboard_keys.h"
using namespace KeyMap;

View file

@ -19,7 +19,8 @@
#include <string>
#include <map>
#include "input/keyboard_keys.h"
#include "input/keycodes.h" // keyboard keys
#include "Core/HLE/sceCtrl.h" // psp keys
#define KEYMAP_ERROR_KEY_ALREADY_USED -1
#define KEYMAP_ERROR_UNKNOWN_KEY 0
@ -45,7 +46,7 @@ namespace KeyMap {
// These functions are not
// fast, do not call them
// a million times.
std::string GetKeyName(kb_key_t);
std::string GetKeyName(int);
std::string GetPspButtonName(int);
// Use if to translate
@ -58,14 +59,14 @@ namespace KeyMap {
//
// Returns KEYMAP_ERROR_UNKNOWN_KEY
// for any unmapped key
int KeyToPspButton(kb_key_t);
int KeyToPspButton(int);
bool IsMappedKey(kb_key_t);
bool IsMappedKey(int);
// Might be usful if you want
// to provide hints to users
// upon mapping conflicts
std::string NamePspButtonFromKey(kb_key_t);
std::string NamePspButtonFromKey(int);
// Use for showing the existing
// key mapping.
@ -78,7 +79,7 @@ namespace KeyMap {
//
// Returns KEYMAP_ERROR_KEY_ALREADY_USED
// for mapping conflicts. 0 otherwise.
int SetKeyMapping(kb_key_t, int);
int SetKeyMapping(int kb_key, int psp_key);
// Platform specific keymaps
// override KeyMap's defaults.

View file

@ -190,6 +190,7 @@ void EmuScreen::update(InputState &input) {
}
#endif
/*
// Then translate pad input into PSP pad input. Also, add in tilt.
static const int mapping[12][2] = {
{PAD_BUTTON_A, CTRL_CROSS},
@ -214,6 +215,15 @@ void EmuScreen::update(InputState &input) {
__CtrlButtonUp(mapping[i][1]);
}
}
*/
// TODO: remove the above dead code
for (int i = 0; i < MAX_KEYQUEUESIZE; i++) {
int key = input.key_queue[i];
if (key != 0) {
// TODO: find proper Ctrl* internal function
}
}
float stick_x = input.pad_lstick_x;
float stick_y = input.pad_lstick_y;