N-gram
An n-gram is a sequence of consecutive keystrokes in a particular order.
In other areas of computational linguistics and natural language processing, n-grams are more commonly defined as ordered sequences of words or characters. In the context of keyboard layout analysis, it is common to define n-grams over individual characters—or more precisely, graphemes.
Defining n-grams over characters or graphemes works well for common English keyboard layouts, but breaks down when analyzing magic keys. For example, on Magic Sturdy, pressing b followed by the magic key next to it produces the characters “before”: