karpathy / ulogme

Automatically collect and visualize usage statistics in Ubuntu/OSX environments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No keystrokes logged on OS X 10.9?

dblalock opened this issue · comments

Hi Andrej,

Firstly, thanks for making this awesome tool. I read your blog post and am excited to try it out for myself. Unfortunately, though, I can't get it to log any keystrokes. The window title logging works fine and nothing reports any errors--it just always logs 0 keystrokes.

Steps to reproduce:
Clone the repo and cd into it
Create a suitable settings file as per your instructions
$ bash ulogme.sh
Verify that keyfreqraw.txt is written every few seconds, but that the keyfreq_* file records 0 keystrokes

OS:
OS X 10.9.4

I also tried installing pyobjc and running the python scripts directly by changing the DEV flag in run_ulogme_osx.sh, but to no avail. I added debug output to the EventSniffer.event_handler, and it appears this function just isn't being called.

I know in 10.9 one typically has to explicitly allow the app to "control this computer" in System Preferences > Security & Privacy > Accessibility in order to use NSEvent's
addGlobalMonitorForEventsMatchingMask:, but the menu doesn't present ulogme.app as an option, suggesting that maybe there's some missing step for the app to register its event tap...

If this is both a real issue (rather than me just missing something) and a pain to fix, I can probably contribute a native Cocoa app that would produce the needed functionality--just let me know.

Hi there, thanks a lot for reporting this! I did mostly the Ubuntu code and a friend of mine did most of the porting to Mac. I was able to get it running without any issues on my own Mac that uses 10.9.4, but I think only because I already went through the Security and Privacy in the past. In particular, if I go into mine I see that there's no ulogme there, but "Terminal" is checked under "Allow the apps below to control your computer". This is probably the relevant setting because ulogme runs from terminal. Do you have Terminal there?

If this doesn't resolve it let me know and I'll CC this to Justin (my friend) asap and when we resolve it I'll update README.

Thanks!

Ah. Enabling Terminal (or iTerm2, if that's what you invoked it from) and restarting the scripts fixes it. Thanks so much!

Awesome, thanks for reporting this, I will add this to Readme.