KeyPress Being Eaten by ArcGIS Pro

387
2
12-07-2023 05:21 AM
KrisCulin
Occasional Contributor

Hi All,

I am hoping someone in the community can help me.  Even better, someone on the AGP development team will see this post and jump on it.

We currently have an AGP configuration to host our application inside ArcGIS Pro.  We started initially with ArcGIS Pro 2.6.  We just recently upgraded our code base to target net6 and we now support ArcGIS Pro 3.1+.

We also have 27 docking windows in our application.  These controls are Windows Forms controls, and we host them inside of a WindowsFormsHost in the DockPane in ArcGIS Pro.  We did this in ArcGIS Pro 2.6+ and brought it forward to ArcGIS 3.1+.

However, we have noticed one major regression.  Keypresses are being eaten by ArcGIS Pro 3.1+.  So, if a user tries to rename a node in one of our docking windows and starts typing, not all the letters will be typed.  If I type the alphabet a-z, only the letters "efghiklrt" are typed into the node's label.  All other letters are skipped/ignored.

This behavior works 100% in ArcGIS Pro 2.x.  It does NOT work in ArcGIS Pro 3.x.

I have attached two samples.  AGPEatenKeysAddIn.zip is for ArcGIS Pro 3.x.  AGPEatenKeysAppAGP2.zip is for AGP2.  All you need to do is extract, open the solution, build and run in the appropriate version of AGP.  There is a button on the Add In tab that will open the dock pane that is in the add-in.  Just rename any node in the tree provided and start typing.  Note that in the AGP2 sample F2 won't rename, and you'll need to single click the node with the mouse to start editing node.  F2 is implemented in the AGP3 sample.

We are not in the position to switch our controls to WPF.  It was already an 18-month effort to target net6 and it would take far longer to start using WPF in any capacity.  Using WPF controls is *NOT* an option.

Any suggestions for a workaround are appreciated and will be considered.  I am really hoping an ESRI developer will dig into this issue.  Maybe they can find a work around but better is to fix the issue since it is a regression.

If you have any questions or need more information, please ask.

TIA,

Kris

2 Replies
KoryKramer
Esri Community Moderator

Hi @KrisCulin Sorry you're running into this, and thank you for posting with details. The development team has taken a look and created the following bug: [BUG-000163593: Key processing impacted in dockpanes that host WinForms based content]

We will work on getting a fix into the next patch for ArcGIS Pro 3.2.

KrisCulin
Occasional Contributor

Thank you, Kory.  As a developer, I know how crucial it is to have sample code that reproduces an issue.  It makes it a lot easier to diagnosis the issue and fix it.  So, it was my pleasure to put something together.

An AGP developer has been in contact already, and I've brought my manager into the email thread, so he is kept abreast of the status.  We look forward to the patch with the fix.

Kris