summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_PadSimple/Src/DirectInputBase.cpp
diff options
context:
space:
mode:
authorXTra.KrazzY <XTra.KrazzY@gmail.com>2008-09-25 07:02:10 +0000
committerXTra.KrazzY <XTra.KrazzY@gmail.com>2008-09-25 07:02:10 +0000
commit60b01ac424a4ed171180cbcd387906d6dd280cc7 (patch)
treec212d93770f1179325179ce7eb122ad9ffe7cc6f /Source/Plugins/Plugin_PadSimple/Src/DirectInputBase.cpp
parent5290027d58d4fc3d5fe5326e0dce49cb9ce70110 (diff)
Further PadSimple config window work. Now gets initial characters from configuration in both windows and other systems.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@681 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_PadSimple/Src/DirectInputBase.cpp')
-rw-r--r--Source/Plugins/Plugin_PadSimple/Src/DirectInputBase.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/Plugins/Plugin_PadSimple/Src/DirectInputBase.cpp b/Source/Plugins/Plugin_PadSimple/Src/DirectInputBase.cpp
index 57b4c5fb3c..734c3b31d7 100644
--- a/Source/Plugins/Plugin_PadSimple/Src/DirectInputBase.cpp
+++ b/Source/Plugins/Plugin_PadSimple/Src/DirectInputBase.cpp
@@ -29,6 +29,34 @@ DInput::~DInput()
Free();
}
+void DInput::DIKToString(unsigned int keycode, char *keyStr) {
+ HKL layout = GetKeyboardLayout(0);
+ BYTE kbstate[256];
+
+ switch(keycode) {
+ case DIK_RETURN:
+ sprintf(keyStr, "ENTER");
+ break;
+ case DIK_UP:
+ sprintf(keyStr, "UP");
+ break;
+ case DIK_DOWN:
+ sprintf(keyStr, "DOWN");
+ break;
+ case DIK_LEFT:
+ sprintf(keyStr, "LEFT");
+ break;
+ case DIK_RIGHT:
+ sprintf(keyStr, "RIGHT");
+ break;
+ default:
+ GetKeyboardState(kbstate);
+ UINT vk = MapVirtualKeyEx(keycode, 1, layout);
+ ToAsciiEx(vk, keycode, kbstate, (LPWORD)keyStr, 0, layout);
+
+ keyStr[0] = toupper(keyStr[0]);
+ }
+}
HRESULT DInput::Init(HWND hWnd)
{