diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2010-04-25 18:04:55 +0000 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2010-04-25 18:04:55 +0000 |
| commit | 452c2e711abbe40b8b4da72dedbf292992fd35f0 (patch) | |
| tree | 8822e4677217240db4649a2b3a533821753ca303 /Source/Core/InputCommon/Src/ControllerInterface/OSX/OSX.cpp | |
| parent | a443ec7d8d32cbbe616b4d0775944b7ccdf5b1e4 (diff) | |
First OSX keyboard stuff...works, with limitations:\nNo Mouse support yet (Add gamepad via IOKit as well?)\nCould poll less for less cpu time\nDon't know why rumble events don't seem to be sent to the class until right before it's deleted (Billiard?)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5407 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/OSX/OSX.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/OSX/OSX.cpp | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSX.cpp b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSX.cpp deleted file mode 100644 index 7cbb858e48..0000000000 --- a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSX.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "../ControllerInterface.h" - -#ifdef CIFACE_USE_OSX - -#include "OSX.h" -#include "OSXPrivate.h" - -namespace ciface -{ - namespace OSX - { - - - void Init( std::vector<ControllerInterface::Device*>& devices, void* hwnd ) - { - // mouse will be added to this, Keyboard class will be turned into KeyboardMouse - // single device for combined keyboard/mouse, this will allow combinations like shift+click more easily - //devices.push_back( new Keyboard( hwnd ) ); - } - - Keyboard::Keyboard( void *View ) - { - - memset( &m_state, 0, sizeof(m_state) ); - OSX_Init(View); - // This is REALLY dumb right here - // Should REALLY cover the entire UTF-8 Range - for (int a = 0; a < 256; ++a) - inputs.push_back( new Key( (char)a ) ); - } - - - Keyboard::~Keyboard() - { - // might not need this func - } - - - ControlState Keyboard::GetInputState( const ControllerInterface::Device::Input* const input ) - { - return ((Input*)input)->GetState( &m_state ); - } - - void Keyboard::SetOutputState( const ControllerInterface::Device::Output* const output, const ControlState state ) - { - - } - - bool Keyboard::UpdateInput() - { - memset(m_state.keyboard, 0, 256); - OSX_UpdateKeys(256, m_state.keyboard ); - - // mouse stuff in here too - - return true; - } - - bool Keyboard::UpdateOutput() - { - return true; - } - - - std::string Keyboard::GetName() const - { - return "Keyboard"; - //return "Keyboard Mouse"; // change to this later - } - - std::string Keyboard::GetSource() const - { - return "OSX"; - } - - int Keyboard::GetId() const - { - return 0; - } - - - ControlState Keyboard::Key::GetState( State* const state ) - { - for(unsigned int a = 0; a < 256; ++a) - if(state->keyboard[a] == m_index) - return true; - return false; - } - - std::string Keyboard::Key::GetName() const - { - char temp[16]; - sprintf(temp, "Key:%c", m_index); - return std::string(temp); - } - - - } -} - -#endif |
