godot-rust / godot-rust/gdext

Bitwise `&` against `KeyModifierMask` not implemented for `Key`

Open Beginner friendly
#1,694 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
5.2k
Forks
312
Avg merge
11h 10m
Merged PRs (30d)
10

Description

I wrote the following and got a compiler error:

```rust
let press = x.get_physical_keycode_with_modifiers();
let k = press & KeyModifierMask::CODE_MASK;
```

```
central.rs(659, 5): `Key` does not implement `BitAnd`
```

However, it looks like `BitOr` is implemented.

I'm using `godot = "0.5.5"`.

Contributor guide

Open the contributing guide

Research direction

Start at central.rs around line 659 and inspect the existing BitOr implementation for Key and KeyModifierMask. Add the corresponding BitAnd behavior for the reported expression, then verify that code using KeyModifierMask::CODE_MASK compiles and behaves consistently with BitOr.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot, rust
Domain
game-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.