Friday, October 14, 2005

Zaurus pdaXrom IR Keyboard Drivers (part 7)

(continued from part 6)

Lua rocks! My little experiment to embed Lua in Zkbdd has been a huge success. I had a bit of a learning curve to climb on the API to access the Lua objects from C, but once I got the hang of it the code fell into place quickly. It's now possible for me to fully define a keyboard's behavior in a Lua script and have Zkbdd load that script at run time and execute that definition.

What that means to users is that the mess we had with several different builds of IRK for Qtopia with each supporting different keyboards and different ROMs can be completely avoided on pdaXrom. What's more is that the keyboard drivers themselves will work on any ROM that has a port of Zkbdd without any porting or rebuilding. Last but not least, motivated users can write new keyboard drivers without any development tools at all (beyond the text editor of their choice).

The "price" for all this flexibility? Pretty low. Zkbdd did get bigger, but it's still under 90KB which seems reasonable to me. Performance, which I was quite concerned about, is outstanding. Lua has an option to forgo floating point support and build an integer only version. My empirical observations are unable to see any difference between this and the straight C version.

I still have to clean up the new code a bit, write Lua definitions for the Targus and Palm keyboards (Belkin and Pocketop are already working), and write some documentation for folks wanting to create or edit drivers for other keyboards. Lots of work left to do but I think the results will be worth it.

1 Comments:

At 1:55 AM, Blogger Adam said...

Howdy!
I'm trying to use zkbdd on my collie running Hentges rom, and the lua is where the whole process breaks down. I'm getting a "`=' expected near "scancode_punc'"
Totally mystified.

 

Post a Comment

<< Home