[BRLTTY] bc640: Some debug info

Mario Lang mlang at delysid.org
Wed Feb 6 17:57:38 EST 2008


Dave Mielke <dave at mielke.cc> writes:

>>Below is a C file that dumps the keypresses to stdout.
>
> So all you do is open a hiddev and read from it?

Yes, for now, thats all that is necessary.  The Linux hiddev
interface has a bunch of ioctls as well (all defined in linux/hiddev.h).
They can be used to get "reports" and do other things, but
reading incoming events is as simple as reading from the device.

> What's in the event->hid field?

-16711674.  Dont ask, I have absolutely no idea what this value
is supposed to mean.  But it seems to stay the same, no matter
what key I press.

> Do you get any special event(s) when the device is turned off?

Turning off and on is a very special topic.
Currently, linux seems to have a problem when the device gets turned on,
it gets stuck in a connect/disconnect loop for
about half a minute, but it seems to settle down then and
the hiddev stuff works.  I guess this is because this device
has a built-in USB storage, but my model has it disabled.
So Linux tries to read from the storage, and gets an IO error...
I havent figured out yet how to fix this, fortunately the
connect/disconnect loop doesnt go on forever, and I was at least
able to read from the hiddev.
If I turn the device off while my small tool is running,
it terminates, so I guess read returns with some sensible
value...

> Is the device just USB, or does it have serial and/or Bluetooth also?

It has USB and bluetooth.  AIUI, bluetooth does also
support HID, and thats what the device is doing, but I havent
played with that yet.  USB is a lot easier to handle
in early stages of development.

>>Keypresses are delivers pretty strangely, first the "keycode"
>>arrives, and then the key type.  A key type indicator has
>>the left nibble set to 1110 or 1111 to indicate press and release,
>
> Is the press really 1110? Your test program makes it look like it's 0111.

Right, I was confused.  Its 0X7n on press and 0XFn on release.

>>and the rightmost nibble indicates the keygroup. 1 seems to be the thumb
>>keys, 2 are the keys on the left and right side of the display line,
>>3 are the keys on top of the display, and 4 are the cursor routing keys.
>
> Can you send me a description of the actual key layout along with the code for 
> each key?

Yes, here we go:

Key group 1: The thumb keys.  The device has 5 thumb keys, numbers 0 to 4 from
left to right.

Key group 2: The keys left and right of the display line.
The device has 4 of those keys, on the left side of the display 0 and 1,
and on the right side 2 and 3.  The topmost key is 0 and 2,
the bottom one is 1 and 3.

Key group 3: These keys are located below the display line, on
top of the device.  There are 8 of those keys, in the middle
you have "cursor keys" with up/down, left/right, and one button
in the middle.  On the sides, you have two additional keys.
Below are the keycodes drawn in the same layout:

                       4
        0     1      2 3 6      7     8
                       5

Key group 4: Those are the cursor routing keys.
They are numbered from 0 to 39, from left to right.
This device has a built-in emulated second row of routing keys.
If one presses a routing key for half a second,
it is still emitted as keygroup 4, but the routing key
values are numbered from 128 to 167.
One peculiarity that is probably worth mentioning is that
this device has the routing keys below the display line, not
above as all other devices I have seen so far.

>>I still have absolutely no idea how to actually write to the display.
>
> With the information you've sent about input, I'll see if the specs make sense 
> and try to deduce how to do output.

That sounds promising, I hope I can be of any help.  7 days
to go until I have to give this thing back.

-- 
CYa,
  ⡍⠁⠗⠊⠕ | Debian Developer <URL:http://debian.org/>
  .''`. | Get my public key via finger mlang at db.debian.org
 : :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
 `. `'
   `-      <URL:http://delysid.org/>  <URL:http://www.staff.tugraz.at/mlang/>


More information about the BRLTTY mailing list