mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 12:48:57 +00:00
Start work of OSX keyboard input, doesn't work, so it's currently disabled, but it's a beginning. Also changed variable 'id' to 'cid' because id is a object type in Obj-C, which I was running in to problems with, kept it that way just in case.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5269 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
2742be1c2e
commit
48533bb3db
7 changed files with 236 additions and 10 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "ControllerInterface.h"
|
||||
|
||||
namespace ciface {
|
||||
}
|
||||
#ifdef CIFACE_USE_XINPUT
|
||||
#include "XInput/XInput.h"
|
||||
#endif
|
||||
|
@ -9,6 +11,9 @@
|
|||
#ifdef CIFACE_USE_XLIB
|
||||
#include "Xlib/Xlib.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_OSX
|
||||
#include "OSX/OSX.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_SDL
|
||||
#include "SDL/SDL.h"
|
||||
#endif
|
||||
|
@ -37,6 +42,9 @@ void ControllerInterface::Init()
|
|||
#ifdef CIFACE_USE_XLIB
|
||||
ciface::XLIB::Init( m_devices, m_hwnd );
|
||||
#endif
|
||||
#ifdef CIFACE_USE_OSX
|
||||
ciface::OSX::Init( m_devices, m_hwnd );
|
||||
#endif
|
||||
#ifdef CIFACE_USE_SDL
|
||||
ciface::SDL::Init( m_devices );
|
||||
#endif
|
||||
|
@ -80,6 +88,9 @@ void ControllerInterface::DeInit()
|
|||
#ifdef CIFACE_USE_XLIB
|
||||
// nothing needed
|
||||
#endif
|
||||
#ifdef CIFACE_USE_OSX
|
||||
// nothing needed
|
||||
#endif
|
||||
#ifdef CIFACE_USE_SDL
|
||||
// there seems to be some sort of memory leak with SDL, quit isn't freeing everything up
|
||||
SDL_Quit();
|
||||
|
@ -299,12 +310,12 @@ ControlState ControllerInterface::OutputReference::State( const ControlState sta
|
|||
//
|
||||
std::string ControllerInterface::DeviceQualifier::ToString() const
|
||||
{
|
||||
if ( source.empty() && (id < 0) && name.empty() )
|
||||
if ( source.empty() && (cid < 0) && name.empty() )
|
||||
return "";
|
||||
std::ostringstream ss;
|
||||
ss << source << '/';
|
||||
if ( id > -1 )
|
||||
ss << id;
|
||||
if ( cid > -1 )
|
||||
ss << cid;
|
||||
ss << '/' << name;
|
||||
return ss.str();
|
||||
}
|
||||
|
@ -324,7 +335,7 @@ void ControllerInterface::DeviceQualifier::FromString(const std::string& str)
|
|||
|
||||
// dum
|
||||
std::getline( ss, name, '/' );
|
||||
std::istringstream(name) >> (id = -1);
|
||||
std::istringstream(name) >> (cid = -1);
|
||||
|
||||
// good
|
||||
std::getline( ss, name = "");
|
||||
|
@ -338,7 +349,7 @@ void ControllerInterface::DeviceQualifier::FromString(const std::string& str)
|
|||
void ControllerInterface::DeviceQualifier::FromDevice(const ControllerInterface::Device* const dev)
|
||||
{
|
||||
name = dev->GetName();
|
||||
id = dev->GetId();
|
||||
cid = dev->GetId();
|
||||
source= dev->GetSource();
|
||||
}
|
||||
|
||||
|
@ -350,7 +361,7 @@ void ControllerInterface::DeviceQualifier::FromDevice(const ControllerInterface:
|
|||
bool ControllerInterface::DeviceQualifier::operator==(const ControllerInterface::Device* const dev) const
|
||||
{
|
||||
if ( dev->GetName() == name )
|
||||
if ( dev->GetId() == id )
|
||||
if ( dev->GetId() == cid )
|
||||
if ( dev->GetSource() == source )
|
||||
return true;
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue