Welcome Guest Search | Active Topics | Sign In | Register

WPF Webbrowser - Custom shortcut fired twice when another WPF control has keyboard focus Options
Tim
Posted: Tuesday, April 29, 2014 10:24:19 AM
Rank: Member
Groups: Member

Joined: 4/8/2014
Posts: 12
I am adding a custom shortcut (F11) to the WPF Webrowser using Webview.Shortcuts. This works perfectly except when the keyboard focus is in another WPF control (e.g. textbox), then the webview command handler is executed twice rather than the expected once.

I have a simple WPF app with a webbrowser and a textbox. When the keyboard focus is in the textbox, the F11 command handler fires twice.

Code: C#
public partial class MainWindow : Window
    {
        private int command;

        public MainWindow()
        {
            InitializeComponent();

            command = CommandIds.RegisterUserCommand("MyCommand");
            webview.Shortcuts = new[] { new Shortcut(command, KeyCode.F11) };

            webview.Command += webview_Command;
        }

        private void webview_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandId == command && !e.Handled)
            {
                textbox.Text += "a";
                e.Handled = true;
            }
        }
    }
eo_support
Posted: Tuesday, April 29, 2014 4:34:58 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

We have confirmed this to be a bug. This will be fixed in our next build.

Thanks!
eo_support
Posted: Tuesday, May 6, 2014 1:47:08 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

We have posted a new build that should fix this issue. You can download it from our download page.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.