gdext icon indicating copy to clipboard operation
gdext copied to clipboard

Using a modifier key simultaneosly with another key causes panic in `get_keycode_with_modifiers`

Open jrockett6 opened this issue 1 year ago • 3 comments

This only occurs when a modifier key is used simultaneously with another key.

(small discord discussion)

OS: Mac 12.5 Godot: 4.1.stable master branch

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PrimitiveConversionError { from: 71303190, into_ty: PhantomData<i32> }', /Users/jrockett/.cargo/git/checkouts/gdext-76630c89719e160c/780a62a/godot-core/src/gen/classes/input_event_key.rs:271:95
stack backtrace:
   0: rust_begin_unwind
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1791:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1113:23
   4: godot_core::gen::classes::input_event_key::re_export::InputEventKey::get_keycode_with_modifiers
             at /Users/jrockett/.cargo/git/checkouts/gdext-76630c89719e160c/780a62a/godot-core/src/gen/classes/input_event_key.rs:271:17
   5: ... user code ...

jrockett6 avatar Jul 18 '23 21:07 jrockett6

godot doesn't label Key as a bitfield so we only allow the values enumerated in the extension api. however this api returns an integer with specific bits set for each modifier. basically treating it like a bitfield.

lilizoey avatar Jul 18 '23 21:07 lilizoey

Is it then an upstream issue?

Bromeon avatar Jul 18 '23 21:07 Bromeon

Is it then an upstream issue?

im not sure?

lilizoey avatar Jul 19 '23 15:07 lilizoey