picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.52k stars 319 forks source link

Weird behavior with key events for some keys #2645

Closed morphx666 closed 5 days ago

morphx666 commented 2 months ago

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

Addendum

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

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