How to Chord Words?

I want to hold down the key 't' and tap 'h' to equal "there". When I do so however, it works, but what also works it tapping both 't' and 'h'. I don't want tapping 't' and 'h' to equal 'there', only when I hold 't' and tap 'h'.
Is there a way to essentially hold down normal letters as modifier keys and to be able to hold down certain letters and combine them simultaneously to equal whole words?

Basically, maybe, but probably no, and almost certainly not a good idea.

It's not impossible that you could perhaps jury rig something, maybe use a USB Device Key trigger to detect the press and then release of the 't' key, and remember the state in the “T is Pressed” variable, and then another one to trigger when the 'h' key is pressed, and then check the state of the “T is Pressed” variable and either type the extra characters or not.

But it would be astoundingly convoluted and unlikely to be overly reliable (keeping in mind of example that simulating typing a t will release a pressed t which may cause other issues in such a convoluted setup).

I suggest you find a different approach.

"Find a different approach" really is the better way here. For example, make a macro to insert text in response to a typed string trigger such as "thh" or "th;"

Your preferred method could be easily set up with a combination of Keyboard Maestro and a programmable keyboard using QMK; or for a conventional keyboard maybe you could put something together with the help of Karabiner Elements. But I really don't think you should bother.

And as with many questions here, many of us could probably provide some very good solutions if we knew the exact problem you were trying to solve, versus the solution you were trying to implement.

Is there a particular thing you're doing that requires holding T then pressing H, or is it just a method you'd like to use to expand a number of defined shortcuts into full words?

-rob.

I don't know much and maybe I'm misunderstanding something, but I I would try this.

t = t (is tapped)
t = no action (long pressed)

Yes, I would like to be able to use normal letters as modifier keys so I don't have to move my fingers so far, and in order to increase the number of available modifier keys. I'd move some of these to the home row for example.
Additionally, I've learned about the concept of chording where you can press down a few letters at a time and a whole word outputs which can increase typing speed immensely with less finger work, so that's why I'm asking about that as well.
I have a ton of hotkey setup with Keyboard Maestro, but if I use the same keys for anything else, then they clash and think that I'm doing the same key command and it asks me which one I want to execute.


image

In this example, you can see that two hotkeys are clashing. They both have a second tap of "A", but the first hold letter is different, so I don't know why Keyboard Meastro is mixing the two and can't accurately differentiate.
I installed Karabiner and was excited about it, however, whenever I use it, it cancels all the previous Keyboard Maestro commands I have setup, so I can't use both at the same time.

1 Like

OK, thanks, that helps. If I were setting this up, I'd probably just go with one- or two-letter combos followed by the Space Bar, something like this:

You can't see them in the screenshot, but there's a space after "th" in the trigger, and after "there" in the replacement bit. It's incredibly natural to type "th space," which then inserts the full word and the following space, so you're ready to insert the next word.

This would let you use 325 two-letter combinations, and 26 single-letter combinations, minus a few single- and double-letter words. If you go up to three-letter combos, you gain another 2600 possibilities, minus a number of three-letter actual words, but probably still 2500+.

CAUTION I FORGOT TO INCLUDE: If you use Space Bar, you also can't use combos that would appear at the end of regular words, such as in my example (whoops!). So you could either use the ; (or some other non-letter character) as someone suggested earlier, or just make sure your combos aren't word-ending combos, i.e. zs or tth, etc.

And by using the space as the trigger character, you'll always be ready to type the next word. The other advantage of this method is that it doesn't depend on timing of long presses, or holding one character down while typing another. You just type as normal, and your expansions appear.

That's what I'd do, anyway :slight_smile:, though I'm not sure this fully matches what you're trying to do.

-rob.

Thank you, that does help somewhat, it's another take on shortened strings that equal longer words, which I will definitely take a look at. I think there could be some value with that. And your stats on single, double triple combinations, how did you do that? That's another interesting idea. There's really only one single "a", which is relevant in English so it's true, I could have a single "r" which equals a word, that's brilliant.
I'd still like to try the chord combos idea because it might be more forgiving on the order or would minimize the actions to less, but I just got a Glove80, and hopefully their software can get me the rest of the way. Thank you

