Skip to content

Commit

Permalink
CNX-9586 Text input not working in Rhino 8 (#3461)
Browse files Browse the repository at this point in the history
* fix: Apply text input fix from #1362 to fix Rhino8 text panel

* fix: Add missing braces
  • Loading branch information
AlanRynne authored Jun 3, 2024
1 parent 88257b8 commit e7450a2
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,24 @@ public DuiPanel()
var viewModel = new MainViewModel(SpeckleRhinoConnectorPlugin.Instance.Bindings);
DataContext = viewModel;
AvaloniaHost.Content = new MainUserControl();
AvaloniaHost.MessageHook += AvaloniaHost_MessageHook;
}
catch (Exception ex) when (!ex.IsFatal()) { }
}

private const UInt32 DLGC_WANTARROWS = 0x0001;
private const UInt32 DLGC_HASSETSEL = 0x0008;
private const UInt32 DLGC_WANTCHARS = 0x0080;
private const UInt32 WM_GETDLGCODE = 0x0087;

private IntPtr AvaloniaHost_MessageHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg != WM_GETDLGCODE)
{
return IntPtr.Zero;
}

handled = true;
return new IntPtr(DLGC_WANTCHARS | DLGC_WANTARROWS | DLGC_HASSETSEL);
}
}

0 comments on commit e7450a2

Please sign in to comment.