Author Topic: Bluetooth "smart Keyboard"  (Read 5290 times)

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
Bluetooth "smart Keyboard"
« on: December 22, 2005, 11:01:36 am »
I've just bought one of these, and I have to say it's fantastic.  I like it so much better than the PockeTop IR I had before.  I bought it instead of the ThinkOutside model because it has a dedicated number row, and also it has several function keys making possible a variety of Macro combinations.  The 6000 fits very comfortably in the built-in PDA rest in landscape orientation.

I got mine off ebay, but the product page is here:
http://shop.brando.com.hk/btsmartkeyboard.php

There's a thorough review here:
http://www.the-gadgeteer.com/brando-blueto...ard-review.html

Anyway, it wasn't supported out of the box, so I wrote a driver for it.  We can now add this to the list of working keyboards.  (the driver might need some tweaking for non-6000 models)

loc4me

  • Full Member
  • ***
  • Posts: 141
    • View Profile
    • http://
Bluetooth "smart Keyboard"
« Reply #1 on: December 22, 2005, 12:09:18 pm »
How is the mapping of the keys? Does it work like it should?

On that review that you posted it talks about the keys being smaller than the Thinkoutside one. They did not post a pic. Can you comment on the key size and overall usability?

How does the 6000 fit in the stand in portrait mode?

And may i ask, since i am a nearly a noob, how does one "write" a driver? That is interesting.
SL-5500 w/ TKC 2.0 beta 3 rom
SL-6000L + Sled w/ Guylhem or Sharp rom. Have not tried PdaXrom YET
SL-C3000 - w/ Cacko C3Kb1. Like it alot

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
Bluetooth "smart Keyboard"
« Reply #2 on: December 22, 2005, 12:48:24 pm »
Quote
How is the mapping of the keys? Does it work like it should?
Yes I put some effort into making every key work.  My driver currently support all printed keys, except for the unicode characters (like Yen and Euro)  but I plan to add those as well.  It also supports the numlock number pad, the home key, the 4 application keys, OK, Cancel, and Select.  I also put in shortcuts to toggle the backlight and rotate the screen.  I think I can add more shortcuts to adjust screen brightness and a few other things but I'll have to see if it works.

I've also created a custom keycode.tbl file that adds some special keys my driver uses and also has my  modified JP keyboard layout.  (I'm not using keyhelper anymore)

Quote
On that review that you posted it talks about the keys being smaller than the Thinkoutside one. They did not post a pic. Can you comment on the key size and overall usability?
I can't compare head to head, but the keys are fine for me.  They are bigger than the keys on any Zaurus.  I'd say its comparable to my sub-notebook keyboard.

Quote
How does the 6000 fit in the stand in portrait mode?
It tips over.  

Quote
And may i ask, since i am a nearly a noob, how does one "write" a driver? That is interesting.

Programming in C is a prerequisite.  First I familiarized myself with the Bluetooth socket API.  Then I poked and prodded the keyboard with BT connections until I figured out it's simple protocol because it doesn't support HID profile.  Then I wrote the driver.  Most of it is a user process that reads bytes from a bluetooth socket and translates then into codes, and it communicates with a kernel module ev_synth.o to inject scancode events into the kernel input queue.  I had some help from a program I found on the web called bthid which I borrowed code from.  It saved a lot of time.

I wanted it to work on standard Sharp ROM and be compatible with the slide keyboard, that influenced my design decisions a lot.
« Last Edit: December 22, 2005, 12:50:24 pm by DrWowe »

loc4me

  • Full Member
  • ***
  • Posts: 141
    • View Profile
    • http://
Bluetooth "smart Keyboard"
« Reply #3 on: December 22, 2005, 01:42:47 pm »
Quote
Quote
And may i ask, since i am a nearly a noob, how does one "write" a driver? That is interesting.

Programming in C is a prerequisite.  First I familiarized myself with the Bluetooth socket API.  Then I poked and prodded the keyboard with BT connections until I figured out it's simple protocol because it doesn't support HID profile.  Then I wrote the driver.  Most of it is a user process that reads bytes from a bluetooth socket and translates then into codes, and it communicates with a kernel module ev_synth.o to inject scancode events into the kernel input queue.  I had some help from a program I found on the web called bthid which I borrowed code from.  It saved a lot of time.

I wanted it to work on standard Sharp ROM and be compatible with the slide keyboard, that influenced my design decisions a lot.

That is really neat. So correct me if i am wrong. You wrote the driver to interface with the keyboard and then created the keycode.tbl file. Does the keycode.tbl file work similar to the keyhelper.xml file. So if you can make a custom keycode.tbl file you dont need keyhelper??? How do you get the keycode for each key. Is there a comand for it. I know on a *nix box you can grab the key scan codes and make a new map from that. Is this similar??

So can you use the BT keyboard and the internal keyboard at the same time? Did you have to create an extra keycode.tbl file for the BT keyboard. How did you get it to reference that file instead of the default on for the internal keyboard.

