onKeyPress

Handles a key press event using the K3KeyId of a key.

This function attempts to look up the corresponding K3Key in the model. If the key exists, it delegates the processing to the overloaded onKeyPress function.

Return

true if the key press was successfully handled and processed; false otherwise (e.g., if the K3Key with K3KeyId could not be found or the key press was ignored).

Parameters

keyId

The K3KeyId of the pressed key.


open fun onKeyPress(key: K3Key): Boolean(source)

Handles a key press for a specific K3Key.

The function evaluates the key's properties to determine the appropriate action:

  • If the key is a gap, it is ignored.

  • If the key is associated with a layer change, it is currently ignored. (TODO: Implement layer tracking into the keystroke engine or similar).

  • If the key has an associated K3Key.output, it attempts to emit that output.

This function may be overridden in subclasses to provide custom key-handling behavior.

Return

true if the key press resulted in a successfully emitted output; false if the key was ignored, skipped, or the output emission failed.

Parameters

key

The K3Key representing the pressed key