Module basalt::input

source ·
Expand description

System for handling input related events.

Weights

A weight can be assigned to each hook via the respective builder. Weight defines the order in which hooks of the same class are called. A higher weight will be called first. Hooks that have a weight specified can also block the execution of hooks in the same class by a NoPass varient of InputHookCtrl.

Press/Hold/Release Weight Class

These hook types all share the same weighing. An important note with this class is that window hooks will get called before bin hooks. A press hook with a higher weight than a release hook that returns a NoPass varient of InputHookCtrl will prevent the release from being called if the either share a key. Likewise with a hold, a press of a higher weight can prevent it getting it called, but unlike release it will not prevent it from getting released.

Enter/Leave

Window and Bins are seperate in the class of weights. Only hooks targeted for bins can prevent hooks towards bins. Likewise with windows. A hook can effect multiple bins depending of if require_on_top has been set to false. In this case hooks on different bins can block the execution of one another.

Character

Window and Bins are treated the same. They are called in order of their weight. Calling a NoPass varient of InputHookCtrl prevents the execution of all lesser weighed hooks.

Focus/FocusLost

Similar to Enter/Leave, but a hook can not effect multiple bins.

Scroll

Similar to Enter/Leave, but windows and bins are in the same class of weights.

Cursor

Same behavior as Scroll.

Motion

Similar to Character, but there are no targets.

Re-exports

Modules

  • Collection of builders used for Input.
  • Various Key related definitions
  • Various state related definitions

Structs

Enums