Hello, my name's Dominic.
I'm going to show you something I've been tinkering with lately,
it's a user mode driver for Luxeed's LED keyboard for Mac OS X.
I've got an ordinary Intel Mac running Leopard
and here is the Luxeed keyboard.
So my hands don't get in the way during the demo I also have here
an Apple bluetooth keyboard that I'll be typing on.
So I'm just going to plug the keyboard in.
So the keyboard lights up better I'm going to actually dim the lights here.
This is the software. It's a Cocoa application called KeyboardThemer
and you apply effects to your keyboard
by choosing from this list of available effects
and dragging and dropping them into this list of effects
that will be applied to your keyboard. And you have to check the visible checkbox
to make the keyboard light up.
And then you can configure the settings of each effect.
So this effect called Conway's Life, which is the Game of Life, has a color.
That's what you see applied to the keyboard here.
And you can change the color of the Life effect
and, you can't see this on the video, but
the keyboard reacts instantly.
As you pick a color the effect as it's displayed on the keyboard updates, which is why there's no on-screen keyboard
because you can just look at the keyboard on your desk.
Now I'll turn Conway's Life off
and drag over what might be my favorite effect.
It's called the Heat Map.
And this is basically the spark effect, so, when you press a key
the key you pressed will glow briefly.
I'll just pull up TextEdit
so I can type something.
Ah, the effect isn't visible. Make it visible.
And now type.
You can also make multiple effects visible at once, which is what I'm doing here
layering the Heat Map in red over the Game of Life in white.
This effect is a plasma, which is periodic functions on top of Perlin noise.
and by tweaking the sliders down here
you can get a lot of interesting visual effects.
I'm just going to make a basic rainbow effect here
which we get by putting the red, green and blue
all at different offsets in the periodicity.
Now we're going to change gears and talk about programming the keyboard yourself.
Here I've dragged across the AppleScript effect, which doesn't have any settings
but if you run an AppleScript outside of KeyboardThemer
like through Apple's Script Editor, that I've just brought up here
you can program each of the keys individually
however you like.
This is an example script that is also on the website;
it asks the Mail application for the number of unread items in Mail, and if there are any unread items
it'll set the squiggle key to be bright green.
This record over here is a red, green, blue triple.
You can also program effects in JavaScript
by dragging the JavaScript effect onto your list of applied effects.
And with this effect you get a little JavaScript editor
and you write your JavaScript right in KeyboardThemer.
There's a log window at the bottom
which is useful for debugging, so I'll just demonstrate a simple script
that just writes something to the log. Hit Play.
And you'll see "Hello, world" appears in the log.
Obviously you can do a lot more.
By writing an RGBA record into the 'keys' hash
you can set the color of individual keys.
Here I'm going to make the "G" key bright red.
And to get your script to run, you just need to toggle the Play button.
Now we're going to do something much more interesting with JavaScript.
This is the Yahoo! Finance page
and as you can see, if you type a few ticker symbols into their
little get quotes search thing
you can see the daily change for a bunch of different stocks.
So ahead of time I've done some digging through the HTML
of this page, and I've written a little JavaScript
that downloads the page
and then it uses a regular expression you see at the top here
to dig out the ticker symbols
and the color of that cell that has the day's change in it.
So now I'm just going to fill in the query string
with a couple of interesting stocks, Google, Microsoft, Sony, Nintendo.
And then when you run this
when the page download is complete
it loops over all of the matches of that regular expression, pulls out the symbols,
and then it pulls out the HTML attribute
of the color, and here we're setting
the key which is the first letter of the ticker symbol to that color.
So thanks very much for watching the demo.
If you're interested in trying out the software yourself
go to www.macledkeyboard.com
and sign up for an email when it's ready. Thanks.