I've wanted an Optimus Maximus keyboard since I first heard about it. Whereas some people seem to think it's an expensive gimmick, as someone who routinely switches between three different keyboard layouts (and can't touch type on all of them) it would be a godsend. However, I don't have that kind of money to drop on a keyboard.
A couple weeks ago I got a nook simple touch. I can't speak highly enough about this little tablet. If nothing else it's makes me want to read. Obviously pretty much the first thing I did was to root it which makes it the only e-ink tablet on the market. After getting everything working it made me wonder if I could use it as a wireless soft keyboard for my regular computer.
I've never written an android app and before I dove headlong into that I figured I should do a quick and dirty proof of concept. I decided to mock up a keyboard in html, run a minimal server on my main computer and somehow connect the server to another program to mimic key presses. I didn't want to mess with fonts, so I decided to use an image for each key. I typed out all the keys from the different keyboard layouts to a text file and used a quick and dirty python script to parse the file and send commands to image magick to produce the images then modified the same script to generate an html file. You can see the html page here.
The server side code was borrowed from another project I did a couple years ago. The code is super messy, but if you're curious, the whole thing can be downloaded here. . Basically the keypresses send a code back to the server in acsii, they are decoded in a look up table and then sent to xte which simulates the key presses.
How does it work? Not very well. Opera mini doesn't want to connect to my home brew server and the browser browser doesn't handle javascript very well so I can't switch between layouts. xte will generate German and US keypresses just fine, but I haven't been able to get it to output Cyrillic, which was actually the impetus for this project in the first place. So it's still just a proof of concept for the moment, but it was a fun afternoon getting it working. Take a look below:
Leave a comment