From 302636701dc529fe290cdb19d2c162af3b5c489c Mon Sep 17 00:00:00 2001 From: Sigmanor Date: Sun, 5 Feb 2017 22:38:26 +0200 Subject: [PATCH] Opening links by holding the shift key --- Crypto Notepad/Form1.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Crypto Notepad/Form1.cs b/Crypto Notepad/Form1.cs index bf57675..b4e2964 100644 --- a/Crypto Notepad/Form1.cs +++ b/Crypto Notepad/Form1.cs @@ -21,6 +21,7 @@ public partial class MainWindow : Form string[] args = Environment.GetCommandLineArgs(); int caretPos = 0; string appName = Assembly.GetExecutingAssembly().GetName().Name + " – "; + bool shiftPresed; public MainWindow() { InitializeComponent(); @@ -1041,11 +1042,19 @@ private void customRTB_Click(object sender, EventArgs e) private void customRTB_KeyDown(object sender, KeyEventArgs e) { caretPos = customRTB.SelectionStart; + if (e.KeyCode == Keys.ShiftKey) + { + shiftPresed = true; + } } private void customRTB_LinkClicked(object sender, LinkClickedEventArgs e) { - Process.Start(e.LinkText); + if (shiftPresed) + { + shiftPresed = false; + Process.Start(e.LinkText); + } } void customRTB_DragDrop(object sender, DragEventArgs e) @@ -1075,6 +1084,11 @@ void customRTB_DragDrop(object sender, DragEventArgs e) DecryptAES(); } + private void customRTB_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.ShiftKey) + { + shiftPresed = false; } }