Sorry for all the quesitons. I am attempting to learn and be able to use all the power of the Zaurus. It is a very powerful tool when you understand how use all its capabilites. I guess that is why Sharp called it a "personal moble tool" and not a just a PDA.  
SL-5500 w/ TKC 2.0 beta 3 rom
SL-6000L + Sled w/ Guylhem or Sharp rom. Have not tried PdaXrom YET
SL-C3000 - w/ Cacko C3Kb1. Like it alot

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
Bluetooth "smart Keyboard"
« Reply #4 on: December 22, 2005, 03:09:58 pm »
Quote
That is really neat. So correct me if i am wrong. You wrote the driver to interface with the keyboard and then created the keycode.tbl file. Does the keycode.tbl file work similar to the keyhelper.xml file. So if you can make a custom keycode.tbl file you dont need keyhelper???

Yes that's right.  You can do all kinds of key remapping with keycode.tbl because it's the master keytable for Qtopia.  You can even do things like add new scan codes and unicode characters, which keyhelper can't do.

Keyhelper has a few advantages of it's own.  When you edit keycode.tbl you have to restart Qtopia, whereas keyhelper can make changes on the fly.  Also, keyhelper has other features besides remapping that can be useful, like app-launching.

Quote
How do you get the keycode for each key. Is there a comand for it.
I know on a *nix box you can grab the key scan codes and make a new map from that. Is this similar??
I mostly got the scan codes and QT key codes from reading the existing keycode.tbl.  In a few cases, I just created my own new scan codes which the driver sends and added them as extra lines to keycode.tbl.  The "path" from keystroke to screen goes like this:

1) user presses key
2) keyboard generates key code and sends to driver (these codes are specific to this keyboard)
3) driver translates key code from keyboard to scan code, and injects the key event into Linux Kernel

4a) if you are in console mode the kernel translates scan code to ASCII as defined in tosa_keyboard.c in the Sharp kernel.

4b) in, QTopia the scan code is translated to the QT key using keycode.tbl
5b) if you are running keyhelper, that's yet another translation layer.

4c) in X11, the X server will translate scan codes into X key events using the X keymap.

If I start playing around with pdaXrom, I'll try to create a good X keymap for this keyboard.  If I have to, I may write a seperate XInput driver, so that it can take special advantage of X11 features.  

Quote
Sorry for all the quesitons. I am attempting to learn and be able to use all the power of the Zaurus. It is a very powerful tool when you understand how use all its capabilites. I guess that is why Sharp called it a "personal moble tool" and not a just a PDA. 

No need to apologize.  I'm enjoying improving my 6000 experience right now, and I hope others will jump in too.  I agree that the community has been too small and fragmented, and I'm hoping we can pick up where Sharp left off and realize the awesome potential of this model.  It already seems way more advanced to me than a year ago because of the great work people have done.
« Last Edit: December 22, 2005, 04:32:35 pm by DrWowe »

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
Bluetooth "smart Keyboard"
« Reply #5 on: December 22, 2005, 03:19:17 pm »
Quote
Quote
How does the 6000 fit in the stand in portrait mode?
It tips over.  

One more comment about this:  Since it's Bluetooth, it isn't really necessary to use the stand at all (as compared to the IR keyboards where you have to keep line of sight).  It's fine if you're on a table.  But I can just as easily put both the Zaurus and the keyboard on my lap while I'm typing.  There are some sliding locks that hold the keyboard open so it works fine.

loc4me

  • Full Member
  • ***
  • Posts: 141
    • View Profile
    • http://
Bluetooth "smart Keyboard"
« Reply #6 on: December 22, 2005, 08:02:48 pm »
Quote
So can you use the BT keyboard and the internal keyboard at the same time? Did you have to create an extra keycode.tbl file for the BT keyboard. How did you get it to reference that file instead of the default on for the internal keyboard.

Thanks for that info. That helps explain things. DrWowe. Can you answer the above quote? Do you have more than one keycode.tbl or not. How do you get the Z to reconize the keycodes for the BT keyboard. Do you put them all in the same file or seperate ones?
SL-5500 w/ TKC 2.0 beta 3 rom
SL-6000L + Sled w/ Guylhem or Sharp rom. Have not tried PdaXrom YET
SL-C3000 - w/ Cacko C3Kb1. Like it alot

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
Bluetooth "smart Keyboard"
« Reply #7 on: December 22, 2005, 10:19:37 pm »
Quote
Quote
So can you use the BT keyboard and the internal keyboard at the same time? Did you have to create an extra keycode.tbl file for the BT keyboard. How did you get it to reference that file instead of the default on for the internal keyboard.
Thanks for that info. That helps explain things. DrWowe. Can you answer the above quote? Do you have more than one keycode.tbl or not. How do you get the Z to reconize the keycodes for the BT keyboard. Do you put them all in the same file or seperate ones?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=108160\"][{POST_SNAPBACK}][/a][/div]

Only one keycode.tbl.  I have modified it from the keycode.tbl in the Sharp USA ROM.  It's not reading an extra file, it's still called keycode.tbl, it's just modified.  In some cases, there are multiple scan codes that map to the same unicode character and so Qtopia can tell them apart.  The same keycode.tbl supports the mappings for both keyboards.  And yes, I can use the internal keyboard and the Bluetooth at the same time and they both work and they produce the right symbols.  Does that answer work for you?