Skip to content

Ignore key up events if they are not for push button actions#274

Merged
emcek merged 4 commits intobugfix_for_320from
prevent_duplicate_button_action_events
Mar 4, 2024
Merged

Ignore key up events if they are not for push button actions#274
emcek merged 4 commits intobugfix_for_320from
prevent_duplicate_button_action_events

Conversation

@sleighzy
Copy link
Copy Markdown
Collaborator

@sleighzy sleighzy commented Mar 3, 2024

Description

The G-Key SDK and handler send a 1 for key down and 0 for key up. For "push button" actions the key up and key down work as expected when the request bytes are retrieved from the button. When using a button with something like CUSTOM or CYCLE however this is sending the custom request bytes twice, once when the key is pressed down, and then again when the key is released.

The changes in this PR are to ignore the key up events for keys that aren't push buttons are only sent once, i.e. when the button is pressed.

NOTE: The test_logitech.test_keyboard_check_buttons unit test is currently failing due to these changes. I don't know enough about this tests intent and the usage of call etc. to know what should be changed for this one.

Comment thread dcspy/logitech.py
Comment thread dcspy/logitech.py
Comment thread dcspy/models.py
Comment thread dcspy/models.py
Comment thread dcspy/logitech.py
@sleighzy sleighzy requested a review from emcek March 3, 2024 06:09
@emcek emcek added this to the Release 3.2.0 milestone Mar 3, 2024
@emcek emcek added bug Something isn't working internal Internal changes labels Mar 3, 2024
Comment thread dcspy/logitech.py
Comment thread dcspy/models.py
Comment thread tests/test_models.py Outdated
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 4, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 95.84% (+0.009%) from 95.831%
when pulling f2d8a52 on prevent_duplicate_button_action_events
into 0e386aa on bugfix_for_320.

@emcek emcek merged commit 637e98d into bugfix_for_320 Mar 4, 2024
@emcek emcek deleted the prevent_duplicate_button_action_events branch March 4, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working internal Internal changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants