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

kbscan: Do not read matrix if lid is closed #426

Merged
merged 2 commits into from
Jan 4, 2024
Merged

kbscan: Do not read matrix if lid is closed #426

merged 2 commits into from
Jan 4, 2024

Conversation

crawfxrd
Copy link
Member

@crawfxrd crawfxrd commented Jan 2, 2024

Pull the lid check out to the loop to avoid accessing the matrix when we know we do not need the data. It is left in kbscan (instead of simply disabling reading) to clear the state of the matrix data.

The lid check for wake is removed as it will never be true.

@crawfxrd crawfxrd requested review from jackpot51 and a team January 2, 2024 18:34
leviport
leviport previously approved these changes Jan 2, 2024
Copy link
Member

@leviport leviport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on serw13. Keyboard is disabled when lid is closed, and enabled when lid is open.

Copy link
Member

@jackpot51 jackpot51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not properly release keys if pressed while the lid is being closed

Pull the lid check out to the loop to avoid accessing the matrix when we
know we do not need the data. It is left in kbscan (instead of simply
disabling reading) to clear the state of the matrix data.

The lid check for wake is removed as it will never be true.

Signed-off-by: Tim Crawford <[email protected]>
Signed-off-by: Tim Crawford <[email protected]>
@crawfxrd crawfxrd changed the title kbscan: Move LID_SW# check to main kbscan: Do not read matrix if lid is closed Jan 3, 2024
Copy link
Member

@leviport leviport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyboard still enables and disables as expected, and holding a key with a ruler while closing the lid makes that key get released when the lid is closed.

@crawfxrd crawfxrd merged commit 766fb73 into master Jan 4, 2024
41 checks passed
@crawfxrd crawfxrd deleted the kbscan-lid branch January 4, 2024 22:05
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

Successfully merging this pull request may close these issues.

3 participants