Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keypress callback sometimes does not trigger on key release #48

Open
Janhouse opened this issue Dec 3, 2020 · 2 comments
Open

Keypress callback sometimes does not trigger on key release #48

Janhouse opened this issue Dec 3, 2020 · 2 comments

Comments

@Janhouse
Copy link
Contributor

Janhouse commented Dec 3, 2020

I noticed that sometimes my IR remote key gets stuck in pressed state. After some debugging it seems like it happens in python-cec.

To reproduce - click the same button after the initial click quickly. Quite frequently it triggers a situation where it registers only key down and does not send key up.

It does however still trigger command callback, so I'll use that for now as a workaround.

Here is some debug log from cecdaemon.

CEC DEBUG: got command callback
Got event 4 with data ({'initiator': 0, 'destination': 1, 'ack': False, 'eom': True, 'opcode': 68, 'parameters': b'\x03', 'opcode_set': True, 'transmit_timeout': 1000},)
CEC DEBUG: Callback succeeded
CEC DEBUG: got keypress callback
DEBUG:root:3 is mapped to KEY_LEFT
DEBUG:root:Key 3 down
CEC DEBUG: Callback succeeded
CEC DEBUG: got command callback
Got event 4 with data ({'initiator': 0, 'destination': 1, 'ack': False, 'eom': True, 'opcode': 69, 'parameters': b'', 'opcode_set': True, 'transmit_timeout': 1000},)
CEC DEBUG: Callback succeeded
@trainman419
Copy link
Owner

Hrm... it looks like python-cec isn't getting the keypress callback from libcec in this case. (If it was, we'd see another CEC DEBUG: got keypress callback in the debug log).

I think the next step here would be to confirm that libcec is actually generating the keypress event and attempting to deliver it, but it's been a long time and I don't remember how to check that. I suggest you start by experimenting with their command-line client ( cec-client ) to see if it has an option to log keypress events.

@Janhouse
Copy link
Contributor Author

Janhouse commented Dec 3, 2020

I put cec-client in monitor mode and it does show some output but it is the same message, so it seems like at least the raw feedback from TV is the same. But the libcec fails to figure out that one of them is key release.

I'll just use the command callback as workaround, it has the same parameters as key event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants