MT(mod, kc)acts like a modifier when held, and a regular keycode when tapped. In other words, you can have a key that sends Escape when you tap it, but functions as a Control or Shift key when you hold it down.
OSM()accept are prefixed with
MT()is limited to the Basic Keycode set, meaning you can't use keycodes like
KC_TILD, or anything greater than
0xFF. This is because QMK uses 16-bit keycodes, of which 3 bits are used for the function identifier, 1 bit for selecting right or left mods, and 4 bits to tell which mods are used, leaving only 8 bits for the keycode. Additionally, if at least one right-handed modifier is specified in a Mod-Tap, it will cause all modifiers specified to become right-handed, so it is not possible to mix and match the two - for example, Left Control and Right Shift would become Right Control and Right Shift.
process_record_user. For example, shifted keycode
KC_DQUOcannot be used with
MT()because it is a 16-bit keycode alias of
LSFT(KC_QUOT). Modifiers on
KC_DQUOwill be masked by
MT(). But the following custom code can be used to intercept the "tap" function to manually send
LT(0, kc)(layer-tap key with no practical use because layer 0 is always active) to add cut, copy and paste function to X,C and V keys when they are held down:
IGNORE_MOD_TAP_INTERRUPTis recommended when using Mod-Tap on alphanumeric keys to avoid hold function taking precendence when the next key is pressed quickly. See Ignore Mod Tap Interrupt for more details.
LT(0,KC_NO)to create a single copy-on-tap, paste-on-hold key: