Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up OSX input selection #5954

Merged
merged 4 commits into from
Sep 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Source/Core/InputCommon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ elseif(APPLE)
find_library(COCOA_LIBRARY Cocoa)
set(SRCS ${SRCS}
ControllerInterface/OSX/OSX.mm
ControllerInterface/OSX/OSXKeyboard.mm
ControllerInterface/OSX/OSXJoystick.mm
ControllerInterface/Quartz/Quartz.mm
ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
Expand Down
22 changes: 4 additions & 18 deletions Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/OSX/OSX.h"
#include "InputCommon/ControllerInterface/OSX/OSXJoystick.h"
#include "InputCommon/ControllerInterface/OSX/OSXKeyboard.h"
#include "InputCommon/ControllerInterface/OSX/RunLoopStopper.h"

namespace ciface
Expand Down Expand Up @@ -155,10 +154,6 @@ static void DeviceRemovalCallback(void* inContext, IOReturn inResult, void* inSe
if (joystick && joystick->IsSameDevice(inIOHIDDeviceRef))
return true;

const Keyboard* keyboard = dynamic_cast<const Keyboard*>(device);
if (keyboard && keyboard->IsSameDevice(inIOHIDDeviceRef))
return true;

return false;
});
g_controller_interface.InvokeHotplugCallbacks();
Expand All @@ -172,19 +167,10 @@ static void DeviceMatchingCallback(void* inContext, IOReturn inResult, void* inS
std::string name = GetDeviceRefName(inIOHIDDeviceRef);

// Add a device if it's of a type we want
if (IOHIDDeviceConformsTo(inIOHIDDeviceRef, kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard))
{
if (g_window)
g_controller_interface.AddDevice(
std::make_shared<Keyboard>(inIOHIDDeviceRef, name, g_window));
}
#if 0
else if (IOHIDDeviceConformsTo(inIOHIDDeviceRef, kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse))
{
g_controller_interface.AddDevice(new Mouse(inIOHIDDeviceRef, name));
}
#endif
else
if (IOHIDDeviceConformsTo(inIOHIDDeviceRef, kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick) ||
IOHIDDeviceConformsTo(inIOHIDDeviceRef, kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad) ||
IOHIDDeviceConformsTo(inIOHIDDeviceRef, kHIDPage_GenericDesktop,
kHIDUsage_GD_MultiAxisController))
{
g_controller_interface.AddDevice(std::make_shared<Joystick>(inIOHIDDeviceRef, name));
}
Expand Down
81 changes: 0 additions & 81 deletions Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h

This file was deleted.