Tell me the way to set hotkeys with the ability to reconfigure. Settings will be stored in the database. Which way to dig?

    2 answers 2

    The same C # code looks like this:

    window.InputBindings.Add( new InputBinding(ApplicationCommands.Open, new KeyGesture(Key.R, ModifierKeys.Control))); 

    You will probably need to change the ApplicationCommands.Open command to another one, and register your handler for it:

     window.CommandBindings.Add( new CommandBinding(ApplicationCommands.Open, // или другая команда DoOpen, CanOpen)); 

    The key combination can also be changed from Ctrl-R to the one that is registered in your database.

      See the KeyBinding.

       <Window.InputBindings> <KeyBinding Command="ApplicationCommands.Open" Gesture="CTRL+R" /> </Window.InputBindings> 

      this

      • one
        +1, but for the possibility of reconfiguration not to do without the code behind. - VladD
      • Yes, I would like to just reconfigure - Sergue Isupov