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

KeyEvent.scancode is not a scancode? #226

Open
cjmayo opened this issue Jan 3, 2025 · 3 comments
Open

KeyEvent.scancode is not a scancode? #226

cjmayo opened this issue Jan 3, 2025 · 3 comments

Comments

@cjmayo
Copy link

cjmayo commented Jan 3, 2025

As far as I can understand EV_KEY code is a key code (mapped from the scancode, reported in an EV_MSC type MSC_SCAN value).

@sezanzeb
Copy link
Collaborator

sezanzeb commented Jan 4, 2025

EV_KEY is the type of event. There is also EV_REL and EV_ABS. Events of the EV_KEY type can have codes like KEY_A, KEY_B, and so on.

@cjmayo
Copy link
Author

cjmayo commented Jan 6, 2025

Yes, so KeyEvent.keycode has the string representation like KEY_A, KeyEvent.scancode is the integer for the key code, not the scancode (maybe for an AT keyboard it happens to be the same number???).

@sezanzeb
Copy link
Collaborator

sezanzeb commented Jan 6, 2025

Ah, I misunderstood your question (Maybe I should have also read the headline). Looking at the python code, KeyEvent.scancode is indeed the events code, like KEY_A. There is no mapping happening.

I honestly never worked with EV_MSC events, so I would have to look definitions up to answer further questions.

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