6 Feb 2004 chromatic   » (Master)

Ahh, Inexorable Progress:

(Yes, I am aware of the synonym inflexible.)

After two more bits of hacking, events work with SDL Parrot. That is to say, I can move the little parrot logo around on screen by pressing and releasing the cursor keys. I can even shut down the program cleanly by pressing Escape.

Okay, so it's a little grotty and not documented. (You'd be impressed by the rest of the documentation, however.) True, I can only detect five keys (up, down, left, right, and Escape) and I make no distinction between key up and key down events. Of course, two hours ago, I could barely report a key detection. This is progress.

There are two ways to detecting keyboard events. One is to pass a list of events and callbacks to a loop. The other is to process incoming events and run through the state machine yourself. Since I like first-class functions so much, I went with the callback approach.

Since I'm writing examples at the same time, the necessary abstractions are beginning to appear. It may be time to delve into PIR object syntax. I'll have something really cool to show off by the time OSCON rolls around.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!