Extra Notes
First we will cover the finer details about timing of the key expressions, and the order in which keys are pressed and released. There's some cases we haven't explicitly talked about yet.
Timing details
Here are some details you might want to consider about delays
as they might catch you off-guard otherwise.
The default delay
initially set
Both hold
and wait
are automatically set to 100ms. So, without touching the default delay
, your key expressions
will automatically have those delays.
Differences between the two holding syntaxes
As mentioned before, the difference between |...|
and |...
shows up when it is time to release an already held key.
The difference is that |...|
means that if the key is already held, it will be released alongside all the other keys being released (meaning after the hold
for that expression).
With |...
, if the key is already held, it will instantly release regardless of the hold
.
Potential errors from key expressions
We will talk about two errors here, but first a note about how order and capital letters are handled.
The order in which keys are pressed in combined expressions
The "combined expressions" are referring to the ones where both held keys and simply pressed ones are present. All you need to know is that the held keys do get pressed first.
Of course in those types of expressions, they all happen at roughly the same time, but not exactly at the same time, so the held keys are pressed very slightly before.
How capital letters are handled
Capital letters are not actually pressable keys themselves, it's a combination between SHIFT
and a key or CAPS_LOCK
being down and pressing a key.
How the capitals are actually taken care of depends on the software running the compiled file, which is much easier to configure than the compiler itself.
Generally, what will happen is SHIFT
simply gets held alongside the rest of the keys from the point the capital is present in the expression, so be careful not to introduce conflicts.
Two possible errors
The first error that can happen is from declaring the same key twice in the expression as pressed. Of course, pressing a
and pressing a
, for example, does not make much sense.
Another error is from having a key both in the pressed and held sections of a combined expression.