I wrote a keylogger that tweets every 140 characters I type

I know this is more conceptual than the usual ofw-interactive-installation-stuff, but still – it wouldn’t have been possible without ofw :slight_smile:

I used:

  • ofxXmlSettings to store some information like username, password, and filtered words (passwords, credit card numbers, ssn) that I consider “control” rather than “information”.

  • ofxThread to do the posting and keylogging asynchronously, so keys aren’t lost when posts are being made.

  • Some code I posted at for handling window hiding (I use the Home and End keys to show and hide the debug console)

  • ofEvents were used for the keylogger’s callbacks. e.g.:

ofAddListener(logger.keyPressed, this, &AutoTweet::keyPressed);  

See ofxKeyLogger for my windows-specific keylogger implementation. I know Arturo has some linux specific code and zach has some osx specific code – both from oflab – for doing keylogging. I tried to write ofxKeyLogger so that it could be extended for other OSes.

The biggest pain was getting some unicode sent to Twitter correctly to represent the arrow and return keys. I could represent the unicode in a string using \u escape sequences, but it would store it in multiple bytes – so the character count was off. wstring correctly reported the size() of the buffer, but didn’t like being sent to _wsystem. In the end I wrote a wrapper called ofxString that let me store ints instead of characters, with the ints corresponding to the OF_KEY mappings.

If you’d like to run the app yourself, just add a bin/data/config.xml that looks like this:


And be sure to add the cURL binary to /bin or your system path.

I could see a lot of evil and very fun uses for an ofxKeyLogger addon :smiley:


Yeah! You could totally do whole-machine tourettes :slight_smile:

The tourettes thing is nice because it’s kind of a diy/try it yourself sort of thing, while this is more “check this out – it’s fun conceptual-hacking-art”. I’d like to try some more fffffatish stuff, but this is the first thing that came to mind.

Score #3 for ofw + hackaday!

Also, I posted the binaries w/ a readme if you’d like to play with it.

hehe just trying wank out damn the tourretes honkey machine… pretty funny!


There’s already a reference in this article to it…

Yeah! I’m super excited about the neural article, it’s the most “legitimate” thing I’ve been mentioned in yet :slight_smile: I also think it’s a great analysis of the idea, so it was encouraging to read.

Haha! Good to hear you’re becoming more legit Kyle :wink:
Yeah the article is really nice…