Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

feat(LibInputBackend): Intercept Keyboard events

Open workgroupengineering opened this issue 2 years ago • 19 comments

What does the pull request do?

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

  • [ ] Added unit tests (if possible)?
  • [ ] Added XML documentation to any related classes?
  • [ ] Consider submitting a PR to https://github.com/AvaloniaUI/Documentation with user documentation

Breaking changes

Obsoletions / Deprecations

Fixed issues

workgroupengineering avatar Jul 18 '22 13:07 workgroupengineering

You can test this PR using the following package version. 0.10.999-cibuild0022203-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

avaloniaui-team avatar Jul 18 '22 14:07 avaloniaui-team

Note that for correct key handling and keystroke conversions you'll need to use libxkbcommon.

kekekeks avatar Jul 18 '22 14:07 kekekeks

You can test this PR using the following package version. 0.10.999-cibuild0022216-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

avaloniaui-team avatar Jul 18 '22 15:07 avaloniaui-team

@kekekeks while working in this PR, I found a problem. Avalonia Key enum has not keys from F25 to F35. How How can I map them??

workgroupengineering avatar Sep 15 '22 09:09 workgroupengineering

We can add F25-F35 if needed. I'm not sure if there are keyboards with such keys though.

kekekeks avatar Sep 15 '22 09:09 kekekeks

@kekekeks Can you suggest a Linux dist where I can test Framebuffer in Hyper-V? I try with ubuntu but i have some problems.

workgroupengineering avatar Sep 19 '22 07:09 workgroupengineering

I was only testing with bare-metal (various Intel and ARM devices) and with qemu.

According to this Phoronix article the proper support for DRM/KMS in Hyper-V should be available starting with Linux 5.14.

Also, try running kmscube, if it runs the problem might be an Avalonia bug.

If you have problems with pointer input, make sure that Hyper-V provides an absolute pointing device (tablet/touchscreen) and that said device is properly recognized by libinput list-devices and produces absolute positioned events for libinput debug-events

kekekeks avatar Sep 19 '22 15:09 kekekeks

hi kekekeks, thanks for the tips, i found the solution using vfb.

I have design doubts that I would like to discuss. the features I would like to implement:

  • Select Keybord Layout
  • Allow Custom Keybord Layout
  • Management of multiple keyboards, mouses and touch screens
  • Inject a custom handler for libinput events
  • Support to Seat

The questions are:

  • for configuration:
    • [ ] Add parameter to StartLinux*
    • [ ] Extend AppBuilder
  • for management of multiple keyboards, mouses and touch screens. Avalonia currently creates a MouseDevice and Touch Device instance for all connected devices. https://github.com/AvaloniaUI/Avalonia/blob/e57e0b76fceb118ed15260844b4eae025662f6a6/src/Linux/Avalonia.LinuxFramebuffer/Input/LibInput/LibInputBackend.cs#L15-L16 is it better to add a Source property or create an instance for each device? Adding the source property could lead to consistency issues, creating multiple instances could be a waste of memory.

workgroupengineering avatar Sep 22 '22 13:09 workgroupengineering

@kekekeks

What is the correlation between RawKeyEventArgs and EventArgs RawTextInputEventArgs?

workgroupengineering avatar Sep 26 '22 13:09 workgroupengineering

You can test this PR using the following package version. 11.0.999-cibuild0029320-beta. (feed url: https://pkgs.dev.azure.com/AvaloniaUI/AvaloniaUI/_packaging/avalonia-all/nuget/v3/index.json) [PRBUILDID]

avaloniaui-team avatar Jan 31 '23 18:01 avaloniaui-team

You can test this PR using the following package version. 11.0.999-cibuild0037518-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-team avatar Jul 07 '23 17:07 avaloniaui-team

You can test this PR using the following package version. 11.0.999-cibuild0039353-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-team avatar Sep 11 '23 07:09 avaloniaui-team

You can test this PR using the following package version. 11.0.999-cibuild0039814-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-team avatar Sep 22 '23 14:09 avaloniaui-team

What's the status here @workgroupengineering @maxkatz6 ?

jmacato avatar Nov 17 '23 07:11 jmacato

missing review

workgroupengineering avatar Nov 17 '23 10:11 workgroupengineering

You can test this PR using the following package version. 11.1.999-cibuild0043135-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Dec 22 '23 15:12 avaloniaui-bot

You can test this PR using the following package version. 11.1.999-cibuild0044713-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Feb 09 '24 11:02 avaloniaui-bot

You can test this PR using the following package version. 11.1.999-cibuild0045487-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Mar 01 '24 11:03 avaloniaui-bot

You can test this PR using the following package version. 11.1.999-cibuild0045790-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Mar 06 '24 14:03 avaloniaui-bot