aboutsummaryrefslogtreecommitdiff
path: root/src/system_wrappers/source/event.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/system_wrappers/source/event.cc')
-rw-r--r--src/system_wrappers/source/event.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/system_wrappers/source/event.cc b/src/system_wrappers/source/event.cc
index 384b96142f..608cd539c4 100644
--- a/src/system_wrappers/source/event.cc
+++ b/src/system_wrappers/source/event.cc
@@ -12,10 +12,14 @@
#if defined(_WIN32)
#include <windows.h>
- #include "event_windows.h"
+ #include "event_win.h"
+#elif defined(WEBRTC_MAC_INTEL)
+ #include <ApplicationServices/ApplicationServices.h>
+ #include <pthread.h>
+ #include "event_posix.h"
#else
#include <pthread.h>
- #include "event_linux.h"
+ #include "event_posix.h"
#endif
namespace webrtc {
@@ -24,7 +28,7 @@ EventWrapper* EventWrapper::Create()
#if defined(_WIN32)
return new EventWindows();
#else
- return EventLinux::Create();
+ return EventPosix::Create();
#endif
}
@@ -45,6 +49,21 @@ int EventWrapper::KeyPressed()
{
return 0;
}
+#elif defined(WEBRTC_MAC_INTEL)
+ bool keyDown = false;
+ // loop through all Mac virtual key constant values
+ for(int keyIndex = 0; keyIndex <= 0x5C; keyIndex++)
+ {
+ keyDown |= CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, keyIndex);
+ }
+ if(keyDown)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
#else
return -1;
#endif