1

I have an old Compaq keyboard that has a set of keys on top that do not work.

I have tried xev, evtest, evemu-record and libinput debug-events and every other key except those keys is recognized.

However when I turn on a wireshark usb recorder I get some output that looks like this:

0000   00 a8 6e e5 73 9c ff ff 42 01 82 0a 01 00 2d 00   ..o.s...C.....-.
0010   9e ab f1 5f 00 00 00 00 06 c6 03 00 00 00 00 00   ..._............
0020   06 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00   ................
0030   02 00 00 00 00 00 00 00 04 02 00 00 00 00 00 00   ................
0040   04 00 00 00 00 00                                 ......

0000   00 a8 6e e5 73 9c ff ff 42 01 82 0a 01 00 2d 00   ..o.s...C.....-.
0010   a0 ab f1 5f 00 00 00 00 66 64 01 00 00 00 00 00   ..._....fd......
0020   06 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00   ................
0030   02 00 00 00 00 00 00 00 04 02 00 00 00 00 00 00   ................
0040   04 00 00 10 00 00 

That means that the keys indeed work and I just need a to write a driver for it.

Now I have zero experience in writing linux driver but I took a look from linux/drivers/hid/ at github.com/torvalds/linux, specifically hid-asus.c and I know that I have to somehow identify each key stroke with respective hex value.

The problem is that I can figure out where to look since only the 0000, 0020 and 0030 lines of a hex dump stay the same and 0010 is different every time I record it trough wireshark.

I know this is maybe basic but can you point me in the right direction i.e. give some content I can read on on this subject or have any idea how I should proceed?

Output from evtest:

/dev/input/event12: Compaq Compaq Internet Keyboard
/dev/input/event13: Compaq Compaq Internet Keyboard Consumer Control
/dev/input/event14: Compaq Compaq Internet Keyboard System Control
/dev/input/event15: Compaq Compaq Internet Keyboard

Here is the output from lsusb:

Bus 001 Device 010: ID 049f:000e Compaq Computer Corp. Internet Keyboard
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x049f Compaq Computer Corp.
  idProduct          0x000e Internet Keyboard
  bcdDevice            1.00
  iManufacturer           1 Compaq
  iProduct                2 Compaq Internet Keyboard
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x003b
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          2 Compaq Internet Keyboard
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               50mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              3 Compaq Internet Keyboard
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      65
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              24
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      0 
      iInterface              4 Compaq Internet Keyboard
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     499
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0006  1x 6 bytes
        bInterval               3
Device Status:     0x0000
  (Bus Powered) 
cheshire
  • 1,109
  • 3
  • 15
  • 37
  • You don't need a drriver to change the keyboard layout. use setxkbmap. – stark Jan 03 '21 at 16:12
  • @stark that would be possible if the keys were recognized. As I said I only get the signal in wireshark, the system doesn't detect keys – cheshire Jan 03 '21 at 21:51
  • There is an oldish project called [LinEAK](http://lineak.sourceforge.net/) on SourceForge to handle these old keyboards with Linux. The latest release is from 2006. – Ian Abbott Jan 06 '21 at 18:30
  • I would recommend looking into the `tmk keyboard` collection: buy a teensy, program it, enjoy. I have been using a Sun Type 5c keyboard this way for the past maybe 8 years, replacing handbuilt adapters that I used 10 years before that. Oh -- and even the Sun keybeep is retained ;-) –  Jan 17 '21 at 21:53
  • @Roadowl I wanted to get into something similar but I am pretty unfamiliar with hardware tinkering. Thanks for the suggestion though, it's a great idea really! Also this a membrane keyboard don't know If I can just replace the board? I also wanted to know if my idea with writing the driver is possible or just overly ambitious – cheshire Jan 18 '21 at 23:43
  • Have a look here: https://loosen.home.xs4all.nl/memorex_telex/ ; leave the technical part for what it is, but scroll down and follow the link to the source code. Something like that can be done for your keyboard. –  Jan 18 '21 at 23:58
  • @Roadowl This looks promising! Thank you for this! I will try it out and update the answer if I get it to work – cheshire Jan 19 '21 at 21:29

0 Answers0