Skip to content

Commit

Permalink
fix(gtk): Fix get scan code in GtkKeyboardInputSource
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed May 10, 2024
1 parent 292e14b commit 8ad0fbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Uno.UI.Runtime.Skia.Gtk/Input/GtkKeyboardInputSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ private void OnKeyPressEvent(EventKey evt)
this.Log().Trace($"OnKeyPressEvent: {evt.Key} -> {virtualKey}");
}

InputHelper.TryConvertKeyCodeToScanCode(evt.HardwareKeycode, out var scanCode);
var scanCode = EventHelper.GetScancode(evt);

KeyDown?.Invoke(this, new(
"keyboard",
virtualKey,
GetKeyModifiers(evt.State),
new CorePhysicalKeyStatus
{
ScanCode = scanCode,
ScanCode = (uint)scanCode,
RepeatCount = 1,
},
KeyCodeToUnicode(evt.HardwareKeycode, evt.KeyValue)));
Expand All @@ -79,15 +79,15 @@ private void OnKeyReleaseEvent(EventKey evt)
this.Log().Trace($"OnKeyReleaseEvent: {evt.Key} -> {virtualKey}");
}

InputHelper.TryConvertKeyCodeToScanCode(evt.HardwareKeycode, out var scanCode);
var scanCode = EventHelper.GetScancode(evt);

KeyUp?.Invoke(this, new(
"keyboard",
virtualKey,
GetKeyModifiers(evt.State),
new CorePhysicalKeyStatus
{
ScanCode = scanCode,
ScanCode = (uint)scanCode,
RepeatCount = 1,
},
KeyCodeToUnicode(evt.HardwareKeycode, evt.KeyValue)));
Expand Down

0 comments on commit 8ad0fbd

Please sign in to comment.