tests_kernel.test_keyboard module

class ArrayKeyboard(rdesc=[5, 1, 9, 6, 161, 1, 5, 7, 25, 224, 41, 231, 21, 0, 37, 1, 117, 1, 149, 8, 129, 2, 149, 6, 117, 8, 21, 0, 38, 164, 0, 5, 7, 25, 0, 41, 164, 129, 0, 192], name=None, input_info=None)

Bases: BaseKeyboard

report_descriptor = [5, 1, 9, 6, 161, 1, 5, 7, 25, 224, 41, 231, 21, 0, 37, 1, 117, 1, 149, 8, 129, 2, 149, 6, 117, 8, 21, 0, 38, 164, 0, 5, 7, 25, 0, 41, 164, 129, 0, 192]
class BaseKeyboard(rdesc, name=None, input_info=None)

Bases: UHIDTestDevice

create_array_report(keys, reportID=None, application=None)

Return an input report for this device.

Parameters:
  • keys – a tuple of chars for the pressed keys. The class maintains the list of currently pressed keys, so to release a key, the caller needs to call again this function without the key in this tuple.

  • reportID – the numeric report ID for this report, if needed

event(keys, reportID=None, application=None)

Send an input event on the default report ID.

Parameters:

keys – a tuple of chars for the pressed keys. The class maintains the list of currently pressed keys, so to release a key, the caller needs to call again this function without the key in this tuple.

class BaseTest

Bases: object

class TestKeyboard

Bases: TestUhid

test_modifiers()
test_single_key()

check for key reliability.

test_two_keys()
exception InvalidHIDCommunication

Bases: Exception

class KeyboardData

Bases: object

class LEDKeyboard(rdesc=[5, 1, 9, 6, 161, 1, 5, 7, 25, 224, 41, 231, 21, 0, 37, 1, 117, 1, 149, 8, 129, 2, 149, 1, 117, 8, 129, 1, 149, 5, 117, 1, 5, 8, 25, 1, 41, 5, 145, 2, 149, 1, 117, 3, 145, 1, 149, 6, 117, 8, 21, 0, 38, 164, 0, 5, 7, 25, 0, 41, 164, 129, 0, 192], name=None, input_info=None)

Bases: ArrayKeyboard

report_descriptor = [5, 1, 9, 6, 161, 1, 5, 7, 25, 224, 41, 231, 21, 0, 37, 1, 117, 1, 149, 8, 129, 2, 149, 1, 117, 8, 129, 1, 149, 5, 117, 1, 5, 8, 25, 1, 41, 5, 145, 2, 149, 1, 117, 3, 145, 1, 149, 6, 117, 8, 21, 0, 38, 164, 0, 5, 7, 25, 0, 41, 164, 129, 0, 192]
class PlainKeyboard(rdesc=[5, 1, 9, 6, 161, 1, 133, 1, 5, 7, 25, 224, 41, 231, 21, 0, 37, 1, 117, 1, 149, 8, 129, 2, 25, 0, 41, 151, 21, 0, 37, 1, 117, 1, 149, 152, 129, 2, 192], name=None, input_info=None)

Bases: BaseKeyboard

report_descriptor = [5, 1, 9, 6, 161, 1, 133, 1, 5, 7, 25, 224, 41, 231, 21, 0, 37, 1, 117, 1, 149, 8, 129, 2, 25, 0, 41, 151, 21, 0, 37, 1, 117, 1, 149, 152, 129, 2, 192]
class PrimaxKeyboard(rdesc=[5, 1, 9, 6, 161, 1, 5, 7, 25, 224, 41, 231, 21, 0, 37, 1, 117, 1, 149, 8, 129, 2, 117, 8, 149, 1, 129, 1, 5, 8, 25, 1, 41, 3, 117, 1, 149, 3, 145, 2, 149, 1, 117, 5, 145, 1, 21, 0, 38, 255, 0, 25, 0, 42, 255, 0, 5, 7, 117, 8, 149, 6, 129, 0, 192], name=None, input_info=None)

Bases: ArrayKeyboard

report_descriptor = [5, 1, 9, 6, 161, 1, 5, 7, 25, 224, 41, 231, 21, 0, 37, 1, 117, 1, 149, 8, 129, 2, 117, 8, 149, 1, 129, 1, 5, 8, 25, 1, 41, 3, 117, 1, 149, 3, 145, 2, 149, 1, 117, 5, 145, 1, 21, 0, 38, 255, 0, 25, 0, 42, 255, 0, 5, 7, 117, 8, 149, 6, 129, 0, 192]
class TestArrayKeyboard

Bases: TestKeyboard

create_device()
test_10_keys()
class TestLEDKeyboard

Bases: TestKeyboard

create_device()
class TestPlainKeyboard

Bases: TestKeyboard

create_device()
test_10_keys()
class TestPrimaxKeyboard

Bases: TestKeyboard

create_device()