more event handler/pad events work
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1728 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f419223908
commit
bd3f468c37
|
@ -230,8 +230,6 @@ void EventHandler::SFKeyToString(unsigned int keycode, char *keyStr) {
|
||||||
case sf::Key::F14: sprintf(keyStr, "F14"); break;
|
case sf::Key::F14: sprintf(keyStr, "F14"); break;
|
||||||
case sf::Key::F15: sprintf(keyStr, "F15"); break;
|
case sf::Key::F15: sprintf(keyStr, "F15"); break;
|
||||||
case sf::Key::Pause: sprintf(keyStr, "Paues"); break;
|
case sf::Key::Pause: sprintf(keyStr, "Paues"); break;
|
||||||
|
default: sprintf(keyStr, "%c", keycode);
|
||||||
default:
|
|
||||||
sprintf(keyStr, "%c", keycode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,4 +103,6 @@ libs = [
|
||||||
'bdisasm'
|
'bdisasm'
|
||||||
]
|
]
|
||||||
|
|
||||||
env.StaticLibrary("core", files, LIBS=libs)
|
env_core = env.Clone();
|
||||||
|
env_core.Append(CXXFLAGS = [ '-fPIC' ])
|
||||||
|
env_core.StaticLibrary("core", files, LIBS=libs)
|
||||||
|
|
|
@ -192,13 +192,15 @@ void ConfigDialog::OnClose(wxCloseEvent& event)
|
||||||
|
|
||||||
void ConfigDialog::OnKeyDown(wxKeyEvent& event)
|
void ConfigDialog::OnKeyDown(wxKeyEvent& event)
|
||||||
{
|
{
|
||||||
if(clickedButton != NULL)
|
if(clickedButton != NULL) {
|
||||||
{
|
|
||||||
int page = m_Notebook->GetSelection();
|
int page = m_Notebook->GetSelection();
|
||||||
|
|
||||||
pad[page].keyForControl[clickedButton->GetId()] =
|
int sfcode = EventHandler::wxCharCodeWXToSF(event.GetKeyCode());
|
||||||
EventHandler::wxCharCodeWXToSF(event.GetKeyCode());
|
char sfstr[100];
|
||||||
clickedButton->SetLabel(wxString::Format(_T("%c"), event.GetKeyCode()));
|
EventHandler::SFKeyToString(sfcode, sfstr);
|
||||||
|
|
||||||
|
pad[page].keyForControl[clickedButton->GetId()] = sfcode;
|
||||||
|
clickedButton->SetLabel(wxString::FromAscii(sfstr));
|
||||||
clickedButton->Disconnect();
|
clickedButton->Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -331,7 +331,7 @@ void LoadConfig()
|
||||||
};
|
};
|
||||||
|
|
||||||
IniFile file;
|
IniFile file;
|
||||||
file.Load(FULL_CONFIG_DIR "pad.ini");
|
file.Load(FULL_CONFIG_DIR EPAD_CONFIG_FILE);
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++) {
|
for(int i = 0; i < 4; i++) {
|
||||||
char SectionName[32];
|
char SectionName[32];
|
||||||
|
@ -351,7 +351,7 @@ void LoadConfig()
|
||||||
void SaveConfig()
|
void SaveConfig()
|
||||||
{
|
{
|
||||||
IniFile file;
|
IniFile file;
|
||||||
file.Load(FULL_CONFIG_DIR "pad.ini");
|
file.Load(FULL_CONFIG_DIR EPAD_CONFIG_FILE);
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++)
|
for(int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
@ -366,7 +366,7 @@ void SaveConfig()
|
||||||
file.Set(SectionName, controlNames[x], pad[i].keyForControl[x]);
|
file.Set(SectionName, controlNames[x], pad[i].keyForControl[x]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file.Save(FULL_CONFIG_DIR "pad.ini");
|
file.Save(FULL_CONFIG_DIR EPAD_CONFIG_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#define __PADSIMPLE_H__
|
#define __PADSIMPLE_H__
|
||||||
|
|
||||||
#include "EventHandler.h"
|
#include "EventHandler.h"
|
||||||
|
#define EPAD_CONFIG_FILE "epad.ini"
|
||||||
// Controls
|
// Controls
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue