r3bl-org/r3bl-open-core

[tui] Remove the use of bitflags in ModifierKeysMask

Closed this issue · 0 comments

In the file

https://github.com/r3bl-org/r3bl_rs_utils/blob/main/tui/src/tui/terminal_lib_backends/modifier_keys_mask.rs#L38

we currently use bitflags.

The new release introduces a breaking change. Replace the use of bit flags with the following struct.

struct KeyModifiersMask {
  shift_key_state: ShiftKeyStates,
  alt_key_state: AltKeyStates,
  ctrl_key_state: CtrlKeyStates,
}

This is basically a non-boolean way of using 3 booleans to represent whether any or all of those modifier keys are pressed.

Also add 2 methods to this struct:

  • intersects(other): bool
  • contains(other): bool