Skip to content

Engine → Platform → input_state.h

key_bitset

Syntax

struct key_bitset

Variables

AccessNameTypeDefaultDescription
publicWORD_COUNTstatic constexpr u32KEY_COUNT / 64
publicwordsstd::array<u64, WORD_COUNT>{}

Functions

Public

any

[[nodiscard]] constexpr bool any() const noexcept;

True when at least one bit is set.

clear

constexpr void clear() noexcept;

Clears every bit.

count

[[nodiscard]] constexpr u32 count() const noexcept;

Number of set bits.

reset

constexpr void reset(
    key code) noexcept;

Clears the key's bit.

set

constexpr void set(
    key code) noexcept;

Sets the key's bit.

test

[[nodiscard]] constexpr bool test(
    key code) const noexcept;

True when the key's bit is set.

Operator Overloads

Public

operator==

[[nodiscard]] constexpr bool operator==(
    const key_bitset &) const noexcept = default;