Giter Club home page Giter Club logo

jellydetector's Introduction

Jelly Detector

What does it do?

Background agent that locks the screen when it detects that someone typed a specific word.

Why does it exist?

People who leave their computer without locking the screen are exposed to a prank by their colleagues to remind them that they should secure their PC more thoroughly.

The prankster will use the victim's machine to post to IRC or a Facebook status something like "I love to eat Jello!" (the wording is often different, but the word 'jello' is always in there. I don't know the origins).

To secure against this, the app examines the keyboard input stream and if it detects that someone has typed the magic word, it immediately sends the computer to sleep, which also locks the screen and locks the prankster out.

How does it work?

It's pretty simple. The main loop hooks into the global keyDown event stream.

Internally, there is a state machine that looks for the next character in the magic word. (Repeat consecutive letters are ignored). As the user types, the state machine will either progress towards the end, or reset if the wrong character in sequence is pressed. If it reaches the end, the lock is activated.

It supports pressing backspace, and also repeat characters (so someone can type 'jeeeellllooo' and it will still activate).

How do I install it?

Just run it. To monitor global key events, the app must be whitelisted in OSX's "Settings > Security & Privacy > Accessibility" section. If it is not, the app will warn you about this and open the dialog for you to add it. You'll need to restart the app after you do this.

How do I get it to run on Login?

Navigate to "OSX Settings > Users & Groups > Login Items" and add the application.

How can I change the word that it looks for?

Open JelloDetector/AppDelegate.m and edit the characters 'j', 'e', 'l', 'o', and make sure MAXCHARS is the same number of characters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.