Capture key sequences in ActionScript 3. AKA The Konami Comeback.

6/06/2009

Contra Konami
Lately the internet has had a wave of sites using the cherished Konami Cheatcode to reveal easter eggs or similar functionality in the site or app.

I wrote a (crappy but working) class to implement such functionality in ActionScript about a year ago here.

I decided to polish it up a bit for the benefit of myself and anyone else and in the process ended up creating a small utility class to work with keystrokes in the process.

You can download the (fairly self-expaining) classes and a sample project right here, or read on for a bit of explanations.

(Text) Keys.as.
(Text) Konami.as.
(Archive) Neatly zipped + example.

Read the rest of this article »

3 Comments

Up Up Down Down Left Right Left Right B A

29/03/2008

While showering last night (this is usually when ideas and / or solutions present themselves) I came up with this idea.

Basically it’s a simple class that allows you to listen for specific sequences of keystrokes. So if the user was to press the sequence in the title, in the correct order naturally, you might react to it in any way you might deem funny. Code beneath the cut.

(BTW: I’m not all that familiar with the Text package in AS3 yet, so if there is some kind of method that does this for you please let me know.)

Read the rest of this article »

1 Comment

Stupid mac tricks

9/01/2008

Macs are awesome.

1. Invert the screen

To freak out your friends just wait until they leave the keyboard for a sec and hit CMD – CTRL – OPT – 8.
In fact I used to do this when using my mac during lectures because the inverted screen was less disturbing in the dark.
To reset it just hit the aforementioned key-combo again.

inverted screen

2. Distorted browsing.

1. Set your Dock?s minimize effect to ?Genie? (or the hidden ?Suck? choice, using TinkerTool).
2. Open Applications ? Utilities ? Terminal.

3. Type “killall Dock” (no quotes) but don?t hit Return just yet.
4. Open Safari and load a decent sized website, like Digg.
5. Switch back to the Terminal, keeping the Safari window in view.

6. Shift-click the yellow minimize button of the Safari window, and hit Return to execute the command while the window is busy morphing.

The Dock process will be killed, and it will disappear, leaving the Safari window with nowhere to go. The window will freeze mid-transition. The cool part is that the window is still responsive, and you can scroll around and see the content transform in real-time.

The Dock automatically relaunches, so you don?t have to worry about breaking anything. Finish minimizing the window, or do CMD-W to close it.

(Via Command-Tab.)

3. Zoom with the scroll-wheel

Another functionality that was probably intended for accessibility but can be loads of fun as a prank on a less savvy friend. With a scroll-wheel mouse press ctrl and scroll the wheel to zoom the screen to some ridiculous proportion. Stand back and watch as your buddy panics. To really screw up someones day if the have a pre-Leopard Mac; Zoom the screen just one pixel. This results in everything getting slightly blurry and your buddy/mother-in-law will think there’s something wrong with their monitor.

4. Free psychoanalysis

screenshot

1. Open a new Terminal window. (Finder -> Applications->Utilities->Terminal).
2. Type “emacs” (no quotes) and hit enter.
3. Press ESC and “X” simultaneously. “M-x” should appear at the bottom.

4. Type “doctor”.

This should launch the Eliza shrink-sim. Fairly silly stuff, but hey! Why shill out for a therapist when you’ve got one sitting in your terminal?

(Apparently you can play tetris and do all sorts of wacky stuff in the terminal. Find more at The Easter Egg Archive.)

5. Knock knock…

screenshot

Open the “Speech” prefpane in System Preferences and activate “Speech recognition”. Tell your mac to “Tell me a joke” to get a plethora of inane knock knock jokes.

1 Comment