Those numbers are just combinations math. We're picking 2 letters from 26 letters, so the formula is:

26! / ((26-2)!*2!) = 325

There are actually more possibilities than that, as repeats (bb, cc, etc.) would be legal, but that's a messier formula that I didn't bother doing on the first reply:

(2 + 26 - 1)! / (2! * (26-1)!) = 351

Thankfully, there are online calculators for this, so you don't have to remember the messy formulas :).

-rob.

Well why didn't you say... The Glove80 uses ZMK, which was inspired by QMK!

So here's the idea, which should translate easily from QMK to ZMK (I'll refer to the ZMK Web site).

Create a layer that is activated by a "layer-tap".

The "layer-tap" behavior enables a layer when a key is held, and outputs a keypress when the key is only tapped for a short time.

So tapping the "t" key would produce a "t", but holding it would switch to the new layer. Within that layer, the "h" key could be set to produce not the usual "h" keycode, but another keycode that you don't need... I don't know... say function key F24? (Experiment!).

That F24 could then be used as a trigger for KM to type or paste "th".

Again... I wouldn't take this approach (it's needlessly fiddly), so I don't recommend it but if nothing else, I hope that's an interesting idea to start with. You may well find a better way, but that's the method that occurred to me.

I just realized that, as an alternative to th;, you could use double-spaces instead of single spaces at the end of the trigger string.

Then if you typed with Joe, you'd get with Joe, but if you typed th[space][space], you'd get there. Probably a bit easier on the fingers than reaching for a non-alpha key.

-rob.

Here is an excellent guide to home row mods. Warning: to get the idea working just right for you, you will have a lot of tweaking of parameters ahead of you. I found it paid off; not everybody does. :game_die:

1 Like

Just out of curiosity: Is that how you do it? And does it work well for you? It's actually nothing more than short/long press. The problem with it is that if one letter is typed when you release it and the next when you press it, the letters get twisted if you type fast enough.

1 Like

Yes, double-space is what I always used to use (I won't tell you what I use now; it's non-intuitive outside my keyboard layout!). Semicolon is a great choice, perhaps especially if used as a prefix rather than a suffix, e.g. ";th" – it is even less likely to clash with any other typing intention.

I did mention:

The cadence of one's typing certainly does become more important the fancier one gets. Hence my warning about home row mods:

But essentially you have the same sort of challenge as hitting the Shift key at the right time in conventional typing. It's just that you end up with far more interesting typos. :laughing:

1 Like

Ah, yes, sorry, I didn't read carefully enough. :crazy_face: A variation of short/long press works well for me with keys that I don't need for normal typing. I do this with 4 and 8, both of which I can now reach blindly with my index fingers. As long as I press and hold 4 or 8, another "row" is active. When I let go, everything is as before.

Yes, good stuff. The layout of my keyboard (essentially a grid) means that my left index finger finds "3" easily, and, since the (ANSI) key cap for that also has a "#" on it, that was my choice of key to switch to a "number pad" layer when held. :upside_down_face:

1 Like

So we have found a similar solution. :slightly_smiling_face:

I once tried to set it up so that all keys (letters and others) are triggered when released. That's fascinating, letters are typed with a short tap. And if you hold down a key a little longer, another action is triggered and you can see how this action is executed. A lot could be done with this, but unfortunately some apps do not react as expected when Enter or similar keys are triggered on release. So, unfortunately a failure :man_shrugging:

1 Like

I don't undertstand the formula. Why is picking 2 letters from 26, where duplications are allowed, any more complicated than simply

26*26 = 676

And if duplications are not allowed, then there's 26 duplicates to eliminate:

26*26 - 26 = 650

And why "2 factorial" (2!). Isn't that just 2? And you have (26-2)! in the denominator of the faction, so your result (without actually doing the calculation) should certainly be less than 1, not hundreds.

See, this is why I don't do math :slight_smile: ... I used combinations, and should have used permutations. (And also had a typo, 2! instead of 26! in the numerator, in the combinations formula.) And you're right, permutations are much simpler, and your numbers are correct.

For anyone who might care :), the actual formulas are:

No repetition: 26! / (26 - 2)! = 650
Repetition: 26^2 = 676

Sorry for the confusion, and thanks for catching the errors, @August!

-rob.