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

Added idle rgblight timeout feature #5475

Closed
wants to merge 1 commit into from
Closed

Added idle rgblight timeout feature #5475

wants to merge 1 commit into from

Conversation

nvitaterna
Copy link

@nvitaterna nvitaterna commented Mar 23, 2019

Description

This adds an idle timeout features (independent of your PC's sleep settings). In simple terms: if there are no keystrokes after X minutes, turn off the underglow.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@nvitaterna
Copy link
Author

It might be obvious from looking at the code, but after it has timed out a keystroke will turn on the underglow (only if it was previously turned on prior to timeout).

@drashna
Copy link
Member

drashna commented Mar 23, 2019

Honestly, from the looks of this, this is more of an extension of the RGB Light feature, rather than something separate.

And the RGB Matrix has its own version of this, already. So, this really couldn't be extended into it.

Because of that, I'd really rather see this merged more into the rgb light code, and enabled by a define, the way that animations and sleep are.
The plus side of that, is that you could actually use rgblight_task and just "return" out of the function, if the timeout has been hit. This may be a more efficient method to handle this.

(but still, as is, this is pretty awesome!)

Edit: Also, if it helps, there is also timer_read32 and timer_elapsed32 which may be helpful here. (but maybe not)

@nvitaterna
Copy link
Author

Thanks for the feedback! I'll work on merging it with the main rgb light code.

@Lenbok
Copy link
Contributor

Lenbok commented Mar 28, 2019

BTW, when you do your updated version, you should use rgblight_disable_noeeprom and rgblight_enable_noeeprom to do the turning off and on, since the blanking caused by the idle timeout is a transient setting that you do not want saved to eeprom. (e.g, you wouldn't want an unplug of the keyboard while this is timed out to mean that the keyboard next wakes up with rgb disabled.)

@drashna
Copy link
Member

drashna commented Apr 14, 2019

Have you had a chance to update this?

@Lenbok
Copy link
Contributor

Lenbok commented Apr 15, 2019

if @nvitaterna doesn't have bandwidth to update this, I'm happy to take a crack at it (I've been using a userspace version of this feature for a couple of months) - I assume I just open a new PR.

@nvitaterna
Copy link
Author

nvitaterna commented Apr 15, 2019 via email

@skullydazed
Copy link
Member

In an effort to clean up our queue I'm going to close this PR. However, we'd still like to include this feature once it's done! Please feel free to open a new PR when you are ready.

@nvitaterna nvitaterna mentioned this pull request Jul 31, 2019
13 tasks
@drashna drashna self-assigned this May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants