upload
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

USB_NKRO.txt 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. USB NKRO MEMO
  2. =============
  3. 2010/12/09
  4. References
  5. ----------
  6. USB - boot mode, NKRO, compatibility, etc...
  7. http://geekhack.org/showthread.php?t=13162
  8. NKey Rollover - Overview, Testing Methodology, and Results
  9. http://geekhack.org/showwiki.php?title=NKey+Rollover+-+Overview+Testing+Methodology+and+Results
  10. dfj's NKRO(2010/06)
  11. http://geekhack.org/showpost.php?p=191195&postcount=251
  12. http://geekhack.org/showthread.php?p=204389#post204389
  13. Terminology
  14. ---------
  15. NKRO
  16. ghost
  17. matrix
  18. mechanical with diodes
  19. membrane
  20. OS Support Status
  21. -----------------
  22. USB NKRO is possible *without* a custom driver.
  23. At least following OS's supports.
  24. Windows7 64bit
  25. WindowsXP
  26. Windows2000 SP4
  27. Ubuntu10.4(Linux 2.6)
  28. MacOSX(To be tested)
  29. Custom Driver for USB NKRO
  30. --------------------------
  31. NOT NEEDED
  32. at least when using following report formats on Windows, Linux or MacOSX.
  33. USB NKRO methods
  34. ----------------
  35. 1. Virtual keyboards
  36. Keyboard can increase its KRO by using virtual keyboards with Standard or Extended report.
  37. If the keyboard has 2 virtual keyboard with Standard report(6KRO), it gets 12KRO.
  38. Using this method means the keyboard is a composite device.
  39. 2. Extended report
  40. It needs large report size for this method to achieve NKRO.
  41. If a keyboard has 101keys, it needs 103byte report. It seems to be inefficient.
  42. 3. Bitmap report
  43. If the keyboard has less than 128keys, 16byte report will be enough for NKRO.
  44. The 16byte report seems to be reasonable cost to get NKRO.
  45. Report Format
  46. -------------
  47. Other report formats than followings are possible, though these format are typical one.
  48. 1. Standard 8bytes
  49. modifiers(bitmap) 1byte
  50. reserved 1byte(not used)
  51. keys(array) 1byte*6
  52. Standard report can send 6keys plus 8modifiers simultaneously.
  53. Standard report is used by most keyboards in the marketplace.
  54. Standard report is identical to boot protocol report.
  55. Standard report is hard to suffer from compatibility problems.
  56. 2. Extended standard 16,32,64bytes
  57. modifiers(bitmap) 1byte
  58. reserved 1byte(not used)
  59. keys(array) 1byte*(14,32,62)
  60. Extended report can send N-keys by using N+2bytes.
  61. Extended report is expected to be compatible with boot protocol.
  62. 3. Bitmap 16,32,64bytes
  63. keys(bitmap) (16,32)bytes
  64. Bitmap report can send at most 128keys by 16bytes and 256keys by 32bytes.
  65. Bitmap report can achieve USB NKRO efficiently in terms of report size.
  66. Bitmap report needs a deliberation for boot protocol implementation.
  67. Bitmap report descriptor sample:
  68. 0x05, 0x01, // Usage Page (Generic Desktop),
  69. 0x09, 0x06, // Usage (Keyboard),
  70. 0xA1, 0x01, // Collection (Application),
  71. // bitmap of modifiers
  72. 0x75, 0x01, // Report Size (1),
  73. 0x95, 0x08, // Report Count (8),
  74. 0x05, 0x07, // Usage Page (Key Codes),
  75. 0x19, 0xE0, // Usage Minimum (224),
  76. 0x29, 0xE7, // Usage Maximum (231),
  77. 0x15, 0x00, // Logical Minimum (0),
  78. 0x25, 0x01, // Logical Maximum (1),
  79. 0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte
  80. // LED output report
  81. 0x95, 0x05, // Report Count (5),
  82. 0x75, 0x01, // Report Size (1),
  83. 0x05, 0x08, // Usage Page (LEDs),
  84. 0x19, 0x01, // Usage Minimum (1),
  85. 0x29, 0x05, // Usage Maximum (5),
  86. 0x91, 0x02, // Output (Data, Variable, Absolute),
  87. 0x95, 0x01, // Report Count (1),
  88. 0x75, 0x03, // Report Size (3),
  89. 0x91, 0x03, // Output (Constant),
  90. // bitmap of keys
  91. 0x95, (REPORT_BYTES-1)*8, // Report Count (),
  92. 0x75, 0x01, // Report Size (1),
  93. 0x15, 0x00, // Logical Minimum (0),
  94. 0x25, 0x01, // Logical Maximum(1),
  95. 0x05, 0x07, // Usage Page (Key Codes),
  96. 0x19, 0x00, // Usage Minimum (0),
  97. 0x29, (REPORT_BYTES-1)*8-1, // Usage Maximum (),
  98. 0x81, 0x02, // Input (Data, Variable, Absolute),
  99. 0xc0 // End Collection
  100. where REPORT_BYTES is a report size in bytes.
  101. Considerations
  102. --------------
  103. Compatibility
  104. boot protocol
  105. minor/old system
  106. Some BIOS doesn't send SET_PROTOCOL request, a keyboard can't switch to boot protocol mode.
  107. This may cause a problem on a keyboard which uses other report than Standard.
  108. Reactivity
  109. USB polling time
  110. OS/Driver processing time
  111. Windows Problem
  112. ---------------
  113. 1. Windows accepts only 6keys in case of Standard report.
  114. It should be able to send 6keys plus 8modifiers.
  115. 2. Windows accepts only 10keys in case of 16bytes Extended report.
  116. It should be able to send 14keys plus 8modifiers.
  117. 3. Windows accepts only 18keys in case of 32bytes Extended report.
  118. It should be able to send 30keys plus 8modifiers.
  119. If keys are pressed in excess of the number, wrong keys are registered on Windows.
  120. This problem will be reportedly fixed soon.(2010/12/05)
  121. http://forums.anandtech.com/showpost.php?p=30873364&postcount=17
  122. Tools for testing NKRO
  123. ----------------------
  124. Browser App:
  125. http://www.microsoft.com/appliedsciences/content/projects/KeyboardGhostingDemo.aspx
  126. http://random.xem.us/rollover.html
  127. Windows:
  128. AquaKeyTest.exe http://geekhack.org/showthread.php?t=6643
  129. Linux:
  130. xkeycaps
  131. xev
  132. showkeys
  133. EOF