HID Keyboard Example


Results 1 to 9 of 9

Threaded View

  1. #2
    Merfy's Avatar
    Merfy Guest

    Default Keyboard Descriptors

    To implement a usb keyboard it is just a matter of setting up the descriptors properly. The hid documentation has a good example of the keyboard descriptor. http://www.usb.org/developers/devclass_docs/HID1_11.pdf

    Here is the mouse example descriptor that has been modified to work as a keyboard. To send a key stroke to the PC is as simple as (similar to mouse example included with PBP):

    USBOut 1, buffer, 8, endgame

    after initializing the device
    where buffer is 8x8bytes
    1st byte = modifier keys (i.e. ctrl, alt, shift)
    2nd byte = reserved
    3-8 = keys pressed ( 0x04 = a, 0x05 = b, ...)

    I don't know how to combine both a keyboard and a mouse together in one device but I have heard of making a composite device being one possible way. But as of yet, I have not got anything working.

    I understand this is a late reply but hopefully someone else might get something from it.
    Attached Files Attached Files

Similar Threads

  1. USB hid maker help please.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2013, 14:49
  2. i cant get 18f2550 work as HID
    By Ahmadabuomar in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 13th October 2009, 16:39
  3. AT/PS2 Keybord - PIC Interface?
    By Kamikaze47 in forum Code Examples
    Replies: 73
    Last Post: - 9th August 2009, 16:10
  4. One USB keyboard to Two USB Ports
    By picnaut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th June 2009, 00:04
  5. My wish: AT Keyboard and Mouse commands
    By sayzer in forum PBP Wish List
    Replies: 0
    Last Post: - 4th February 2006, 08:23

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts