qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
18.28k stars 39.38k forks source link

[Feature Request] One Shot Next Key functionality #17738

Closed Bertie2011 closed 1 year ago

Bertie2011 commented 2 years ago

We have one shot keys for modifiers and layers, but it would be nice to have a generic "One Shot" keycode that will hold the next key pressed until another key is pressed. Kind of like key lock keycode, but without having to disable the lock afterwards.

Example: Pressing in order OS, F3, T -> Generates F3 + T

Feature Request Type

jasonm23 commented 2 years ago

This is known as a modal keymap. AFAIK there are several implementations of this, but I'll need to find something specific to be more help...

jasonm23 commented 2 years ago

Meanwhile... essentially, you create a layer for the keys that you want to use for the modal keymap (i.e. what keys you'd want to hit after the "one shot" key that activates the layer.)

Then each key in that layer does their thing and switches the keymap layer back to base.

jasonm23 commented 2 years ago

https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/vim/vim.h

Step one... see how someone is doing it.

jasonm23 commented 2 years ago

First thing to notice is that any function which is bound to a key can run any sequence of commands or keys.

So you should be able to work out that, switching back to a base layer is easy, and possible from any key in an "upper" layer.

Bertie2011 commented 2 years ago

Yeahhhh, I figured you could probably do it using functions or some other workaround like layers.... but I would rather just be able to insert a "basic keycode" into my keymap and have it work right away😅 (without it being specific to a first key or a set of second keys).

jasonm23 commented 2 years ago

.... so it should just kinda figure out what you want.

Wait for the AI QMK.

(no that's not a thing.)

github-actions[bot] commented 2 years ago

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] commented 1 year ago

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]