From 50b58cd6a658164d153c7b5284e3d6c9c73691a7 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Mon, 28 Jan 2019 18:43:55 +0100
Subject: [PATCH] Add keyboard shortcut to open dev tools (Ctrl+Shift+I)

---
 Core/Handling/KeyboardHandlerBase.cs | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Core/Handling/KeyboardHandlerBase.cs b/Core/Handling/KeyboardHandlerBase.cs
index e3803791..60f4e424 100644
--- a/Core/Handling/KeyboardHandlerBase.cs
+++ b/Core/Handling/KeyboardHandlerBase.cs
@@ -1,9 +1,34 @@
 using System.Windows.Forms;
 using CefSharp;
+using TweetDuck.Core.Controls;
+using TweetDuck.Core.Other;
+using TweetDuck.Core.Utils;
 
 namespace TweetDuck.Core.Handling{
     class KeyboardHandlerBase : IKeyboardHandler{
         protected virtual bool HandleRawKey(IWebBrowser browserControl, IBrowser browser, Keys key, CefEventFlags modifiers){
+            if (modifiers == (CefEventFlags.ControlDown | CefEventFlags.ShiftDown) && key == Keys.I){
+                if (BrowserUtils.HasDevTools){
+                    browser.ShowDevTools();
+                }
+                else{
+                    browserControl.AsControl().InvokeSafe(() => {
+                        string extraMessage;
+                        
+                        if (Program.IsPortable){
+                            extraMessage = "Please download the portable installer, select the folder with your current installation of TweetDuck Portable, and tick 'Install dev tools' during the installation process.";
+                        }
+                        else{
+                            extraMessage = "Please download the installer, and tick 'Install dev tools' during the installation process. The installer will automatically find and update your current installation of TweetDuck.";
+                        }
+
+                        FormMessage.Information("Dev Tools", "You do not have dev tools installed. "+extraMessage, FormMessage.OK);
+                    });
+                }
+
+                return true;
+            }
+
             return false;
         }