Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows alt/control key modifiers #1434

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<release version="0.4.2" urgency="medium" type="development">
<description>
<ul>
<li>Fixes Windows alt/control key modifiers (#1408).</li>
<li>Fixes Windows built accidentally not including builtin-SSH support (#1427).</li>
<li>Fixes some text run segmentation problems, e.g., not making use of some programming ligatures (#395).</li>
<li>Fixes mouse scroll wheel events going into the wrong direction if `Alt` modifier was pressed at the same time (#394).</li>
Expand Down
4 changes: 3 additions & 1 deletion src/crispy/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ class flags
_value &= ~static_cast<value_type>(flags._value);
}

// Tests for existence of all given flags to be present.
// @return true if all flags are set in this flags set, false otherwise.
[[nodiscard]] constexpr bool contains(flags<flag_type> flags) const noexcept
{
return _value & flags.value();
return (_value & flags.value()) == flags.value();
}

[[nodiscard]] constexpr bool test(flag_type flag) const noexcept { return contains(flag); }
Expand Down
Loading