1

I am in the process of porting some code over from Linux to Mac. I am a newbie to Mac so please bear with....

On Linux we have used XRecord from the X11 libraries for input capture. I am attempting to use XQuartz on the Mac as a substitute but have not been able to get it functioning.

I expect to see librecord.so in X11/lib/xorg/modules so that I can enable it by added Load "record" to my xorg.conf file but record.so is not there and I can't seem to find any reference online or in the XQuartz documentation to a way of adding it.

Consequently this code throws the expected error:

int major, minor;
if (XRecordQueryVersion(m_Info.m_Display, &major, &minor) != false)
{
    std::string logMessage = "XRecord version: %d.%d\n", major, minor;
    LOG4CXX_DEBUG (LOGGER, COMMON_STR (logMessage));
}
else
{
    THROW_EXCEPTION (errval::XRECORD_UNAVAILABLE);
}

Does anyone have any suggestions?

1 Answers1

1

XRecord is an extension to X. Therefore, it can not be assumed to be present, even as an optionally-loaded component. XQuartz does not implement it.

You would have to port it to OS X. That might entail building your own version of the X server, depending on whether XRecord requires non-standard hooks in the rest of the X server code.

What were you hoping to do with the XRecord extension? If your goal was to record input system-wide on OS X, then it wasn't the right solution, anyway. On OS X, X11 is a secondary window system that's a guest (user app) on top of the native one. X11 does not generally see all input or windowing operations in the rest of the system.

Ken Thomases
  • 88,520
  • 7
  • 116
  • 154
  • Thanks Ken I was afraid that may be the answer. We used the XRecord extension for our linux release to capture mouse and keyboard activity for research purposes. It appears from your answer and other things I have read (or just not been able to find... ) that this is just not going to work on the Mac so we're investigating other options now. – George Kaplan Jan 28 '15 at 20:37
  • You're welcome. You should look into Quartz Event Taps. – Ken Thomases Jan 28 '15 at 20:56
  • simpler solution could be enabling screen sharing and attaching VNC client - just ignore rectangle updates and you'll get all keyboard/mouse events, screen resolution changes and pastebuffer changes – Andrey Sidorov Jan 28 '15 at 23:54