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:
nakeee 2009-01-01 10:52:20 +00:00
parent f419223908
commit bd3f468c37
5 changed files with 158 additions and 155 deletions

View File

@ -230,8 +230,6 @@ void EventHandler::SFKeyToString(unsigned int keycode, char *keyStr) {
case sf::Key::F14: sprintf(keyStr, "F14"); break;
case sf::Key::F15: sprintf(keyStr, "F15"); break;
case sf::Key::Pause: sprintf(keyStr, "Paues"); break;
default:
sprintf(keyStr, "%c", keycode);
default: sprintf(keyStr, "%c", keycode);
}
}

View File

@ -103,4 +103,6 @@ libs = [
'bdisasm'
]
env.StaticLibrary("core", files, LIBS=libs)
env_core = env.Clone();
env_core.Append(CXXFLAGS = [ '-fPIC' ])
env_core.StaticLibrary("core", files, LIBS=libs)

View File

@ -192,13 +192,15 @@ void ConfigDialog::OnClose(wxCloseEvent& event)
void ConfigDialog::OnKeyDown(wxKeyEvent& event)
{
if(clickedButton != NULL)
{
if(clickedButton != NULL) {
int page = m_Notebook->GetSelection();
pad[page].keyForControl[clickedButton->GetId()] =
EventHandler::wxCharCodeWXToSF(event.GetKeyCode());
clickedButton->SetLabel(wxString::Format(_T("%c"), event.GetKeyCode()));
int sfcode = EventHandler::wxCharCodeWXToSF(event.GetKeyCode());
char sfstr[100];
EventHandler::SFKeyToString(sfcode, sfstr);
pad[page].keyForControl[clickedButton->GetId()] = sfcode;
clickedButton->SetLabel(wxString::FromAscii(sfstr));
clickedButton->Disconnect();
}

View File

@ -331,7 +331,7 @@ void LoadConfig()
};
IniFile file;
file.Load(FULL_CONFIG_DIR "pad.ini");
file.Load(FULL_CONFIG_DIR EPAD_CONFIG_FILE);
for(int i = 0; i < 4; i++) {
char SectionName[32];
@ -351,7 +351,7 @@ void LoadConfig()
void SaveConfig()
{
IniFile file;
file.Load(FULL_CONFIG_DIR "pad.ini");
file.Load(FULL_CONFIG_DIR EPAD_CONFIG_FILE);
for(int i = 0; i < 4; i++)
{
@ -366,7 +366,7 @@ void SaveConfig()
file.Set(SectionName, controlNames[x], pad[i].keyForControl[x]);
}
}
file.Save(FULL_CONFIG_DIR "pad.ini");
file.Save(FULL_CONFIG_DIR EPAD_CONFIG_FILE);
}

View File

@ -19,6 +19,7 @@
#define __PADSIMPLE_H__
#include "EventHandler.h"
#define EPAD_CONFIG_FILE "epad.ini"
// Controls
enum
{