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

Weird behavior with key events for some keys #2645

Open
morphx666 opened this issue Apr 17, 2024 · 0 comments
Open

Weird behavior with key events for some keys #2645

morphx666 opened this issue Apr 17, 2024 · 0 comments

Comments

@morphx666
Copy link

morphx666 commented Apr 17, 2024

Expected Behavior

When pressing SHIFT + ; I'm expecting e.Key to be equal to Semicolon

Actual Behavior

When pressing SHIFT + ;, e.Key is set to None, although e.KeyChar contains the correct character.

Code that Demonstrates the Problem

renderControl.KeyDown += (sender, e) => {
    Debug.WriteLine("Key: " + e.Key);
    Debug.WriteLine("KeyData: " + e.KeyData);
    Debug.WriteLine("KeyChar: " + e.KeyChar);
    Debug.WriteLine("----------------------------------");
    HandleKeyDown(this, new XKeyEventArgs(KeyToInt(e.Key), KeyToInt(e.Modifiers)));
    e.Handled = true;
};

In this context, renderControl is a Canvas control with the CanFocus property set to true.

Here's the output from the code above, after pressing ; first and then SHIFT + ;

Key: Semicolon
KeyData: Semicolon
KeyChar: ;
----------------------------------
Key: LeftShift
KeyData: LeftShift, Shift
KeyChar: �
----------------------------------
Key: None
KeyData: Shift
KeyChar: :
----------------------------------

Specifications

  • Version: 2.8.3
  • Platform(s): Gtk, WPF works fine and I haven't tried Mac64 or macOS
  • Operating System(s): Windows 11

Addendum

Here's a list of some of the keys that don't seem to work with SHIFT:

0-9, [, ], ;, ', ,, ., /,-,`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant