ПО, ЭВМ и АСУ из Таможенного Союза

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » ПО, ЭВМ и АСУ из Таможенного Союза » Клавиатуры » keyboard report format


keyboard report format

Сообщений 1 страница 4 из 4

1

The "scan codes" (they are really indexes to usage codes) are published on usb.org in the USB HID Usage Tables specification in Chapter 10 "Keyboard/Keypad Page (0x07)". A typical keyboard report layout can be found in the USB Device Class Specification for HID in Appendix B "Boot Interface Descriptors", section "B.1 Protocol 1 (Keyboard)".

That describes the keyboard report format as:

Byte 0: Keyboard modifier bits (SHIFT, ALT, CTRL etc)
Byte 1: reserved
Byte 2-7: Up to six keyboard usage indexes representing the keys that are
          currently "pressed".
          Order is not important, a key is either pressed (present in the
          buffer) or not pressed.

USB spec doesn't define keyboard layouts. It simply lists the usage codes assigned to particular key functions. The letter "a" is usage code 0x04 for example. If you want an uppercase "A", then you would also need to set the Byte 0 modifier bits to select "Left Shift" (or "Right Shift").

https://stackoverflow.com/questions/270 … umentation
https://www.usb.org/sites/default/files … 1_12v2.pdf

0

2

Там есть диапазон "usage id":
232-65535 E8-FFFF Reserved

В него можно было бы запихать все русские буквы и даже с кодами равными Unicode Codepoint,
однако мне не ясно, как так usage id больше одного байта, если там формат по байту?

Usages are 32-bit identifiers, where the high order 16 bits represents the usage page and the low order 16
bits represents the usage ID. To allow more compact Report descriptors, Usage Page items can be declared
to specify the high order bits of the Usage item and the Usage items can declare only the ID portion of the
usage, as follows:
• If the bSize field of the Usage item equals 1 or 2, the entire 1- or 2-byte data portion of the item is
interpreted as a usage ID.
• If the bSize field equals 3, bits 16-31 of the 4-byte data portion of the item are interpreted as a usage
page, and bits 0-15 of the data portion are interpreted as a usage ID. This interpretation of usages
applies to Usage, Usage Minimum, and Usage Maximum items.

HID parser processes USAGE ID as unsigned 16-bits (2 bytes) value. But on report descriptor, one byte representation is allowed, to save report descriptor size. The size of USAGE value is shown at bSize field of the USAGE tag.

Отредактировано Лис (2022-12-31 12:16:49)

0

3

0x06 Keyboard HID_USAGE_GENERIC_KEYBOARD

http://microterm.ru/f/hid_rus.pdf

Кратко суть проблемы:
1) лисоклава-2022 должна вводить русские буквы, потому что эти буквы сразу русские
2) операционная система работает с USB-устройствами
3) в USB-протоколе клавиатуры занимаются тем, что вводят английские символы
      и только уже гораздо позже операционная система используя раскладку переколдовывает те символы в русские буквы.

Так быть не должно. Лисоклава должна позволять вводить конкретно русские буквы сразу, невзирая на раскладку.

Делать устройство, которое работает не по USB протоколу? Писать модуль ядра для Linux, чтобы правильно вводились символы?
В общем, проблема-то оказывается программистская, а вовсе не в проектировании аппаратной части и
дороговизне изготовления штучных изделий.

А кто вы все здесь, как не программисты? Один я тут пользователь-с-лапками! Верно, MihalNik?

Отредактировано Лис (2022-12-31 12:48:22)

0

4

Лис написал(а):

однако мне не ясно, как так usage id больше одного байта, если там формат по байту?

Используется 6 байт.
Если из всех шести нажатых одновременно клавиш
каждая соответствует одному байту,
то подобных клавиш можно зажать шесть штук.
Если же для каждой клавиши соответствует два байта,
то таких клавиш одновременно можно зажать только три.
И, разумеется, есть промежуточные варианты:
четыре и пять клавиш одновременно.

0


Вы здесь » ПО, ЭВМ и АСУ из Таможенного Союза » Клавиатуры » keyboard report format