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

Add native one-handed support #671

Merged
merged 4 commits into from
Aug 23, 2016
Merged

Add native one-handed support #671

merged 4 commits into from
Aug 23, 2016

Conversation

Talljoe
Copy link
Contributor

@Talljoe Talljoe commented Aug 21, 2016

This PR adds the ability to bind a key to swap the keyboard layout to support one-hand typing. Nominally this means mirroring the keyboard, but the map is configurable so this can be used, for instance, to swap between QWERTY and COLEMAK without defining a new layer.

The swap happens very early in key resolution so it is compatible with layers, tap dance, leader keys, etc. It simply rewrites col/row from the matrix decoder to a (potentially) different col/row. The redirect is remembered so key releases occur on the same key as the press, regardless of the current swap state. This state is a simple bitmap and with a small memory footprint of 8/16/32 bits per row depending on the number of columns (i.e. 4*16 bits for Planck).

I have a partial change to add one-shot support to the one-hand key but it is not included here. I think some refactoring of one-shot is in order as the interactions between mod, layer, and one-hand one-shots gets very complicated.

This adds an action, `ACTION_SWAP_HANDS`, that swaps the the keys on the keyboard across a keymap-defined hemisphere in order to support one-hand typing without requiring a separate one-handed layer. See updated `doc/keymap.md` for more information.
@jackhumbert
Copy link
Member

Awesome! Thanks :)

@jackhumbert jackhumbert merged commit fb4452c into qmk:master Aug 23, 2016
@Talljoe Talljoe deleted the one-hand branch August 23, 2016 04:30
@dragonfax
Copy link
Contributor

@Talljoe

Do I have to use KC_FN0 to activate the feature? I tried to set it up without a function action, instead using regular key code. But it doesn't seem to work.

dragonfax@cbef729

It compiles okay. And it seems to recognize the options and the SWAP key code. Tapping space bar doesn't type a space until release (as expected). Holding space doesn't type a space at all on release (as expected).

But it never swaps any keys. It types all keys the same whether I'm holding space or not.

@dragonfax
Copy link
Contributor

@jackhumbert Any suggestions from you, to try and get this to work? Maybe you could try it out on a board real quick, just to verify for me that I'm not crazy.

@Talljoe
Copy link
Contributor Author

Talljoe commented Oct 10, 2017

I tried it and sure enough it doesn't work if you just put the action code in the map. Not sure why. Hopefully Jack has some insight into what the difference is.

@dragonfax
Copy link
Contributor

Meh. Thats good enough. At least I know how to fix it now.

@r2d2rogers
Copy link
Contributor

I have mine in the action functions, I didn't think to try it the way you have it in your example.

@dragonfax
Copy link
Contributor

Hmm. I'm trying to figure out how the docs on swap hands disappeared. They're not in the keymap.md anymore.

@Talljoe
Copy link
Contributor Author

Talljoe commented Mar 7, 2018

Looks like it disappeared in the doc refactoring. I've recreated them in pull request #2489.

BlueTufa pushed a commit to BlueTufa/qmk_firmware that referenced this pull request Aug 6, 2021
rti pushed a commit to rti/qmk_firmware that referenced this pull request Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants