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

One shot support for swap hands #8590

Merged
merged 1 commit into from
May 13, 2020
Merged

One shot support for swap hands #8590

merged 1 commit into from
May 13, 2020

Conversation

dutow
Copy link
Contributor

@dutow dutow commented Mar 28, 2020

This commits add the SH_OS keycode, which works similarly to one shot
layers:

  • while pressed, the keyboard is swapped
  • if no keys were pressed while it was pressed, the next key press is
    swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves #2682

Description

Types of Changes

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

Issues Fixed or Closed by This PR

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).

@drashna
Copy link
Member

drashna commented Mar 28, 2020

Nice!

Though, I would personally like to see a lot of this wrapped in #ifndef NO_ACTION_ONESHOT I think it was. That way, if oneshots are turned off....

This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
@dutow
Copy link
Contributor Author

dutow commented Mar 29, 2020

Done. Most of the blocks already had it because I've added then around the oneshot logic, and I've added it to two blocks which were missing it. I've kept the macro itself always defined, as the OSL/OSM macro behaves the same.

@drashna drashna requested a review from a team March 29, 2020 20:25
@stale
Copy link

stale bot commented May 13, 2020

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@stale stale bot removed the awaiting changes label May 13, 2020
@tzarc tzarc merged commit 805f5cb into qmk:master May 13, 2020
bitherder pushed a commit to bitherder/qmk_firmware that referenced this pull request May 15, 2020
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request May 24, 2020
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
sowbug pushed a commit to sowbug/qmk_firmware that referenced this pull request May 24, 2020
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
fdidron pushed a commit to zsa/qmk_firmware that referenced this pull request Jun 12, 2020
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
turky pushed a commit to turky/qmk_firmware that referenced this pull request Jun 13, 2020
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
jakobaa pushed a commit to jakobaa/qmk_firmware that referenced this pull request Jul 7, 2020
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
@drashna
Copy link
Member

drashna commented Aug 8, 2020

This is my fault, for not testing more thoroughly.

This commit seems to break swap hands feature, in general.

I'll see about fixing it, but if you have any insights ... see #9967.

Edit: It looks like the cleanup code should only be ran if the status is SHO_ACTIVE. It should not run on any other status. Changed logic to reflect this.

sjmacneil pushed a commit to sjmacneil/qmk_firmware that referenced this pull request Feb 19, 2021
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves qmk#2682
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.

One shot swap hands
3 participants