qmk_firmware icon indicating copy to clipboard operation
qmk_firmware copied to clipboard

[Feature Request] LED indicator for One Shot Key

Open lesca opened this issue 1 year ago • 3 comments

Feature Request Type

  • [ ] Core functionality
  • [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
  • [ ] Alteration (enhancement/optimization) of existing feature(s)
  • [X] New behavior

Description

Hello, I am using one shot key but to find it's easy to forget the status that if "one shot key" is on or off.

Currently, I define this to auto timeout one shot key after 2s.

#define ONESHOT_TIMEOUT 2000  /* Time (in ms) before the one shot key is released */

However, I think it would be better if there could be a LED indicator as CAPS_LOCK does. That is, when I hit CAPS_LOCK, the LED under the key is on; and when I hit it again, the LED is off.

Do you think it is possible to implement this for One Shot Key? Or can you point me to a direction to implement it myself.

One shot key is really a good feature. Thanks for your great efforts!

Regards, Lesca

lesca avatar Aug 03 '23 02:08 lesca

QMK only has global implementations for indicators supported by the USB HID standard: https://docs.qmk.fm/#/feature_led_indicators?id=led-indicators

However, you could implement this functionality in your own personal keymap. The specifics would really depend on the keyboard you're working with. For example, this keymap uses three single-color LEDs to indicate layer: https://github.com/qmk/qmk_firmware/blob/37b62606cec1cce42b4c1c0035c72bc021f549d8/keyboards/wsk/gothic70/keymaps/via/keymap.c#L60-L76

lesshonor avatar Aug 03 '23 16:08 lesshonor

get_oneshot_mods and is_oneshot_layer_active() can be used to determine the status.

I use get_oneshot_mods to display the mod status on my oleds.

drashna avatar Sep 30 '23 07:09 drashna

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs. For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

github-actions[bot] avatar Dec 30 '23 01:12 github-actions[bot]

This issue has been automatically closed because it has not had activity in the last 30 days. If this issue is still valid, re-open the issue and let us know. // [stale-action-closed]

github-actions[bot] avatar Jan 30 '24 01:01 github-actions[bot]