Skip to content

Key release not detected if key was held #704

@albertvaka

Description

@albertvaka

I have a Samsung TV EU50NU7405 connected to a RaspberryPi 5.

libcec doesn't seem to emit "key pressed" events for the the "select" key, if it has been held down:

Press 'select' and release:

[command received] >> 01:44:00
[key pressed] 0 duration: 0
[command received] >> 01:45
[key pressed] 0 duration: 71

Hold 'select' down:

[command received] >> 01:44:00
[key pressed] 0 duration: 0
[command received] >> 01:45

This seems to work for directional keys, though. A difference there, however, is that I get lots of "press" events while I'm holding it down:

Hold 'left' down:

[command received] >> 01:44:03
[key pressed] 3 duration: 0
[command received] >> 01:44:03
[key pressed] 3 duration: 0
[command received] >> 01:44:03
[key pressed] 3 duration: 0
[command received] >> 01:44:03
[key pressed] 3 duration: 0
[command received] >> 01:44:03
[key pressed] 3 duration: 0
[command received] >> 01:44:03
[key pressed] 3 duration: 0
[command received] >> 01:44:03
[key pressed] 3 duration: 0
[command received] >> 01:45
[key pressed] 3 duration: 1066

I don't know the CEC protocol well enough, but it seems that the "key release" command doesn't specify which key was released, so you need to assume it's the last key that was pressed, and that there's a timeout (seems to be 500ms) after which libcec "forgets" which key was pressed. Is this correct? If it is, I guess it's a bug of my TV that it doesn't keep sending key presses regularly for 'select' while it is held and that makes us hit the timeout.

As a workaround, could we make the timeout configurable? And also, could we emit a "key released" event after the timeout? Otherwise we keep it held forever.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions