Values and Arguments
Это содержимое пока не доступно на вашем языке.
The type of an argument determines which values and operators it accepts. The same symbol can mean something different between complete conditions and inside a value set.
Fingers and Hands
Section titled “Fingers and Hands”Use LM in the finger argument to isolate the left middle finger. Use M to match either middle finger, or LH to match any finger on the left hand.
uni.keys(events:press, finger:LM)Finger names and sets#
Left pinky#
LP
The left pinky.
bi.sf(f:LP)Left ring#
LR
The left ring finger.
bi.sf(f:LR)Left middle#
LM
The left middle finger.
bi.sf(f:LM)Left index#
LI
The left index finger.
bi.sf(f:LI)Left thumb#
LT
The left thumb.
bi.sf(f:LT)Right pinky#
RP
The right pinky.
bi.sf(f:RP)Right ring#
RR
The right ring finger.
bi.sf(f:RR)Right middle#
RM
The right middle finger.
bi.sf(f:RM)Right index#
RI
The right index finger.
bi.sf(f:RI)Right thumb#
RT
The right thumb.
bi.sf(f:RT)Pinkies#
P
Both pinkies.
bi.sf(f:P)Ring fingers#
R
Both ring fingers.
bi.sf(f:R)Middle fingers#
M
Both middle fingers.
bi.sf(f:M)Index fingers#
I
Both index fingers.
bi.sf(f:I)Left hand#
LH
Every finger and thumb on the left hand.
bi.sf(f:LH)Right hand#
RH
Every finger and thumb on the right hand.
bi.sf(f:RH)Finger Pairs and Spacing
Section titled “Finger Pairs and Spacing”For a row change from the left ring finger to the left middle finger, use LRLM in the fp argument. The order matters. A stretch threshold uses the same physical finger assignments to compare key separation with the fingers’ home spacing.
bi.rc(fp:LRLM)Ordered finger pairs#
Ordered finger pair#
LPLR
An ordered pair such as LPLR for left pinky followed by left ring.
bi.row_change(fp: LPLR)Either-hand finger pair#
EPR
The same ordered pair on either hand, such as EPR for pinky followed by ring.
bi.row_change(fp: EPR | ERP)Directions and Event Kinds
Section titled “Directions and Event Kinds”The row-change arguments are natural (nat) and inverted (inv). Releasing Shift is a single-key trigger. To select events like that one, use the kind and events arguments of triggers:
uni.triggers(events:release, kind:key)Row-change directions#
Natural#
natural
The longer finger reaches farther from the typist, regardless of keystroke order.
Aliases: nat, concordant, conc.
bi.row_change(natural)Inverted#
inverted
The shorter finger reaches farther from the typist, regardless of keystroke order.
Aliases: inv, discordant, disc.
bi.row_change(inverted)Geometry and Units
Section titled “Geometry and Units”On a standard keyboard, moving between two adjacent keys in the same row spans one key width. One u is one standard key width. Use d for key-to-key distance in a pair map and hd for home-relative distance in a key map.
bi.kp.map(d).sumLiterals and named values#
Numeric expressions accept decimal numbers, true, false, and nil. Predicate distance conditions also accept key-unit lengths such as 1.5u. Finger sets, finger pairs, participation roles, trigger kinds, sustained-key policies, and ergonomic directions use the cataloged named values.
Named arguments use name:value. A | inside an argument value forms a value set, while | between complete conditions forms a Boolean or collection union according to the surrounding type.
Geometry and key units#
distance | dx | dy | stretch
One u is one standard key width. Decimal values are accepted. distance is Euclidean key-to-key distance. dx and dy are signed as the second key position minus the first: positive x points right and positive y points toward the lower keyboard rows.
stretch is absolute horizontal key separation minus the natural horizontal spacing between the assigned fingers’ authored home positions. It is nil for cross-hand pairs, same-finger pairs, or pairs whose finger homes are unavailable.
bi.kp.map(distance).sumbi.kp.(stretch >= 1u).countGeometry values#
Key unit#
1.5u
A keyboard distance in key-width units; decimals are allowed.
Aliases: U.
bi.row_change(1u < abs(dy) < 1.5u)Row distance#
dy
The second key's row minus the first key's row, in key units.
bi.row_change(dy > 1u)Absolute value#
abs(length)
Uses distance magnitude without direction.
bi.row_change(abs(dy) > 1u)Home-relative key geometry#
Choose participating keys explicitly. Summing a chord adds its members’ distances; a mean or other chord treatment must be authored deliberately.
Distance from finger home#
hd | hdx | hdy
hd is Euclidean distance from the effective finger’s home to a physical key. hdx and hdy are signed key-minus-home offsets: positive x points right, and positive y points down. Values use key units. The long aliases are home_distance, home_dx, and home_dy.
These properties run inside a key map, not a key-pair map. They use the finger assigned to the resolved event, including alternate fingering and each member of a chord. The key’s home display flag does not define that finger’s home.
Every finger used by a key or alternate assignment must have a home position before binding or retained-report queries can proceed. Unused fingers may remain undefined. These properties return numbers, not nil; invalid home metadata is an error rather than an inferred position or zero.
uni.map(first.keys(events:press).map(hd).sum).sum / uni.map(1).sumuni.map(first.keys(events:press).map(abs(hdx) + abs(hdy)).sum).sumNamed Arguments and Defaults
Section titled “Named Arguments and Defaults”A pair can combine an active press in its first event with a key held during its second. Name the role set for each event to select those keys. Physical pairs allow separate role sets for first and second:
bi.kp(first:press, second:sustain).countTo examine a key already held at the start of the pair, swap the roles and select a carried key at first and an active press at second:
bi.kp(first:sustain, second:press).countDefault values are listed with their owning selector or predicate.
Argument syntax#
Named parameters and shorthand#
function(name:value, ...)
Named parameters use name:value and commas separate parameters. finger has the alias f; finger_pair has the alias fp. Row distance may be positional or named dy:. Stretch may be positional or named stretch:, with s: as its shorthand. natural and inverted are positional row-change conditions, with nat and inv as shorthands. The older spellings concordant and conc, and discordant and disc, still work.
first, second, sustained, events, kind, and home have no shorter parameter names. A | inside a parameter forms a set of accepted values.
bi.rc(fp:EPR | ERP, inverted, dy:abs(dy) >= 1u)bi.sf(f:LI | RI)